KASLR should choose the memory region of immovable node to extract kernel.
So get ACPI SRAT table and store the memory region of movable node which
kaslr shold avoid.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 231 +++
arch/x86/boot
a better method to handle the movable memory,
please tell me.
Thanks,
Chao Fan
On Fri, Aug 18, 2017 at 04:58:20PM +0800, Chao Fan wrote:
>KASLR should choose the memory region of immovable node to extract kernel.
>So get ACPI SRAT table and store the memory region of movable node which
andom_phys_addr(min_addr, output_size);
Cause you will walk efi map firstly, and then e820 map(or not).
Thanks,
Chao Fan
>---
> arch/x86/boot/compressed/kaslr.c | 60 ++--
> 1 file changed, 33 insertions(+), 27 deletions(-)
>
>diff --git a/arch/x
kernel is in mirror region.
If there are any problems, please let me know.
Thanks,
Chao Fan
On Thu, Jun 15, 2017 at 03:52:47PM +0800, Baoquan He wrote:
>Our customer reported that Kernel text may be located on non-mirror
>region (movable zone) when both address range mirroring feature and
On Thu, Jun 22, 2017 at 11:20:32AM +0800, Baoquan He wrote:
>On 06/22/17 at 11:10am, Chao Fan wrote:
>> Hi all,
>>
>> After testing this issue for 100 times in total, I think this patchset
>> works well.
>
>Thanks for your effort, Chao!
No problem, and many thank
e the regions in immovable_mem, where should be
chosen by kaslr.
Multiple regions can be specified, comma delimited.
Considering the usage of memory, only support for 4 regions.
4 regions contains 2 nodes at least, enough for kernel to extract.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/ka
, and one entry of e820 or efi may contain the memory in
different nodes sometimes.
It may split one node or one entry to several regions.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 60 ++--
1 file changed, 52 insertions(+), 8 deletions(-)
diff
There are two same variable "rc" in this function. One is in the
circulation, the other is out of the circulation. The one out will never
be used, so drop it.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
di
Add the document for the change of extended movable_node=nn[KMG]@ss[KMG].
Cc: Jonathan Corbet
Cc: linux-...@vger.kernel.org
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 9 +
1 file changed, 9 insertions(+)
diff --git a/Documentation/admin-guide/kernel
memmap.
PATCH 3/4 add document.
PATCH 4/4 cleans up some little problems.
v1->v2:
Follow Dou's suggestion:
- Add the parse for movable_node=nn[KMG] without @ss[KMG]
- Fix the bug for more than one "movable_node=" specified
- Drop useless variables and use mem_vector region direct
On Mon, Nov 13, 2017 at 04:10:41PM +0800, Baoquan He wrote:
>Hi Chao,
Hi Baoquan,
Thanks for your reply.
>
>Please think more on your patches, better to discuss with your
>colleagues and ask them to help review before your post.
>
>On 11/01/17 at 07:32pm, Chao Fan wr
On Mon, Nov 13, 2017 at 04:31:31PM +0800, Baoquan He wrote:
>On 11/01/17 at 07:32pm, Chao Fan wrote:
>> Compare the region of memmap entry and immovable_mem, then choose the
>> intersection to process_mem_region.
>>
>> Since the interrelationship between e820 or efi e
On Mon, Nov 13, 2017 at 04:32:33PM +0800, Baoquan He wrote:
>On 11/01/17 at 07:32pm, Chao Fan wrote:
>> There are two same variable "rc" in this function. One is in the
>> circulation, the other is out of the circulation. The one out will never
>> be used, so drop it
On Mon, Nov 13, 2017 at 05:26:24PM +0800, Baoquan He wrote:
>On 11/13/17 at 05:18pm, Chao Fan wrote:
>> On Mon, Nov 13, 2017 at 04:31:31PM +0800, Baoquan He wrote:
>> >On 11/01/17 at 07:32pm, Chao Fan wrote:
>> >> Compare the region of memmap entry and
Add the document for the change of extended movable_node=nn[KMG]@ss[KMG].
Cc: Jonathan Corbet
Cc: linux-...@vger.kernel.org
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 9 +
1 file changed, 9 insertions(+)
diff --git a/Documentation/admin-guide/kernel
tor, the usage
of memory here is not too big.
PATCH 1/4 parse the extended movable_node=nn[KMG]@ss[KMG], then
store the memory regions.
PATCH 2/4 selects the memory region in immovable node when process
memmap.
PATCH 3/4 is the change of document.
PATCH 4/4 cleans up
There are two same variable "rc" in this function. One is in the
circulation, the other is out of the circulation. The one out will never
be used, so drop it.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
di
as a region to
process_mem_region. It may split one node or one entry to several regions.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 72
1 file changed, 58 insertions(+), 14 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b
usage of memory, only support for 4 regions.
4 regions contains 2 nodes at least, and is enough for kernel to
extract.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 63 +++-
1 file changed, 62 insertions(+), 1 deletion(-)
diff --git a/arch/x86
On Fri, Aug 03, 2018 at 10:00:48AM +0800, Dou Liyang wrote:
>
>
>At 07/23/2018 05:29 PM, Chao Fan wrote:
>> Imitate the ACPI code to parse ACPI tables. Functions are simplified
>> cause some operations are not needed here.
>> And also, this method won't infl
Since function "handle_mem_options" is used only once:
arch/x86/boot/compressed/kaslr.c:421
handle_mem_options();
The return value is useless, so change it to void.
And also clean a useless variable.
Suggested-by: Dou Liyang
Signed-off-by: Chao Fan
---
arch/x86/boot/compress
If 'CONFIG_MEMORY_HOTREMOVE' specified, walk the acpi srat memory
tables, store the immovable memory regions, so that kaslr can get
the information abouth where can be selected or not.
If 'CONFIG_MEMORY_HOTREMOVE' not specified, go on the old code.
Signed-off-by: Chao Fan
Imitate the ACPI code to parse ACPI tables. Functions are simplified
cause some operations are not needed here.
And also, this method won't influence the initialization of ACPI.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/Makefile | 4 +
arch/x86/boot/compressed/acpitb.c
In order to parse ACPI tables, reuse the head file linux/acpi.h,
so that the files in 'compressed' directory can read ACPI table
by including this head file.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpitb.h | 7 +++
1 file changed, 7 insertions(+)
create mode 10064
to #define CONFIG_EFI and return
false in the other stub.
- Simplify two functions in head file.
v4->v5:
Follow Dou Liyang's suggestion:
- Add more comments about some functions based on kernel code.
- Change some typo in comments.
- Clean useless variable.
- Add check for the bounda
tch_random,
and name new function as process_mem_region.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 66 ++--
1 file changed, 55 insertions(+), 11 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 72
On Mon, Aug 27, 2018 at 10:13:49AM +0800, Baoquan He wrote:
>On 08/07/18 at 02:49pm, Chao Fan wrote:
>> If 'CONFIG_MEMORY_HOTREMOVE' specified, walk the acpi srat memory
>> tables, store the immovable memory regions, so that kaslr can get
>> the information abou
On Mon, Aug 27, 2018 at 01:56:07PM +0800, Baoquan He wrote:
>On 08/07/18 at 02:50pm, Chao Fan wrote:
>> If 'CONFIG_MEMORY_HOTREMOVE' specified and the account of immovable
>If CONFIG_MEMORY_HOTREMOVE is enabled,
>> memory regions is not zero. Calculate the intersecti
On Mon, Aug 27, 2018 at 02:28:54PM +0800, Chao Fan wrote:
>On Mon, Aug 27, 2018 at 01:56:07PM +0800, Baoquan He wrote:
>>On 08/07/18 at 02:50pm, Chao Fan wrote:
[...]
>>
>>Is it possible to take num_immovable_mem definition out from #ifdef
>>CONFIG_MEMORY_HOTREMOVE b
Hi all,
No reply for 2 weeks, any comments?
Thanks,
Chao Fan
On Tue, Aug 07, 2018 at 02:49:56PM +0800, Chao Fan wrote:
>***Background:
>People reported that kaslr may randomly chooses some positions
>which are located in movable memory regions. This will break memory
>hotplug feat
it to a suitable place.
May the position where we try to get the acpi table is better.
Or just here is also OK.
Thanks,
Chao Fan
>
On Thu, Jul 19, 2018 at 05:22:35PM +0200, Thomas Gleixner wrote:
>On Tue, 17 Jul 2018, Chao Fan wrote:
>> +
>> +/* Search efi table for rsdp table. */
>> +static bool efi_get_rsdp_addr(acpi_physical_address *rsdp_addr)
>> +{
>> +efi_system_table_t *systa
On Thu, Jul 19, 2018 at 05:19:43PM +0200, Thomas Gleixner wrote:
>On Tue, 17 Jul 2018, Chao Fan wrote:
>
>> In order to parse ACPI tables, reuse the head file linux/acpi.h,
>> so that the files in 'compressed' directory can read ACPI table
>> by including this hea
In order to parse ACPI tables, reuse the head file linux/acpi.h,
so that the files in 'compressed' directory can read ACPI table
by including this head file.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpitb.h | 7 +++
1 file changed, 7 insertions(+)
create mode 10064
to #define CONFIG_EFI and return
false in the other stub.
- Simplify two functions in head file.
Any comments will be welcome.
Chao Fan (4):
x86/boot: Add acpitb.h to help parse acpi tables
x86/boot: Add acpitb.c to parse acpi tables
x86/boot/KASLR: Walk srat tables to filter immovab
If 'CONFIG_MEMORY_HOTREMOVE' specified, walk the acpi srat memory
tables, store the immovable memory regions, so that kaslr can get
the information abouth where can be selected or not.
If 'CONFIG_MEMORY_HOTREMOVE' not specified, go on the old code.
Signed-off-by: Chao Fan
tch_random,
and name new function as process_mem_region.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 66 ++--
1 file changed, 55 insertions(+), 11 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 47
Imitate the ACPI code to parse ACPI tables. Functions are simplified
cause some operations are not needed here.
And also, this method won't influence the initialization of ACPI.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/Makefile | 4 +
arch/x86/boot/compressed/acpitb.c
Hi,
Sorry for disturbance, no reply for a week, any comments?
Thanks,
Chao Fan
On Mon, Jul 23, 2018 at 05:29:04PM +0800, Chao Fan wrote:
>***Background:
>People reported that kaslr may randomly chooses some positions
>which are located in movable memory regions. This will break memory
On Thu, Aug 02, 2018 at 11:47:13AM +0800, Dou Liyang wrote:
>Hi Fan,
>
>At 07/23/2018 05:29 PM, Chao Fan wrote:
>> If 'CONFIG_MEMORY_HOTREMOVE' specified, walk the acpi srat memory
>> tables, store the immovable memory regions, so that kaslr can get
>> the inf
On Thu, Aug 02, 2018 at 01:46:29PM +0800, Dou Liyang wrote:
>Hi Fan,
>
>At 07/23/2018 05:29 PM, Chao Fan wrote:
>> If 'CONFIG_MEMORY_HOTREMOVE' specified and the account of immovable
>> memory regions is not zero. Calculate the intersection between memory
>> r
On Tue, Jul 24, 2018 at 02:02:57PM +0800, Baoquan He wrote:
>Hi chao,
>
>On 07/23/18 at 05:29pm, Chao Fan wrote:
>> In order to parse ACPI tables, reuse the head file linux/acpi.h,
>> so that the files in 'compressed' directory can read ACPI table
>> by includ
On Tue, Jul 24, 2018 at 02:02:57PM +0800, Baoquan He wrote:
>Hi chao,
>
>On 07/23/18 at 05:29pm, Chao Fan wrote:
>> In order to parse ACPI tables, reuse the head file linux/acpi.h,
>> so that the files in 'compressed' directory can read ACPI table
>> by includ
unsigned long kernel_pages;
I think the logic of these two method are the same, and this method
change less code. If I am wrong, please let me know.
Thanks,
Chao Fan
>
>+ /*
>+ * KASLR may put kernel near
e you had a chance to fix
>this in the KASLR side.
>
I think it's better to fix here, but not KASLR side.
Cause much more code will be change if doing it in KASLR side.
Since we didn't parse 'kernelcore' in compressed code, and you can see
the distribution of ZONE_MOVABLE need
On Fri, Jul 13, 2018 at 07:52:40AM +0800, Baoquan He wrote:
>Hi Michal,
>
>On 07/12/18 at 02:32pm, Michal Hocko wrote:
>> On Thu 12-07-18 14:01:15, Chao Fan wrote:
>> > On Thu, Jul 12, 2018 at 01:49:49PM +0800, Dou Liyang wrote:
>> > >Hi Baoquan,
>> &g
s case, what range do we need to avoid? Only [1G, 2G]?
>
>Any ranges like that that need to be avoided should be known at build
>time, so they should simply be added to the mem_avoid list that is
>already present in the KASLR code...
>
Hi Kees,
So this issue can be figured out in a independent patch.
And does this patch have any problems? If so, please tell me, I will try
my best to improve it.
Thanks,
Chao Fan
>-Kees
>
>--
>Kees Cook
>Pixel Security
>
>
;>
>> Any ranges like that that need to be avoided should be known at build
>> time, so they should simply be added to the mem_avoid list that is
>> already present in the KASLR code...
>
>Seems KASLR doesn't have an solution which allow user to specify avoided
>ran
On Sat, Jan 13, 2018 at 12:02:26PM +0800, Baoquan He wrote:
>On 01/12/18 at 01:52pm, Luiz Capitulino wrote:
>> On Fri, 12 Jan 2018 10:47:53 +0800
>> Chao Fan wrote:
>>
>> > On Fri, Jan 12, 2018 at 10:31:52AM +0800, Baoquan He wrote:
>> > >On 01/11/18 at
Since only 'movable_node' specified without 'kaslr_mem=' may break
memory hotplug, so reconmmend users using 'kaslr_mem=' when
'movable_node' specified.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 10 ++
1 file changed, 10 i
In kernel code, if movable_node specified, it will skip the mirror
feature. So we should also skip mirror feature in KASLR.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt
b/Documentation/admin-guide/kernel-parameters.txt
index e2de7c006a74..28a879f62560 100644
--- a
Cc: linux-...@vger.kernel.org
Cc: Jonathan Corbet
Cc: Randy Dunlap
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt
b/Documentation/admin-guide/kernel
On Fri, Jan 19, 2018 at 11:53:31AM +0800, Baoquan He wrote:
>On 01/19/18 at 11:36am, Chao Fan wrote:
>> Signed-off-by: Chao Fan
>> ---
>> Documentation/admin-guide/kernel-parameters.txt | 10 ++
>> 1 file changed, 10 insertions(+)
>>
>> diff -
on.
Tested-by: Luiz Capitulino
Acked-by: Baoquan He
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 64 +---
1 file changed, 53 insertions(+), 11 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.
27;s suggestion:
- Change names of several functions.
- Add a new parameter "immovable_mem" instead of extending mvoable_node
- Use the clamp to calculate the memory intersecting, which makes
logical more clear.
- Disable memory mirror if movable_node specified
v1->v2:
Follow Dou Liyan
Cc: linux-...@vger.kernel.org
Cc: Jonathan Corbet
Cc: Randy Dunlap
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt
b/Documentation/admin-guide/kernel
In kernel code, if 'movable_node' specified, it will skip the mirror
feature. So also skip mirror feature in KASLR.
Acked-by: Baoquan He
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/boot/compressed
regions, this will make memory hotplug fail.
With the help of 'kaslr_mem=', limit kernel in those immovable regions
specified.
Tested-by: Luiz Capitulino
Acked-by: Baoquan He
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 73 ++
Since only 'movable_node' specified without 'kaslr_mem=' may break
memory hotplug, so reconmmend users using 'kaslr_mem=' when
'movable_node' specified.
Acked-by: Baoquan He
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 10 ++
On Thu, Jan 04, 2018 at 06:30:57PM +0800, Baoquan He wrote:
>On 01/04/18 at 04:02pm, Chao Fan wrote:
>> In current code, kaslr may choose the memory region in movable
>> nodes to extract kernel, which will make the nodes can't be hot-removed.
>> To solve it, we can sp
Hi Kees,
Since no reply for one week, any suggestions for this version?
Thanks,
Chao Fan
On Tue, Jan 23, 2018 at 04:35:41PM +0800, Chao Fan wrote:
>This is v8 resend. There's no code change. Just improve code comments
>and document accordingly. So add Baoquan's Acked-by and L
On Tue, Jan 16, 2018 at 11:34:23AM -0500, Luiz Capitulino wrote:
>On Tue, 16 Jan 2018 08:43:20 +0800
>Baoquan He wrote:
>
>> On 01/15/18 at 08:49pm, Chao Fan wrote:
>> > Hi Luiz,
>> >
>> > I don't know if this patch is OK for you.
>> > O
regions, this will make memory hotplug fail.
With the help of 'kaslr_mem=', limit kernel in those immovable regions
specified.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 73 ++--
1 file changed, 70 insertions(+), 3 deletions(-)
di
Signed-off-by: Chao Fan
---
Documentation/admin-guide/kernel-parameters.txt | 10 ++
1 file changed, 10 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt
b/Documentation/admin-guide/kernel-parameters.txt
index e2de7c006a74..f6d5adde1a73 100644
--- a
gion.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 64 +---
1 file changed, 53 insertions(+), 11 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index b21741135673..b200a7ceafc1 100644
--- a/arch
ting, which makes
logical more clear.
- Disable memory mirror if movable_node specified
v1->v2:
Follow Dou Liyang's suggestion:
- Add the parse for movable_node=nn[KMG] without @ss[KMG]
- Fix the bug for more than one "movable_node=" specified
- Drop useless variables
In kernel code, if movable_node specified, it will skip the mirror
feature. So we should also skip mirror feature in KASLR.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot
Since only 'movable_node' specified without 'kaslr_mem=' may break
memory hotplug, so reconmmend users using 'kaslr_mem=' when
'movable_node' specified..
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 10 ++
1 file changed, 10 i
On Wed, Jan 17, 2018 at 12:32:35PM -0500, Luiz Capitulino wrote:
>On Wed, 17 Jan 2018 18:53:46 +0800
>Chao Fan wrote:
>
>> ***Background:
>> People reported that kaslr may randomly chooses some positions
>> which are located in movable memory regions. This will brea
On Wed, Jan 17, 2018 at 10:03:54PM +0800, Baoquan He wrote:
>On 01/17/18 at 06:53pm, Chao Fan wrote:
>> In kernel code, if movable_node specified, it will skip the mirror
>> feature. So we should also skip mirror feature in KASLR.
>>
>> Signed-off-by: Chao Fan
>>
On Wed, Jan 17, 2018 at 10:02:48PM +0800, Baoquan He wrote:
>On 01/17/18 at 06:53pm, Chao Fan wrote:
>> Since only 'movable_node' specified without 'kaslr_mem=' may break
>> memory hotplug, so reconmmend users using 'kaslr_mem=' when
>> '
On Mon, Jan 08, 2018 at 09:39:54AM -0500, Luiz Capitulino wrote:
>On Fri, 5 Jan 2018 10:58:11 +0800
>Chao Fan wrote:
>
>> On Thu, Jan 04, 2018 at 06:30:57PM +0800, Baoquan He wrote:
>> >On 01/04/18 at 04:02pm, Chao Fan wrote:
>> >> In current code, kaslr may
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index b071f6edd7b2..38816d3f8865 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot
If there is no kaslr_mem= region specified, use region directely.
Otherwise, calculate the intersecting between efi or e820 memmap entry
and kaslr_mem.
Rename process_mem_region to slots_count to match
slots_fetch_random, and rename new function sa process_mem_region.
Signed-off-by: Chao Fan
e too slow and is not good
for the randomness.
So as Kess said, I put the regions suitable for 1G huge page to
mem_avoid, you can use kaslr_mem=1G!1G to solve the problem in your
email.
Thanks,
Chao Fan
On Mon, Jan 15, 2018 at 08:40:16PM +0800, Chao Fan wrote:
>In current code, kaslr choose
On Mon, Jan 15, 2018 at 08:40:12PM +0800, Chao Fan wrote:
>In current code, kaslr only has a method to avoid some memory regions,
>but no method to specify the regions for kaslr to extract. So kaslr
>may choose the wrong position sometimes, which will cause some other
>features fail.
period.
It can help users to avoid more memory regions, not only the 1G huge
huge page issue.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 56 +++-
1 file changed, 50 insertions(+), 6 deletions(-)
diff --git a/arch/x86/boot/compressed/kaslr.c b
t;handle_mem_filter", since
it will not only handle memmap parameter now.
Multiple regions can be specified, comma delimited.
Considering the usage of memory, only support for 4 regions.
4 regions contains 2 nodes at least, enough for kernel to extract.
Signed-off-by: Chao Fan
---
ar
In kernel code, if movable_node specified, it will skip the mirror
feature. So we should also skip mirror feature in kaslr.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/kaslr.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot
ption for the document.
v4->v5:
- Change the problem reported by LKP
Follow Dou's suggestion:
- Also return if match "movable_node" when parsing kernel commandline
in handle_mem_filter without define CONFIG_MEMORY_HOTPLUG
v5->v6:
- Add the last patch to save the avoid m
On Mon, Jan 15, 2018 at 02:40:35PM -0800, Randy Dunlap wrote:
>On 01/15/2018 04:40 AM, Chao Fan wrote:
>> In current code, kaslr only has a method to avoid some memory regions,
>> but no method to specify the regions for kaslr to extract. So kaslr
>> may choose the wrong posi
On Tue, Jan 16, 2018 at 08:43:20AM +0800, Baoquan He wrote:
>On 01/15/18 at 08:49pm, Chao Fan wrote:
>> Hi Luiz,
>>
>> I don't know if this patch is OK for you.
>> Of coure you can only use kaslr_mem=nn@ss to solve the 1G huge page
>> issue. Because we know
On Mon, Mar 12, 2018 at 11:57:27AM +0100, Ingo Molnar wrote:
>
>* Baoquan He wrote:
>
>> Hi Ingo,
>>
>> On 03/12/18 at 10:35am, Ingo Molnar wrote:
>> >
>> > * Chao Fan wrote:
>> >
>> > > Long time no reply, rebase
pointer (Root
System Description Pointer). So RSDP should be found firstly.
When booting form KEXEC/EFI/BIOS, the methods to find RSDP pointer
are different. When booting from KEXEC, 'acpi_rsdp' may have been
added to cmdline, so parse the cmdline and find the RSDP pointer.
Signed-of
CONFIG_EARLY_PARSE_RSDP is enabled, walk through the SRAT memory
tables and store those immovable memory regions so that KASLR can get
where to choose for randomization.
Also, rename process_mem_region() as __process_mem_region() and name new
function as process_mem_region().
Signed-off-by: Chao Fan
table and find the RSDP pointer.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpitb.c | 79 +++
1 file changed, 79 insertions(+)
diff --git a/arch/x86/boot/compressed/acpitb.c
b/arch/x86/boot/compressed/acpitb.c
index 614c45655cff..c43546648638 100644
--- a
to read
- Put strtoull() to misc.c
Follow Masa's suggestion:
- Remove the detection for 'movable_node'
- Change the code logical about cmdline_find_option()
Any comments will be welcome.
Chao Fan (5):
x86/boot: Add get_acpi_rsdp() to parse RSDP in cmdline from KEXEC
x86/boot:
regions.
Add 'CONFIG_EARLY_PARSE_RSDP' which depends on RANDOMIZE_BASE &&
MEMORY_HOTREMOVE, cause only when both KASLR and memory-hotremove
are enabled, RSDP needs to be parsed in compressed period.
Signed-off-by: Chao Fan
---
arch/x86/Kconfig | 10 +++
arch/x
directly, so scan memory for the RSDP and verify RSDP
by signature and checksum.
Signed-off-by: Chao Fan
---
arch/x86/boot/compressed/acpitb.c | 85 +++
1 file changed, 85 insertions(+)
diff --git a/arch/x86/boot/compressed/acpitb.c
b/arch/x86/boot/compressed/acpitb.c
oblems with the method to splite patch.
I will rework on it and build every commit.
Thanks,
Chao Fan
>Your patches depend on the following kconfig,
>so please build them under the config combination.
>
>RANDOMIZE_BASE
>MEMORY_HOTREMOVE
>EARLY_PARSE_RSDP
>KEXEC
>EFI
>
>T
On Thu, Nov 29, 2018 at 12:55:21PM -0500, Masayoshi Mizuma wrote:
>On Thu, Nov 29, 2018 at 04:16:30PM +0800, Chao Fan wrote:
>> To fix the conflict between KASLR and memory-hotremove, SRAT table
>> should be parsed by RSDP pointer, then find the immovable
>> memory regions
On Thu, Nov 29, 2018 at 11:20:13AM -0500, Masayoshi Mizuma wrote:
>On Thu, Nov 29, 2018 at 04:16:27PM +0800, Chao Fan wrote:
>> To fix the conflict between KASLR and memory-hotremove, memory
>> information in SRAT table is necessary.
>>
>> ACPI SRAT (System/Static R
x86/boot/compressed/misc.o]
>Error 1
>make: *** [Makefile:1715: arch/x86/boot/compressed/misc.o] Error 2
>]$
Hi Masa,
So many thanks for your test.
Could you give me more details about this error? More error message.
Just on the first commit or the whole PATCHSET?
Cause I didn't get er
On Fri, Nov 30, 2018 at 09:15:13AM +0800, Chao Fan wrote:
>On Thu, Nov 29, 2018 at 12:32:46PM -0500, Masayoshi Mizuma wrote:
>>Hi Chao,
>>
>>Thank you for your continued working.
>
>Thanks for your test.
>
>>
>>Could you please build your patches before
On Tue, Nov 13, 2018 at 06:51:50PM +0100, Borislav Petkov wrote:
>On Mon, Nov 12, 2018 at 05:46:43PM +0800, Chao Fan wrote:
>> Imitate setup_acpi_rsdp() for the early_param of 'acpi_rsdp'.
>> KEXEC writes the RSDP pointer to cmdline for EFI booting.
>> So if '
On Tue, Dec 04, 2018 at 07:42:20PM +0100, Borislav Petkov wrote:
>On Sat, Dec 01, 2018 at 02:05:39PM +0800, Chao Fan wrote:
>> >I built your whole patchset and got the error.
>> >The error depends on CONFIG_MODVERSIONS.
>> >If CONFIG_MODVERSIONS=y, you will get t
On Tue, Dec 04, 2018 at 07:34:00PM +0100, Borislav Petkov wrote:
>On Fri, Nov 30, 2018 at 10:29:14AM +0800, Chao Fan wrote:
>> Oh, thanks, will change it
>> char val[19];
>
>And make that 19 a define.
I will do that.
Thanks,
Chao Fan
>
>--
>Regards/Gruss,
>
On Wed, Dec 05, 2018 at 03:58:14PM +0100, Borislav Petkov wrote:
>On Thu, Nov 29, 2018 at 04:16:27PM +0800, Chao Fan wrote:
>> To fix the conflict between KASLR and memory-hotremove, memory
>> information in SRAT table is necessary.
>>
>> ACPI SRAT (System/Static Resour
wonder if there are some options I miss or some problems.
The patch is below.
Thanks,
Chao Fan
diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index c4428a176973..62ffe0437c8e 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -13,6 +13,9 @@
*/
#include
1 - 100 of 317 matches
Mail list logo