qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/i386/pc: when adding reserved E820 entries do not allocat


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/i386/pc: when adding reserved E820 entries do not allocate dynamic entries
Date: Thu, 10 Feb 2022 17:10:06 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

On 10/2/22 14:28, Ani Sinha wrote:
When adding E820_RESERVED entries we also accidentally allocate dynamic
entries. This is incorrect. We should simply return early with the count of
the number of reserved entries added.

fixes: 7d67110f2d9a6("pc: add etc/e820 fw_cfg file")

8 years old, so this path is clearly untested (unused...?).

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

cc: kraxel@redhat.com
Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
  hw/i386/e820_memory_layout.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/hw/i386/e820_memory_layout.c b/hw/i386/e820_memory_layout.c
index bcf9eaf837..afb08253a4 100644
--- a/hw/i386/e820_memory_layout.c
+++ b/hw/i386/e820_memory_layout.c
@@ -31,6 +31,8 @@ int e820_add_entry(uint64_t address, uint64_t length, 
uint32_t type)
          entry->type = cpu_to_le32(type);
e820_reserve.count = cpu_to_le32(index);
+
+        return index;
      }
/* new "etc/e820" file -- include ram too */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]