Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-16 Thread Chao Fan
On Tue, Oct 16, 2018 at 02:40:36PM +0200, Borislav Petkov wrote: >On Tue, Oct 16, 2018 at 10:48:44AM +0800, Chao Fan wrote: >> Sorry for disturbing you again, I want to make sure this detail with you. >> You mean that I need splite this as a function and put it to >> cmdline.c, right? > >Extract th

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-16 Thread Borislav Petkov
On Tue, Oct 16, 2018 at 10:48:44AM +0800, Chao Fan wrote: > Sorry for disturbing you again, I want to make sure this detail with you. > You mean that I need splite this as a function and put it to > cmdline.c, right? Extract that functionality into a generic helper so that handle_mem_options() and

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-15 Thread Chao Fan
On Thu, Oct 11, 2018 at 12:57:08PM +0200, Borislav Petkov wrote: >On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: [...] >> +#ifdef CONFIG_KEXEC >> +static bool get_acpi_rsdp(acpi_physical_address *rsdp_addr) >> +{ >> +char *args = (char *)get_cmd_line_ptr(); >> +size_t len = strle

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-15 Thread Chao Fan
On Mon, Oct 15, 2018 at 04:26:09PM -0400, Masayoshi Mizuma wrote: >Hi Chao, > >Let me add some suggestions. Thanks for your review and suggestion. I will change them in next version. Thanks, Chao Fan > >On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: >> There is a bug that kaslr may ra

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-15 Thread Masayoshi Mizuma
Hi Chao, Let me add some suggestions. On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: > There is a bug that kaslr may randomly chooses some positions > which are located in movable memory regions. This will break memory > hotplug feature and make the movable memory chosen by KASLR can't

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-12 Thread Chao Fan
On Fri, Oct 12, 2018 at 11:46:55AM +0200, Borislav Petkov wrote: >On Fri, Oct 12, 2018 at 05:36:38PM +0800, Chao Fan wrote: >> Prefer to compile out entire functions, rather than portions of functions or >> portions of expressions. Rather than putting an ifdef in an expression, >> factor >> out p

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-12 Thread Borislav Petkov
On Fri, Oct 12, 2018 at 05:36:38PM +0800, Chao Fan wrote: > Prefer to compile out entire functions, rather than portions of functions or > portions of expressions. Rather than putting an ifdef in an expression, > factor > out part or all of the expression into a separate helper function and apply

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-12 Thread Chao Fan
On Thu, Oct 11, 2018 at 12:57:08PM +0200, Borislav Petkov wrote: >On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: [...] >> + * If ACPI20 table not found, but ACPI table found, >> + * use the ACPI table and return true. >> + * If neither ACPI table nor A

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-11 Thread Chao Fan
On Thu, Oct 11, 2018 at 12:57:08PM +0200, Borislav Petkov wrote: >On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: >> There is a bug that kaslr may randomly chooses some positions >> which are located in movable memory regions. This will break memory >> hotplug feature and make the movable

Re: [PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-11 Thread Borislav Petkov
On Wed, Oct 10, 2018 at 04:41:17PM +0800, Chao Fan wrote: > There is a bug that kaslr may randomly chooses some positions > which are located in movable memory regions. This will break memory > hotplug feature and make the movable memory chosen by KASLR can't be > removed. So dig SRAT table from AC

[PATCH v8 1/3] x86/boot: Add acpitb.c to parse acpi tables

2018-10-10 Thread Chao Fan
There is a bug that kaslr may randomly chooses some positions which are located in movable memory regions. This will break memory hotplug feature and make the movable memory chosen by KASLR can't be removed. So dig SRAT table from ACPI tables to get memory information. Imitate the ACPI code of par