From 2e324e43532f9bd755632389d3133bc2644a75ec Mon Sep 17 00:00:00 2001
From: Florent Gluck <florent.gluck@hesge.ch>
Date: Tue, 1 Oct 2024 09:51:54 +0200
Subject: [PATCH] Fixed typo in 02-KVM.md: run instead of kvm_run (thanks to
 Mr. Bach)

---
 course/02-KVM.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/course/02-KVM.md b/course/02-KVM.md
index 6c24187..aa8549e 100644
--- a/course/02-KVM.md
+++ b/course/02-KVM.md
@@ -742,7 +742,7 @@ How does VMM retrieve an hypercall's parameters?
 
 ```{.c .tiny}
 if (run->io.direction == KVM_EXIT_IO_OUT) {  // See struct kvm_run in "(6) Create a vCPU"
-    uint8_t *addr = (uint8_t *)kvm_run + run->io.data_offset;
+    uint8_t *addr = (uint8_t *)run + run->io.data_offset;
     uint32_t value;
     switch (run->io.size) {
         case 1:  // Retrieve the 8-bit value written by the guest
@@ -804,7 +804,7 @@ if (run->mmio.is_write) {  // See struct kvm_run in "(6) Create a vCPU"
  
 ```{.c .tiny}
 if (run->io.direction == KVM_EXIT_IO_IN) {  // See struct kvm_run
-  uint8_t *addr = (uint8_t *)kvm_run + run->io.data_offset;
+  uint8_t *addr = (uint8_t *)run + run->io.data_offset;
   switch (run->io.size) {
     case 1: { // Guest is reading 8 bits from the port
       *addr = 0x12;  // 8-bit example value injected into the guest
-- 
GitLab