|
From: | Xiaoyao Li |
Subject: | Re: [PATCH v4 6/9] hw/i386/pc: Initialize ram_memory variable directly |
Date: | Wed, 22 Feb 2023 10:38:04 +0800 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.8.0 |
On 2/14/2023 12:20 AM, Bernhard Beschow wrote:
Going through pc_memory_init() seems quite complicated for a simple assignment.
...
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5bde4533cc..00ba725656 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -143,6 +143,7 @@ static void pc_init1(MachineState *machine, if (xen_enabled()) { xen_hvm_init_pc(pcms, &ram_memory); } else { + ram_memory = machine->ram; if (!pcms->max_ram_below_4g) { pcms->max_ram_below_4g = 0xe0000000; /* default: 3.5G */ } @@ -205,8 +206,7 @@ static void pc_init1(MachineState *machine,/* allocate ram and load rom/bios */if (!xen_enabled()) { - pc_memory_init(pcms, system_memory, - rom_memory, &ram_memory, hole64_size);
IMHO, it seems more proper to put + ram_memory = machine->ram; here rather than above.
+ pc_memory_init(pcms, system_memory, rom_memory, hole64_size); } else { pc_system_flash_cleanup_unused(pcms); if (machine->kernel_filename != NULL) {
[Prev in Thread] | Current Thread | [Next in Thread] |