On Mon, Oct 22, 2018 at 02:06:13PM +0800, Baoquan He wrote: >On 10/22/18 at 05:30am, Fan, Chao wrote: >> >> +static void get_acpi_rsdp(acpi_physical_address *rsdp_addr) >> >> +{ >> >> +#ifdef CONFIG_KEXEC >> >> + unsigned long long res; >> >> + int len = 0; >> >> + char *val; >> >> + >> >> + val = malloc(20); >> > >> >Why is the length 20? Defined a macro? >> > >> >> Not a calculation, if it's enough to store the address, that will be OK. > >Sorry, I didn't catch. It's 16 in setup_acpi_rsdp() of >drivers/acpi/osl.c . What does 'that' mean? The second parameter of kstrtoull(), the 16 you mentioned means hexadecimal, not the length. I checked my host and guest, the value are ACPI20=0xbfbfa014, ACPI20=0xdb807000. The length of memory is 8. Well the max memory address is 16, add "0x" and '\0' is 19. So I set it as 20. I am not sure whether 8 is enough for the address, if OK, 11 will be enough, or 19 is OK. If my understanding is wrong, please tell me. Thanks, Chao Fan > >Wondering why not making it 200, it's also enough to store the address. > >