[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [SeaBIOS] [RFC PATCH 9/9] enable memory devices if e820
From: |
Wen Congyang |
Subject: |
Re: [Qemu-devel] [SeaBIOS] [RFC PATCH 9/9] enable memory devices if e820 entry is present |
Date: |
Thu, 26 Apr 2012 08:58:00 +0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 |
At 04/19/2012 10:08 PM, Vasilis Liaskovitis Wrote:
> On a reboot, seabios regenerates srat/ssdt objects. If a valid e820 entry is
> found spanning the whole address range of a hotplug memory device, the
> device
> will be enabled. This ensures persistency of hotplugged memory slots across
> VM
> reboots.
>
> Signed-off-by: Vasilis Liaskovitis <address@hidden>
> ---
> src/acpi.c | 6 +++++-
> src/memmap.c | 15 +++++++++++++++
> 2 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/src/acpi.c b/src/acpi.c
> index 5580099..2ebed2e 100644
> --- a/src/acpi.c
> +++ b/src/acpi.c
> @@ -601,7 +601,11 @@ build_memssdt(void)
> for (i = 0; i < nb_memdevs; i++) {
> mem_base = (((u64)(entry->base_addr_high) << 32 )|
> entry->base_addr_low);
> mem_len = (((u64)(entry->length_high) << 32 )| entry->length_low);
> - *(ssdt_ptr++) = 0x00;
> + if (find_e820(mem_base, mem_len, E820_RAM)) {
This line will break the building:
Compilation complete. 0 Errors, 16 Warnings, 0 Remarks, 259 Optimizations
Compiling whole program out/ccode32flat.o
src/acpi.c: In function ‘build_memssdt’:
src/acpi.c:604: warning: implicit declaration of function ‘find_e820’
src/memmap.c:137: note: previous definition of ‘find_e820’ was here
src/acpi.c:604: error: ‘E820_RAM’ undeclared (first use in this function)
src/acpi.c:604: error: (Each undeclared identifier is reported only once
src/acpi.c:604: error: for each function it appears in.)
make: *** [out/ccode32flat.o] Error 1
You should declare the function find_e820() in src/memmap.h and include
this header file in src/acpi.c.
Thanks
Wen Congyang
> + *(ssdt_ptr++) = 0x01;
> + }
> + else
> + *(ssdt_ptr++) = 0x00;
> entry++;
> }
> build_header((void*)ssdt, SSDT_SIGNATURE, ssdt_ptr - ssdt, 1);
> diff --git a/src/memmap.c b/src/memmap.c
> index 56865b4..9790da1 100644
> --- a/src/memmap.c
> +++ b/src/memmap.c
> @@ -131,6 +131,21 @@ add_e820(u64 start, u64 size, u32 type)
> //dump_map();
> }
>
> +// Check if an e820 entry exists that covers the memory range
> +// [start, start+size) with same type as type.
> +int
> +find_e820(u64 start, u64 size, u32 type)
> +{
> + int i;
> + for (i=0; i<e820_count; i++) {
> + struct e820entry *e = &e820_list[i];
> + if ((e->start <= start) && (e->size >= (size + start - e->start)) &&
> + (e->type == type))
> + return 1;
> + }
> + return 0;
> +}
> +
> // Report on final memory locations.
> void
> memmap_finalize(void)
- [Qemu-devel] [RFC PATCH 2/9][SeaBIOS] Implement acpi-dsdt functions for memory hotplug., (continued)
- [Qemu-devel] [RFC PATCH 2/9][SeaBIOS] Implement acpi-dsdt functions for memory hotplug., Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 3/9][SeaBIOS] acpi: generate hotplug memory devices., Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 1/9][SeaBIOS] Add SSDT memory device support, Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 4/9] Implement memslot device abstraction, Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 5/9] acpi_piix4: Implement memory device hotplug registers, Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 9/9][SeaBIOS] enable memory devices if e820 entry is present, Vasilis Liaskovitis, 2012/04/19
- Re: [Qemu-devel] [SeaBIOS] [RFC PATCH 9/9] enable memory devices if e820 entry is present,
Wen Congyang <=
- [Qemu-devel] [RFC PATCH 8/9] pc: adjust e820 map on hot-add and hot-remove, Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 6/9] pc: pass paravirt info for hotplug memory slots to BIOS, Vasilis Liaskovitis, 2012/04/19
- [Qemu-devel] [RFC PATCH 7/9] Implement memslot command-line option and memslot hmp command, Vasilis Liaskovitis, 2012/04/19