lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 22 Oct 2018 05:30:38 +0000
From:   "Fan, Chao" <fanc.fnst@...fujitsu.com>
To:     Baoquan He <bhe@...hat.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>,
        "linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "bp@...en8.de" <bp@...en8.de>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "hpa@...or.com" <hpa@...or.com>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "msys.mizuma@...il.com" <msys.mizuma@...il.com>,
        "Indoh, Takao" <indou.takao@...itsu.com>,
        "Cao, Jin" <caoj.fnst@...fujitsu.com>
Subject: Re: [PATCH v9 5/8] x86/boot: Add get_acpi_rsdp() to parse RSDP in
 cmdlien from kexec

On Sun, Oct 21, 2018 at 10:26:50AM +0800, Baoquan He wrote:
>On 10/17/18 at 06:20pm, Chao Fan wrote:
>> If KEXEC write the RSDP pointer to cmdline, parse the cmdline
>> and use it.
>> Imitate from early_param of "acpi_rsdp".
>> 
>> Signed-off-by: Chao Fan <fanc.fnst@...fujitsu.com>
>> ---
>>  arch/x86/boot/compressed/acpitb.c | 23 +++++++++++++++++++++++
>>  1 file changed, 23 insertions(+)
>> 
>> diff --git a/arch/x86/boot/compressed/acpitb.c b/arch/x86/boot/compressed/acpitb.c
>> index 50fa65cf824d..37b1f4407be8 100644
>> --- a/arch/x86/boot/compressed/acpitb.c
>> +++ b/arch/x86/boot/compressed/acpitb.c
>> @@ -8,6 +8,9 @@
>>  #include <linux/numa.h>
>>  #include <linux/acpi.h>
>>  
>> +#define STATIC
>> +#include <linux/decompress/mm.h>
>> +
>>  /* Search EFI table for RSDP table. */
>>  static void efi_get_rsdp_addr(acpi_physical_address *rsdp_addr)
>>  {
>> @@ -200,3 +203,23 @@ static void bios_get_rsdp_addr(acpi_physical_address *rsdp_addr)
>>  		*rsdp_addr = (acpi_physical_address)address;
>>  	}
>>  }
>> +
>> +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.

Thanks,
Chao Fan

>> +	len = cmdline_find_option("acpi_rsdp", val, 20);
>> +
>> +	if (len == -1)
>> +		return;
>> +
>> +	if (len > 0) {
>> +		val[len] = 0;
>> +		*rsdp_addr = (acpi_physical_address)kstrtoull(val, 0, &res);
>> +	}
>> +#endif
>> +}
>> -- 
>> 2.17.2
>> 
>> 
>> 
>
>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ