On Tue, Apr 02, 2019 at 09:53:51AM +, Junichi Nomura wrote:
>On Tue, Apr 02, 2019 at 05:41:49PM +0800, Chao Fan wrote:
>> [ 77.989030] kexec_core: Starting new kernel
>> early console in extract_kernel
>> input_data: 0x00017f6033b1
>> input_len: 0
On Tue, Apr 02, 2019 at 02:58:53PM +0800, Pingfan Liu wrote:
>On Tue, Apr 2, 2019 at 1:20 PM Chao Fan wrote:
>>
>> On Tue, Apr 02, 2019 at 12:10:46PM +0800, Pingfan Liu wrote:
>> >crashkernel=x@y or or =range1:size1[,range2:size2,...]@offset option may
>> or or?
&g
d
>region.
>
>Signed-off-by: Pingfan Liu
>Cc: Thomas Gleixner
>Cc: Ingo Molnar
>Cc: Borislav Petkov
>Cc: "H. Peter Anvin"
>Cc: Baoquan He
>Cc: Will Deacon
>Cc: Nicolas Pitre
>Cc: Pingfan Liu
>Cc: Chao Fan
>Cc: "Kirill A. Sh
On Fri, Mar 29, 2019 at 09:37:00AM +, Junichi Nomura wrote:
>On 3/29/19 6:16 PM, Borislav Petkov wrote:
>> On Fri, Mar 29, 2019 at 05:05:50PM +0800, Chao Fan wrote:
>>> But in my code, I am not sure which version will be found firstly, so I
>>> write this logic
On Tue, Mar 26, 2019 at 05:43:48PM +0800, Baoquan He wrote:
>On 03/26/19 at 05:36pm, Chao Fan wrote:
>> On Tue, Mar 26, 2019 at 05:30:57PM +0800, Baoquan He wrote:
>> >On 03/26/19 at 10:23am, Michal Hocko wrote:
>> >> On Tue 26-03-19 17:02:24, Baoquan He wrote:
side, closing with ``*/`` on a line by itself.
See Documentation/doc-guide/kernel-doc.rst for more details.
Hope that can help you.
Thanks,
Chao Fan
>
>>
>> Acked-by: Michal Hocko
>> > ---
>> > v1-v2:
>> > Add comments to explain what the returned v
if you post new version, you can add:
Tested-by: Chao Fan
Thanks,
Chao Fan
>crashkernel=x@y option may fail to reserve the required memory region if
>KASLR puts kernel into the region. To avoid this uncertainty, making KASLR
>skip the required region.
>
>Signed-off-by: Pingfan L
On Wed, Mar 13, 2019 at 12:19:31PM +0800, Pingfan Liu wrote:
Hi Pingfan,
I wonder your test method and test case.
Do you test it in the Qemu guest or real machine.
Thanks,
Chao Fan
>crashkernel=x@y option may fail to reserve the required memory region if
>KASLR puts kernel into the
On Mon, Mar 04, 2019 at 01:55:46PM +0800, Baoquan He wrote:
>The declarations related to immovable memory handling are put out of
>the BOOT_COMPRESSED_MISC_H #ifdef scope, wrap them inside.
Looks good, thank you for the fix.
Thanks,
Chao Fan
>
>Signed-off-by: Baoquan He
>---
em_regions(void);
> #else
> static inline int count_immovable_mem_regions(void) { return 0; }
> #endif
>+
>+#endif
If it will look better:
+#endif /* BOOT_COMPRESSED_MISC_H */
I am sorry that I should say that in your V1 version, but I really
forgot it after noticing that PATCH log.
Thanks,
Chao Fan
>--
>2.17.2
>
>
>
On Mon, Mar 04, 2019 at 12:18:20PM +0800, Baoquan He wrote:
>The declarations related to immovable memory handling are put out of
>
>Signed-off-by: Baoquan He
Are there some problems in your mail tool?
I can only see one line in the PATCH log and seems a half sentence.
Thanks,
your effort.
Thanks,
Chao Fan
>3a63f70bf4c3 x86/boot: Early parse RSDP and save it in boot_params
>
>Findind out those SRAT handling related declarations are out of
>BOOT_COMPRESSED_MISC_H ifdeffery. Is this made on purpose?
>
>Saw "misc.h" is included in several places,
eturn 1;
> }
> }
>- return 0;
> #endif
>+ return 0;
Make sense, thanks for your PATCH.
Thanks,
Chao Fan
> }
>
> #ifdef CONFIG_EFI
>--
>2.20.1
>
>
>
omas Gleixner
>Cc: Ingo Molnar
>Cc: Borislav Petkov
>Cc: "H. Peter Anvin"
>Cc: Baoquan He
>Cc: Will Deacon
>Cc: Nicolas Pitre
>Cc: Pingfan Liu
>Cc: Chao Fan
>Cc: "Kirill A. Shutemov"
>Cc: Ard Biesheuvel
>Cc: li
On Fri, Feb 15, 2019 at 10:28:41AM +0100, Borislav Petkov wrote:
>On Fri, Feb 15, 2019 at 05:10:47PM +0800, Chao Fan wrote:
>> If "acpi=off" specified in cmdline, the whole functions of acpi.c
>> should not work, there is no need to ealy parse RSDP, so detect
>> &qu
If "acpi=off" specified in cmdline, the whole functions of acpi.c
should not work, there is no need to ealy parse RSDP, so detect
"acpi=off" in the very first place.
Also replace magic number with macro.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 12
On Wed, Feb 13, 2019 at 09:50:10AM +0100, Borislav Petkov wrote:
>On Wed, Feb 13, 2019 at 04:12:21PM +0800, Chao Fan wrote:
>> Yes, I tried the 32-bit OVMF and rootfs from Guenter.
>
>Ok, thanks.
>
>Final version of the fix coming up...
Thanks so much for your he
On Wed, Feb 13, 2019 at 09:01:27AM +0100, Ard Biesheuvel wrote:
>On Wed, 13 Feb 2019 at 08:59, Chao Fan wrote:
>>
>> On Wed, Feb 13, 2019 at 08:36:12AM +0100, Boris Petkov wrote:
>> >On February 13, 2019 2:54:29 AM GMT+01:00, Chao Fan
>> > wrote:
>> >&
On Wed, Feb 13, 2019 at 08:36:12AM +0100, Boris Petkov wrote:
>On February 13, 2019 2:54:29 AM GMT+01:00, Chao Fan
>wrote:
>>Yes, your PATCH really works well. I tried both efi32 OVMF and efi64
>>OVMF, all boot.
>
>What about the real hardware you are normally testing
to work. Chao, please run it too.
Yes, your PATCH really works well. I tried both efi32 OVMF and efi64
OVMF, all boot.
Thanks,
Chao Fan
>
>Thx.
>
>---
>diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
>index c5a949335d8b..0d97aa8bd01f 100644
>--
to work. Chao, please run it too.
Ah, I will try and test more then reply to mail list.
Thanks,
Chao Fan
>
>Thx.
>
>---
>diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
>index c5a949335d8b..0d97aa8bd01f 100644
>--- a/arch/x86/boot/compressed/acp
On Mon, Feb 11, 2019 at 11:08:00AM +0100, Borislav Petkov wrote:
>On Mon, Feb 11, 2019 at 05:30:33PM +0800, Chao Fan wrote:
>> Yes, I download your ovmf file in linux-build-test/rootfs/firmware/ from
>> your link. There are two files, efi32 and efi64. Then I try to run:
>
>Yo
On Mon, Feb 11, 2019 at 09:57:02AM +, Ard Biesheuvel wrote:
>On Mon, 11 Feb 2019 at 10:56, Chao Fan wrote:
>>
>> On Mon, Feb 11, 2019 at 09:46:03AM +, Ard Biesheuvel wrote:
>> >On Mon, 11 Feb 2019 at 01:22, Borislav Petkov wrote:
>> >>
>> &
e that you are using the correct stride when
>iterating over config_tables.
Here I use signature to judge it.
If the signature is EFI64_LOADER_SIGNATURE, I will use efi_config_table_64_t,
if the signature is EFI32_LOADER_SIGNATURE, I will use efi_config_table_32_t.
But the efi32 whose signature is EFI32_LOADER_SIGNATURE points to a
address above 4G, I am not sure whether this is normal and works well.
Thanks,
Chao Fan
>
>
On Fri, Feb 08, 2019 at 11:02:48AM -0800, Guenter Roeck wrote:
>Hi,
>
>On Fri, Feb 01, 2019 at 03:01:11AM -0800, tip-bot for Chao Fan wrote:
>> Commit-ID: 3a63f70bf4c3a17f5d9c9bf3bc3288a23bdfefce
>> Gitweb:
>> https://git.kernel.org/tip/3a63f70bf4c3a17f5d9c9bf
t;length;
>+ num++;
>+ }
> }
It looks better in another mail where you add a new function.
Thanks,
Chao Fan
>
> if (num >= MAX_NUMNODES*2) {
>@@ -320,
're using a 32-bit EFI BIOS.
>
>Which begs the question whether EFI system tables can even be mapped at
>something above 4G with a 32-bit EFI and whether that could work ok.
>Hmm.
Thanks for your help. As you said, I am not wure whether 32-bit EFI can
map table address above 4G.
If the map m
On Fri, Feb 08, 2019 at 08:10:24PM +0100, Borislav Petkov wrote:
>On Fri, Feb 08, 2019 at 11:02:48AM -0800, Guenter Roeck wrote:
>> Hi,
>>
>> On Fri, Feb 01, 2019 at 03:01:11AM -0800, tip-bot for Chao Fan wrote:
>> > Commit-ID: 3a63f70bf4c3a17f5d9c9b
Commit-ID: 02a3e3cdb7f12fb8589e4a2e85d23c9e6544b54a
Gitweb: https://git.kernel.org/tip/02a3e3cdb7f12fb8589e4a2e85d23c9e6544b54a
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:49 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:55 +0100
x86/boot: Parse SRAT table
Commit-ID: 690eaa53205769fd5c0c36e3aa737a615135f969
Gitweb: https://git.kernel.org/tip/690eaa53205769fd5c0c36e3aa737a615135f969
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:50 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:55 +0100
x86/boot/KASLR: Limit
Commit-ID: 3a63f70bf4c3a17f5d9c9bf3bc3288a23bdfefce
Gitweb: https://git.kernel.org/tip/3a63f70bf4c3a17f5d9c9bf3bc3288a23bdfefce
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:48 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:55 +0100
x86/boot: Early parse RSDP
Commit-ID: 93a209d495d7d0bc9b6186a4495934f70402
Gitweb: https://git.kernel.org/tip/93a209d495d7d0bc9b6186a4495934f70402
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:47 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:55 +0100
x86/boot: Search for RSDP
Commit-ID: 33f0df8d843deb9ec24116dcd79a40ca0ea8e8a9
Gitweb: https://git.kernel.org/tip/33f0df8d843deb9ec24116dcd79a40ca0ea8e8a9
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:46 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:54 +0100
x86/boot: Search for RSDP
Commit-ID: 3c98e71b42a7d0c14639ccb565ea315f3c887f92
Gitweb: https://git.kernel.org/tip/3c98e71b42a7d0c14639ccb565ea315f3c887f92
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:45 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:54 +0100
x86/boot: Add "acpi
Commit-ID: de50ce20cd05da4d1a7e5709a12fc23bc0b66be9
Gitweb: https://git.kernel.org/tip/de50ce20cd05da4d1a7e5709a12fc23bc0b66be9
Author: Chao Fan
AuthorDate: Wed, 23 Jan 2019 19:08:44 +0800
Committer: Borislav Petkov
CommitDate: Fri, 1 Feb 2019 11:52:54 +0100
x86/boot: Copy kstrtoull
On Thu, Jan 31, 2019 at 10:20:13PM +0100, Borislav Petkov wrote:
>On Thu, Jan 31, 2019 at 04:39:46PM +0800, Chao Fan wrote:
>> __puthex() is the only method to print value in compressed boot stage.
>> But in i386-PAE, sizeof(unsigned long) is 4, so that the value of
>> 64
On Mon, Jan 28, 2019 at 06:51:32PM +0100, Borislav Petkov wrote:
>On Wed, Jan 23, 2019 at 07:08:43PM +0800, Chao Fan wrote:
>> PATCH 1/7 Copy kstrtoull() to boot/string.c to instead of using
>> old simple_strtoull()
>> PATCH 2/7 Introduce get_acpi_rsdp() to parse
On Wed, Jan 23, 2019 at 07:08:48PM +0800, Chao Fan wrote:
[...]
> #endif /* CONFIG_ACPI */
>diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
>index 8dd1d5ccae58..86fa8bf56d68 100644
>--- a/arch/x86/boot/compressed/misc.c
>+++ b/arch/x86/boot/co
RSDP is needed by both KASLR, so parse it early and fill it in
boot_params before KASLR code.
RSDP is needed by lots of other code, it would be easier to have it
always built-in instead of a long "depends on" line in Kconfig.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/Mak
scan memory for the RSDP and verify RSDP
by signature and checksum.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 83 +
1 file changed, 83 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index 75b3ce4356f4
ore conditions, so remove the 'RFC' tag.
- Change some comments.
v1->v2:
- Simplify some code.
Follow Baoquan He's suggestion:
- Reuse the head file of acpi code.
Any comments will be welcome.
Chao Fan (7):
x86/boot: Copy kstrtoull() to boot/string.c instead of
simple_strtoull()
x86/boo
CONFIG_EARLY_SRAT_PARSE is enabled, walk through SRAT to get the
information of immovable memory so that KASLR knows where should be
chosen for randomization.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 72 +++-
arch/x86/boot/compressed/misc.h | 1 +
2
.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 82 +
1 file changed, 82 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index bacfc4ea35ac..75b3ce4356f4 100644
--- a/arch/x86/boot/compressed/acpi.c
. The solution is to
separate the dividend to upper and lower in boot/string.o. So copy the
useful div_u64() and div_u64_rem() to boot/string.c also. To avoid
redefinition in i386, rename them as __div_u64() and __div_u64_rem().
Signed-off-by: Chao Fan
---
arch/x86/boot/string.c | 141
SRAT should be parsed by RSDP to fix the conflict between KASLR and
memory-hotremove, then filter the immovable memory regions and
accoring to the memory information, KASLR can avoid to extract kernel
to movable memory regions.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 122
, 'acpi_rsdp=' may have been
added to cmdline, so parse cmdline to find RSDP.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 32
arch/x86/boot/compressed/misc.h | 3 +++
2 files changed, 35 insertions(+)
create mode 100644 arch/x86/boot/compressed
On Mon, Jan 21, 2019 at 09:29:32AM +0100, Borislav Petkov wrote:
>On Mon, Jan 21, 2019 at 09:18:30AM +0800, Chao Fan wrote:
>> So I have changed as this method and put in my mail thread, you may not
>> notice, so I put here for my function if I need to fill the
>> boot_para
On Mon, Jan 21, 2019 at 10:45:24AM +0100, Borislav Petkov wrote:
>On Mon, Jan 21, 2019 at 05:42:14PM +0800, Chao Fan wrote:
>> Or I clear this function as:
>> static acpi_physical_address get_rsdp_addr(void)
>> {
>> acpi_physical_address pa;
>&g
On Mon, Jan 21, 2019 at 05:33:48PM +0800, Chao Fan wrote:
>On Wed, Jan 16, 2019 at 12:01:58PM +0100, Borislav Petkov wrote:
>>On Mon, Jan 07, 2019 at 11:22:42AM +0800, Chao Fan wrote:
>[...]
>>> +
>>> +/* Determine RSDP, based on acpi_os_get_root_pointer(). */
>
On Wed, Jan 16, 2019 at 12:01:58PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:42AM +0800, Chao Fan wrote:
[...]
>> +
>> +/* Determine RSDP, based on acpi_os_get_root_pointer(). */
>> +static acpi_physical_address get_rsdp_addr(void)
>> +{
>&
On Mon, Jan 21, 2019 at 09:29:32AM +0100, Borislav Petkov wrote:
>On Mon, Jan 21, 2019 at 09:18:30AM +0800, Chao Fan wrote:
>> So I have changed as this method and put in my mail thread, you may not
>> notice, so I put here for my function if I need to fill the
>> boot_para
RAT_PARSE
bool "EARLY SRAT parsing"
def_bool y
depends on RANDOMIZE_BASE && MEMORY_HOTREMOVE && ACPI
If I miss something, please let me know.
Or in my PATCHSET, I don't need to fill boot_parameters, just
leave the job another PATCH?
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
>Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
On Thu, Jan 17, 2019 at 04:27:51PM +0100, Borislav Petkov wrote:
>On Thu, Jan 17, 2019 at 11:20:27AM +0800, Chao Fan wrote:
>> I have changed as you suggested, looks clear without type cast, and
>> we need some variable as long to calculate the address, and at same
>> time
On Wed, Jan 16, 2019 at 03:28:52PM +0800, Kairui Song wrote:
>On Mon, Jan 7, 2019 at 11:24 AM Chao Fan wrote:
>>
>> +
>> +/* Determine RSDP, based on acpi_os_get_root_pointer(). */
>> +static acpi_physical_address get_rsdp_addr(void)
>> +{
>> + acpi_
the RSDP to
boot_params.acpi_rsdp_addr.
By the way, I search kernel code, I didn't find other code fill and
use it, only you(KEXEC) are trying to fill it.
If I miss something, please let me know.
Thanks,
Chao Fan
>
>But if early code should parse it and store it should be done in
>Chao'
On Wed, Jan 16, 2019 at 12:01:58PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:42AM +0800, Chao Fan wrote:
>> +void get_immovable_mem(void)
>> +{
>> +struct acpi_table_header *table_header;
>> +struct acpi_subtable_header *table;
>> +
On Wed, Jan 16, 2019 at 03:28:52PM +0800, Kairui Song wrote:
>On Mon, Jan 7, 2019 at 11:24 AM Chao Fan wrote:
>>
>> +
>> +/* Determine RSDP, based on acpi_os_get_root_pointer(). */
>> +static acpi_physical_address get_rsdp_addr(void)
>> +{
>> + acpi_
On Wed, Jan 16, 2019 at 12:15:07PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:43AM +0800, Chao Fan wrote:
>> KASLR may randomly choose some positions which are located in movable
>> memory regions. It will break memory hotplug feature and make the
>>
On Wed, Jan 16, 2019 at 12:01:58PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:42AM +0800, Chao Fan wrote:
[...]
>> +rsdp = (struct acpi_table_rsdp *)(long)get_rsdp_addr();
>> +if (!rsdp)
>> +return NULL;
>> +
>> +
On Tue, Jan 15, 2019 at 10:55:02AM +0100, Borislav Petkov wrote:
>On Tue, Jan 15, 2019 at 03:21:21PM +0800, Chao Fan wrote:
>> In my understanding after looking into the commit message the comments.
>> I thinks yes. For 32-bit OS:
>
>And when does your "32-bit OS" de
On Mon, Jan 14, 2019 at 10:07:56AM +0100, Borislav Petkov wrote:
>On Mon, Jan 14, 2019 at 09:26:42AM +0800, Chao Fan wrote:
>> According to the code, I saw:
>> #ifdef ACPI_ASL_COMPILER
>> #define ACPI_32BIT_PHYSICAL_ADDRESS
>> #endif
>>
>> and then
>>
On Sun, Jan 13, 2019 at 12:05:45PM +0100, Borislav Petkov wrote:
>On Sun, Jan 13, 2019 at 05:47:04PM +0800, Chao Fan wrote:
>> 'acpi_physical_address' could be define as u64 or u32.
>
>And when can acpi_physical_address be a u32?
>
According to the code, I saw:
#ifdef ACPI_AS
On Fri, Jan 11, 2019 at 11:32:25AM +0100, Borislav Petkov wrote:
>On Fri, Jan 11, 2019 at 09:23:53AM +0800, Chao Fan wrote:
>> Yes, 'table64' looks superfluous here, but after these lines, there is:
>> if (!IS_ENABLED(CONFIG_X86_64) && table64 >
need the kernel parameter
'movable_node'? Since you have got the memory information about hot-remove,
so I wonder if it's OK to drop 'movable_node', and if memory-hotremove is
enabled, change memblock allocation according to SRAT.
If there is something wrong in my understanding,
t;Cc: Peter Zijlstra
>Cc: "Rafael J. Wysocki"
>Cc: Len Brown
>Cc: Yinghai Lu
>Cc: Tejun Heo
>Cc: Chao Fan
>Cc: Baoquan He
>Cc: Juergen Gross
>Cc: Andrew Morton
>Cc: Mike Rapoport
>Cc: Vlastimil Babka
>Cc: Michal Hocko
>Cc: x...@kernel.org
>C
On Thu, Jan 10, 2019 at 10:27:47PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:41AM +0800, Chao Fan wrote:
>> Memory information in SRAT table is necessary to fix the conflict
>> between KASLR and memory-hotremove. So RSDP and SRAT should be parsed.
>>
>&
On Thu, Jan 10, 2019 at 10:15:23PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:40AM +0800, Chao Fan wrote:
>> Memory information in SRAT is necessary to fix the conflict between
>> KASLR and memory-hotremove. So RSDP and SRAT should be parsed.
>>
>>
On Thu, Jan 10, 2019 at 06:01:03PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:39AM +0800, Chao Fan wrote:
>> KASLR may randomly choose some positions which are located in movable
>> memory regions. This will make the movable memory chosen by KASLR
>
On Wed, Jan 09, 2019 at 01:48:53PM +0100, Borislav Petkov wrote:
>On Mon, Jan 07, 2019 at 11:22:38AM +0800, Chao Fan wrote:
>> Copy kstrtoull() and necessary functions from lib/kstrtox.c to
>> boot/string.c so that code in boot/ can use kstrtoull() and the old
>> simple_strto
d1955258091e4c92d5a975ebd7fd8a98f5d30f
Author: Tang Chen
Date: Fri Feb 22 16:33:44 2013 -0800
acpi, memory-hotplug: parse SRAT before memblock is ready
Then, Lu Yinghai tried to do the similar job, you can see:
https://lwn.net/Articles/554854/
for more information. Hope that can help you.
.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 83 +
1 file changed, 83 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index 7ca5001d7639..f74c5d033d79 100644
--- a/arch/x86/boot/compressed/acpi.c
scan memory for the RSDP and verify RSDP
by signature and checksum.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 86 +
1 file changed, 86 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index f74c5d033d79
. The solution is to
separate the dividend to upper and lower in boot/string.o. So copy the
useful div_u64() and div_u64_rem() to boot/string.c also. To avoid
redefinition in i386, rename them as __div_u64() and __div_u64_rem().
Signed-off-by: Chao Fan
---
arch/x86/boot/string.c | 137
tub.
v2->v3:
- Test in more conditions, so remove the 'RFC' tag.
- Change some comments.
v1->v2:
- Simplify some code.
Follow Baoquan He's suggestion:
- Reuse the head file of acpi code.
Any comments will be welcome.
Chao Fan (6):
x86/boot: Copy kstrtoull() to boot/string.c ins
CONFIG_EARLY_SRAT_PARSE is enabled, walk through SRAT to get the
information of immovable memory so that KASLR knows where should be
chosen for randomization.
Rename process_mem_region() as __process_mem_region() and name new
function as process_mem_region().
Signed-off-by: Chao Fan
---
arch/x86/boot
, 'acpi_rsdp=' may have been
added to cmdline, so parse cmdline to find RSDP.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 30 ++
1 file changed, 30 insertions(+)
create mode 100644 arch/x86/boot/compressed/acpi.c
diff --git a/arch/x86/boot
OTREMOVE' is needed, introduce
'CONFIG_EARLY_SRAT_PARSE' to make ifdeffery clear.
Signed-off-by: Chao Fan
---
arch/x86/Kconfig | 12 +++
arch/x86/boot/compressed/Makefile | 2 +
arch/x86/boot/compressed/acpi.c | 138 ++
arch/x86/boot/compressed
.
Signed-off-by: Chao Fan
---
drivers/acpi/numa.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 274699463b4f..7bbbf8256a41 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -146,9 +146,9
et up a debian9-32bit with PAE in QEMU and found size of
acpi_physical_address is 8. So they are not always sync.
Of course, that doesn't influence the conclusion, since return table directly
can always work. It will return u32 to u32, u64 to u64, or u32 to u64.
So the typecast about acpi_physical
On Tue, Dec 18, 2018 at 12:28:48PM +0100, Borislav Petkov wrote:
>On Tue, Dec 18, 2018 at 09:27:04AM +0800, Chao Fan wrote:
>> The basic conflict is the kernel avoiding KASLR-randomizing into
>> hot-removable memory areas.
>
>And this should be in a prominent place in your c
On Mon, Dec 17, 2018 at 04:45:51PM +0100, Borislav Petkov wrote:
>On Mon, Dec 17, 2018 at 09:27:28AM +0800, Chao Fan wrote:
>> Oops, I thought you agree with what Baoquan said, so I send the new version
>> and use simple_strtoull() back.
>
>I could've misunderstood him. Lem
On Mon, Dec 17, 2018 at 06:41:49PM +0100, Ingo Molnar wrote:
>
>* Chao Fan wrote:
>
>> SRAT should be parsed by RSDP to fix the conflict between KASLR
>> and memory-hotremove, then find the immovable memory regions and store
>> them in an array called immovable_mem[].
On Mon, Dec 17, 2018 at 06:43:24PM +0100, Ingo Molnar wrote:
>
>* Chao Fan wrote:
>
>> KASLR randomly chooses some positions which may locate in movable
>> memory regions. It will break memory hotplug feature and make the
>> movable memory chosen by
On Mon, Dec 17, 2018 at 06:38:37PM +0100, Ingo Molnar wrote:
>
>* Chao Fan wrote:
>
>> +/* Check the standard checksum */
>> +if (compute_checksum((u8 *) rsdp, ACPI_RSDP_CHECKSUM_LENGTH))
>> +continue;
>
>Could yo
On Mon, Dec 17, 2018 at 06:30:32PM +0100, Ingo Molnar wrote:
>
>* Chao Fan wrote:
>
>> Memory information in SRAT is necessary to fix the conflict between
>> KASLR and memory-hotremove. So RSDP and SRAT should be parsed.
>>
>> When booting form KEXEC/EFI/
On Mon, Dec 17, 2018 at 06:25:10PM +0100, Ingo Molnar wrote:
>
>* Chao Fan wrote:
>
>> Memory information in SRAT is necessary to fix the conflict between
>> KASLR and memory-hotremove.
>>
>> ACPI SRAT (System/Static Resource Affinity Table) shows the details
t you agree with what Baoquan said, so I send the new version
and use simple_strtoull() back.
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
>Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
C' tag.
- Change some comments.
v1->v2:
- Simplify some code.
Follow Baoquan He's suggestion:
- Reuse the head file of acpi code.
Any comments will be welcome.
Chao Fan (5):
x86/boot: Introduce get_acpi_rsdp() to parse RSDP in cmdline from
KEXEC
x86/boot: Introduce efi_get_rsdp_ad
CONFIG_EARLY_PARSE_RSDP is enabled, walk through SRAT to get the
information of immovable memory so that KASLR knows where should be
chosen for randomization.
Rename process_mem_region() as __process_mem_region() and name new
function as process_mem_region().
Signed-off-by: Chao Fan
---
arch/x86/boot
, there is no variable who can
point to RSDP directly, so scan memory for the RSDP and verify RSDP
by signature and checksum.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 86 +
1 file changed, 86 insertions(+)
diff --git a/arch/x86/boot/compressed
OTREMOVE' is needed, introduce
'CONFIG_EARLY_PARSE_RSDP' to make ifdeffery clear.
Signed-off-by: Chao Fan
---
arch/x86/Kconfig | 12 +++
arch/x86/boot/compressed/Makefile | 2 +
arch/x86/boot/compressed/acpi.c | 128 ++
arch/x86/boot/compressed
.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 79 +
1 file changed, 79 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index 44f19546c169..4151881d8713 100644
--- a/arch/x86/boot/compressed/acpi.c
Pointer(RSDP), so RSDP should be found firstly.
When booting form KEXEC/EFI/BIOS, the methods to find RSDP
are different. When booting from KEXEC, 'acpi_rsdp' may have been
added to cmdline, so parse cmdline to find RSDP.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpi.c | 30
(), we should copy div_u64().
When trying to include lib/kstrtox.c, even if other error in make period
are solved, we will also meet this error. We should also copy div_u64
also. And then cover the math64.h in boot/string.c, and hanlde the other
error and warining who comes together.
So just like Baoquan said,
n use simple_strtoull() for now.
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
>Boris.
>
>Good mailing practices for 400: avoid top-posting and trim the reply.
>
>
On Thu, Dec 13, 2018 at 02:25:30PM -0500, Masayoshi Mizuma wrote:
>Hi Chao,
>
>Great work! Let me say some trivial comments.
Thanks for your help, any comments will be welcome.
>
>On Wed, Dec 12, 2018 at 11:10:49AM +0800, Chao Fan wrote:
>> Memory information in SRA
On Thu, Dec 13, 2018 at 08:42:30PM +0100, Borislav Petkov wrote:
>On Wed, Dec 12, 2018 at 11:10:49AM +0800, Chao Fan wrote:
>> Memory information in SRAT is necessary to fix the conflict between
>> KASLR and memory-hotremove.
>>
>> ACPI SRAT (System/Static Res
On Thu, Dec 13, 2018 at 09:23:04PM +0100, Borislav Petkov wrote:
>On Wed, Dec 12, 2018 at 11:10:50AM +0800, Chao Fan wrote:
>> Memory information in SRAT is necessary to fix the conflict between
>> KASLR and memory-hotremove. So RSDP and SRAT should be parsed.
>>
>>
On Wed, Dec 12, 2018 at 03:46:15PM +0800, Baoquan He wrote:
>On 12/12/18 at 11:10am, Chao Fan wrote:
>> Introduce kstrtoull() from lib/kstrtox.c to boot directory so that code
>
>It's not introducing kstrtoull(), just copying kstrtoull() from
>lib/kstrtox.c to boot.
Oops, may
On Wed, Dec 12, 2018 at 11:10:48AM +0800, Chao Fan wrote:
>Introduce kstrtoull() from lib/kstrtox.c to boot directory so that code
>in boot/ can use kstrtoull() and the old simple_strtoull() can be
>replaced.
>
Hi all,
Thanks for Boris, Baoquan and Masa's help, this PATCHSET h
1 - 100 of 527 matches
Mail list logo