[PATCH v2] x86/efi: unconditionally hold the whole low-1MB memory regions

2021-05-31 Thread Lianbo Jiang
14b/0x23b [8.815793] __memblock_free_late: [0x0001-0x00013fff] efi_free_boot_services+0x14b/0x23b To fix the above issues, let's hold the whole low-1M memory regions unconditionally in the efi_free_boot_services(). Signed-off-by: Lianbo Jiang --- Background(copy from bhe'

[PATCH] x86/efi: Do not release sub-1MB memory regions when the crashkernel option is specified

2021-04-07 Thread Lianbo Jiang
specified. Signed-off-by: Lianbo Jiang --- arch/x86/platform/efi/quirks.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 67d93a243c35..637f932c4fd4 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/pla

[PATCH] docs: admin-guide: update kdump documentation due to change of crash URL

2020-09-18 Thread Lianbo Jiang
Since crash utility has moved to github, the original URL is no longer available. Let's update it accordingly. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- Documentation/admin-guide/kdump/kdump.rst | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH 3/3] kexec_file: correctly output debugging information for the PT_LOAD elf header

2020-08-03 Thread Lianbo Jiang
information. Signed-off-by: Lianbo Jiang --- kernel/kexec_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 41616b6a80ad..e2c03b4ce31b 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -1323,10 +1323,10 @@ int

[PATCH 1/3] x86/crash: Correct the address boundary of function parameters

2020-08-03 Thread Lianbo Jiang
Let's carefully handle the boundary of the function parameter to make sure that the arguments passed doesn't exceed the address range. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86

[PATCH 2/3] kexec: Improve the crash_exclude_mem_range() to handle the overlapping ranges

2020-08-03 Thread Lianbo Jiang
extend the crash_exclude_mem_range() to handle the overlapping ranges. Signed-off-by: Lianbo Jiang --- kernel/kexec_file.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 09cc78df53c6..41616b6a80ad 100644 --- a/

[PATCH 0/3] x86/kexec_file: Fix some corners bugs and improve the crash_exclude_mem_range()

2020-08-03 Thread Lianbo Jiang
[3] [PATCH 3/3] kexec_file: correctly output debugging information for the PT_LOAD elf header Lianbo Jiang (3): x86/crash: Correct the address boundary of function parameters kexec: Improve the crash_exclude_mem_range() to handle the overlapping ranges kexec_file: correctly output

[PATCH v2] kexec: Do not verify the signature without the lockdown or mandatory signature

2020-06-01 Thread Lianbo Jiang
verification is mandated. Otherwise, we lift the bar for any kernel image. Signed-off-by: Lianbo Jiang --- Changes since v1: [1] Modify the log level(suggested by Jiri Bohac) kernel/kexec_file.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git

[PATCH] kexec: Do not verify the signature without the lockdown or mandatory signature

2020-05-24 Thread Lianbo Jiang
verification is mandated. Otherwise, we lift the bar for any kernel image. Signed-off-by: Lianbo Jiang --- kernel/kexec_file.c | 37 ++--- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index faa74d5f6941

[PATCH v2] kexec: support parsing the string "Reserved" to get the correct e820 reserved region

2020-02-23 Thread Lianbo Jiang
ing the string. So, let's fix this corner and make sure that the string "reserved" and "Reserved" in the "/proc/iomem" are both parsed appropriately. Signed-off-by: Lianbo Jiang --- Note: Please follow up this commit below about kdump fix. 1ac3e4a57000 ("kdump: fi

[PATCH] kexec: support parsing the string "Reserved" to get the correct e820 reserved region

2020-02-12 Thread Lianbo Jiang
ing the string. So, let's fix this corner and make sure that the string "reserved" and "Reserved" in the "/proc/iomem" are both parsed appropriately. Signed-off-by: Lianbo Jiang --- Note: Please follow up this commit below about kdump fix. 1ac3e4a57000 ("kdump: fix an

[PATCH 3/3 v9] kexec: Fix i386 build warnings that missed declaration of struct kimage

2019-11-08 Thread Lianbo Jiang
ystem call") Reported-by: kbuild test robot Signed-off-by: Lianbo Jiang Link: https://lkml.kernel.org/r/201910310233.ejrttmwp%25...@intel.com --- arch/x86/include/asm/crash.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/cra

[PATCH 2/3 v9] x86/kdump: clean up all the code related to the backup region

2019-11-08 Thread Lianbo Jiang
region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87 -- arch

[PATCH 1/3 v9] x86/kdump: always reserve the low 1M when the crashkernel option is specified

2019-11-08 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1M. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/crash.h | 6 ++ arch/x86/kernel/crash.c | 15 +++ arch/x86/realmode/init.c | 2 ++ 3 files chang

[PATCH 0/3 v9] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-11-08 Thread Lianbo Jiang
(). [2] Fix some warnings reported by kduild. Changes since v8: [1] Fix some build warnings reported by kbuild and make it as a separate patch. Lianbo Jiang (3): x86/kdump: always reserve the low 1M when the crashkernel option is specified x86/kdump: clean up all the code related

[PATCH 2/2 RESEND v8] x86/kdump: clean up all the code related to the backup region

2019-10-30 Thread Lianbo Jiang
region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87 -- arch

[PATCH 1/2 RESEND v8] x86/kdump: always reserve the low 1M when the crashkernel option is specified

2019-10-30 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1M. Signed-off-by: Lianbo Jiang Reported-by: kbuild test robot --- arch/x86/include/asm/crash.h | 8 arch/x86/kernel/crash.c | 15 +++ arch/x86/realmode/

[PATCH 0/2 RESEND v8] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-30 Thread Lianbo Jiang
to arch/x86/include/asm/crash.h (Suggested by Dave Young) [2] Adjust the corresponding header files. Changes since v7: [1] Change the function name from kexec_reserve_low_1MiB() to crash_reserve_low_1M(). [2] Fix some warnings reported by kduild. Lianbo Jiang (2): x86/kdump: always

[PATCH 2/2 v8] x86/kdump: clean up all the code related to the backup region

2019-10-29 Thread Lianbo Jiang
region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87 -- arch

[PATCH 0/2 v8] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-29 Thread Lianbo Jiang
to arch/x86/include/asm/crash.h (Suggested by Dave Young) [2] Adjust the corresponding header files. Changes since v7: [1] Change the function name from kexec_reserve_low_1MiB() to crash_reserve_low_1M(). Lianbo Jiang (2): x86/kdump: always reserve the low 1M when the crashkernel option

[PATCH 1/2 v8] x86/kdump: always reserve the low 1M when the crashkernel option is specified

2019-10-29 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1M. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/crash.h | 6 ++ arch/x86/kernel/crash.c | 15 +++ arch/x86/realmode/init.c | 2 ++ 3 files chang

[PATCH 2/2 v7] x86/kdump: clean up all the code related to the backup region

2019-10-28 Thread Lianbo Jiang
to a backup region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87

[PATCH 1/2 v7] x86/kdump: always reserve the low 1MiB when the crashkernel option is specified

2019-10-28 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1MiB. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/crash.h | 6 ++ arch/x86/kernel/crash.c | 15 +++ arch/x86/realmode/init.c | 2 ++ 3 files chang

[PATCH 0/2 v7] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-28 Thread Lianbo Jiang
declaration function to arch/x86/include/asm/crash.h (Suggested by Dave Young) [2] Adjust the corresponding header files. Lianbo Jiang (2): x86/kdump: always reserve the low 1MiB when the crashkernel option is specified x86/kdump: clean up all the code related to the backup region arch/x86

[PATCH 0/2 v6] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-27 Thread Lianbo Jiang
the kexec_reserve_low_1MiB() in arch/x86/kernel/ machine_kexec_64.c so that it does not cause the compile error on non-x86 kernel, and also ensures that it can work well on x86 kernel. Lianbo Jiang (2): x86/kdump: always reserve the low 1MiB when the crashkernel option is specified x86

[PATCH 1/2 v6] x86/kdump: always reserve the low 1MiB when the crashkernel option is specified

2019-10-27 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1MiB. Signed-off-by: Lianbo Jiang --- BTW:I also tried to fix the above problem in purgatory(), but there are too many restricts in purgatory() context, for example: i can't alloca

[PATCH 2/2 v6] x86/kdump: clean up all the code related to the backup region

2019-10-27 Thread Lianbo Jiang
to a backup region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87

[PATCH 2/2 v5] x86/kdump: clean up all the code related to the backup region

2019-10-23 Thread Lianbo Jiang
to a backup region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87

[PATCH 1/2 v5] x86/kdump: always reserve the low 1MiB when the crashkernel option is specified

2019-10-23 Thread Lianbo Jiang
t need to be included in crash dumps or used for anything except the processor trampolines that must live in the low 1MiB. Signed-off-by: Lianbo Jiang --- BTW:I also tried to fix the above problem in purgatory(), but there are too many restricts in purgatory() context, for example: i can't alloca

[PATCH 0/2 v5] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-23 Thread Lianbo Jiang
and which is called by reserve_real_mode(). (Suggested by Boris) Lianbo Jiang (2): x86/kdump: always reserve the low 1MiB when the crashkernel option is specified x86/kdump: clean up all the code related to the backup region arch/x86/include/asm/kexec.h | 10 arch/x86/include

[PATCH 1/3 v4] x86/kdump: always reserve the low 1MiB when the crashkernel option is specified

2019-10-17 Thread Lianbo Jiang
egion in purgatory(). This indicates that it does not need to be included in crash dumps or used for anything execept the processor trampolines that must live in the low 1MiB. In addition, also need to clean all the code related to the backup region later. Signed-off-by: Lianbo Jiang --- arch/x86

[PATCH 3/3 v4] x86/kdump: clean up all the code related to the backup region

2019-10-17 Thread Lianbo Jiang
to a backup region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 87

[PATCH 0/3 v4] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-17 Thread Lianbo Jiang
Lianbo Jiang (3): x86/kdump: always reserve the low 1MiB when the crashkernel option is specified x86/kdump: remove the unused crash_copy_backup_region() x86/kdump: clean up all the code related to the backup region arch/x86/include/asm/crash.h | 1 - arch/x86/include/asm/kexec.h

[PATCH 2/3 v4] x86/kdump: remove the unused crash_copy_backup_region()

2019-10-17 Thread Lianbo Jiang
The crash_copy_backup_region() has never been used, so clean up the redundant code. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/crash.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h index 0acf5ee45a21..089b2850f9d1 100644

[PATCH 2/3 v3] x86/kdump cleanup: remove the unused crash_copy_backup_region()

2019-10-11 Thread Lianbo Jiang
The crash_copy_backup_region() has never been used, so clean up the redundant code. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/crash.h | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/include/asm/crash.h b/arch/x86/include/asm/crash.h index 0acf5ee45a21..089b2850f9d1 100644

[PATCH 3/3 v3] x86/kdump: clean up all the code related to the backup region

2019-10-11 Thread Lianbo Jiang
to a backup region. Currently, the code related to the backup region can be safely removed, so lets clean up. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/kexec.h | 10 arch/x86/include/asm/purgatory.h | 10 arch/x86/kernel/crash.c| 91

[PATCH 0/3 v3] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-11 Thread Lianbo Jiang
) [2] Remove the unused crash_copy_backup_region() [3] Remove the backup region and clean up [4] Split them into three patches Lianbo Jiang (3): x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active x86/kdump cleanup: remove the unused crash_copy_backup_region() x86

[PATCH 1/3 v3] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-11 Thread Lianbo Jiang
purgatory(). In addition, also need to clean all the code related to the backup region later. Signed-off-by: Lianbo Jiang --- arch/x86/realmode/init.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/realmode/init.c b/arch/x86/realmode/init.c index 7dce39c8c034..bf4c8ff

[PATCH v2] x86/kdump: Fix 'kmem -s' reported an invalid freepointer when SME was active

2019-10-07 Thread Lianbo Jiang
e first 640k area to a backup region in the purgatory(). Signed-off-by: Lianbo Jiang --- Changes since v1: 1. Improve patch log 2. Change the checking condition from sme_active() to sme_active() && strstr(boot_command_line, "crashkernel=") arch/x86/kernel/setup.c | 3 +++ 1 file

[PATCH 4/4 v2] Limit the size of vmcore-dmesg.txt to 2G

2019-08-23 Thread Lianbo Jiang
... If vmcore-dmesg.txt occupies the whole disk, the vmcore can not be saved, this is also a problem. Lets limit the size of vmcore-dmesg.txt to avoid such problems. Signed-off-by: Lianbo Jiang --- vmcore-dmesg/vmcore-dmesg.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/vmcore

[PATCH 1/4 v2] Cleanup: remove the read_elf_kcore()

2019-08-23 Thread Lianbo Jiang
Here, no need to wrap the read_elf() again, lets invoke it directly. So remove the read_elf_kcore() and clean up redundant code. Signed-off-by: Lianbo Jiang --- kexec/arch/arm64/kexec-arm64.c | 2 +- util_lib/elf_info.c| 15 ++- util_lib/include/elf_info.h| 2 +- 3

[PATCH 0/4 v2] Limit the size of vmcore-dmesg.txt to 2G

2019-08-23 Thread Lianbo Jiang
] split them([patch 1/4] and [patch 2/4]) into a separate patch. [2] remove a typedef definition for handler. [3] remove some changes of variable 'fname' and fix its error. Lianbo Jiang (4): Cleanup: remove the read_elf_kcore() Fix an error definition about the variable 'fname' Cleanup: move

[PATCH 3/4 v2] Cleanup: move it back from util_lib/elf_info.c

2019-08-23 Thread Lianbo Jiang
Some code related to vmcore-dmesg.c is put into the util_lib, which is not very reasonable, so lets move it back and tidy up those code. In addition, that will also help to limit the size of vmcore-dmesg.txt in vmcore-dmesg.c instead of elf_info.c. Signed-off-by: Lianbo Jiang --- util_lib

[PATCH 2/4 v2] Fix an error definition about the variable 'fname'

2019-08-23 Thread Lianbo Jiang
value will be always 'null' when printing an error information. Signed-off-by: Lianbo Jiang --- util_lib/elf_info.c | 2 +- vmcore-dmesg/vmcore-dmesg.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util_lib/elf_info.c b/util_lib/elf_info.c index d9397ecd8626

[PATCH 2/2] Limit the size of vmcore-dmesg.txt to 2G

2019-08-14 Thread Lianbo Jiang
... If vmcore-dmesg.txt occupies the whole disk, the vmcore can not be saved, this is also a problem. Lets limit the size of vmcore-dmesg.txt to avoid such problems. Signed-off-by: Lianbo Jiang --- vmcore-dmesg/vmcore-dmesg.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/vmcore

[PATCH 1/2] cleanup: move it back from util_lib/elf_info.c

2019-08-14 Thread Lianbo Jiang
Some code related to vmcore-dmesg.c is put into the util_lib, which is not very reasonable, so lets move it back and tidy up those code. In addition, that will also help to limit the size of vmcore-dmesg.txt. Signed-off-by: Lianbo Jiang --- kexec/arch/arm64/kexec-arm64.c | 2 +- util_lib

[PATCH 0/2] Limit the size of vmcore-dmesg.txt to 2G

2019-08-14 Thread Lianbo Jiang
the size of vmcore-dmesg.txt to 2G With some corrupted vmcore files, the vmcore-dmesg.txt file may grow forever till the kdump disk becomes full. Lets limit the size of vmcore-dmesg.txt to avoid such problems. BTW: I tested this patch on x86 64 and arm64, it also worked well. Lianbo Jiang (2): cleanup

[PATCH 2/3 v3] x86/kexec: Set the C-bit in the identity map page table when SEV is active

2019-04-30 Thread Lianbo Jiang
When SEV is active, the second kernel image is loaded into the encrypted memory. Lets make sure that when kexec builds the identity mapping page table it adds the memory encryption mask(C-bit). Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch

[PATCH 1/3 v3] x86/kexec: Do not map the kexec area as decrypted when SEV is active

2019-04-30 Thread Lianbo Jiang
jesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index ceba408ea982..f60611531d17 100644 ---

[PATCH 3/3 v3] kdump, proc/vmcore: Enable dumping encrypted memory when SEV was active

2019-04-30 Thread Lianbo Jiang
are loaded to the encrypted memory when SEV is active, hence the kernel elf header must be remapped as encrypted in order to access it properly. Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- fs/proc/vmcore.c | 6 +++--- 1 file changed, 3 insert

[PATCH 0/3 v3] Add kdump support for the SEV enabled guest

2019-04-30 Thread Lianbo Jiang
nd of the function names. 3. Fix the multiple confusing checks. 4. Add comment in the arch_kexec_post_alloc_pages(). Changes since v2: 1. Add the explanation to the commit message[Boris' suggestion]. 2. Improve the patch log. Lianbo Jiang (3): x86/kexec: Do not map the kexec area as decrypted when SEV is active x86/kexe

[PATCH 3/3 v11] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2019-04-22 Thread Lianbo Jiang
ved ranges are not present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to the kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang ---

[PATCH 2/3 v11] x86/mm: change the check condition in SEV because a new descriptor is introduced

2019-04-22 Thread Lianbo Jiang
IORES_DESC_RESERVED has been created for the reserved areas, similarly, the IORES_DESC_{NONE,RESERVED} should not be mapped encrypted in SEV when using ioremap(). Therefore, need to modify the check condition in SEV and improve them. Suggested-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- arch/x86/mm

[PATCH 0/3 v11] add reserved e820 ranges to the kdump kernel e820 table

2019-04-22 Thread Lianbo Jiang
and redefine it. 3. Change the name of the __ioremap_check_desc_other() to __ioremap_check_desc(). 4. Change the check condition in SEV and also improve them. 5. Modify the return value for some functions. Lianbo Jiang (3): x86/e820, resource: add a new I/O resource descriptor 'IORES_DESC_

[PATCH 1/3 v11] x86/e820, resource: add a new I/O resource descriptor 'IORES_DESC_RESERVED'

2019-04-22 Thread Lianbo Jiang
the reserved resource ranges when walking through iomem resources. Suggested-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- arch/x86/kernel/e820.c | 2 +- include/linux/ioport.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index

[PATCH 2/2 RESEND v10] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2019-03-29 Thread Lianbo Jiang
ved ranges are not present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to the kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang ---

[PATCH 0/2 RESEND v10] add reserved e820 ranges to the kdump kernel e820 table

2019-03-29 Thread Lianbo Jiang
modify the kernel/resource.c, so correct them. 3. Change the name of the __ioremap_check_desc_other() to __ioremap_check_desc_none_and_reserved(), and modify the check condition, add comment above it. Lianbo Jiang (2): x86/mm, resource: add a new I/O resource descriptor 'IORES_DESC

[PATCH 1/2 v10] x86/mm, resource: add a new I/O resource descriptor 'IORES_DESC_RESERVED'

2019-03-29 Thread Lianbo Jiang
-by: Lianbo Jiang --- arch/x86/kernel/e820.c | 2 +- arch/x86/mm/ioremap.c | 16 ++-- include/linux/ioport.h | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 2879e234e193..16fcde196243 100644 --- a/arch/x86/kernel

[PATCH 0/2 v10] add reserved e820 ranges to the kdump kernel e820 table

2019-03-29 Thread Lianbo Jiang
modify the kernel/resource.c, so correct them. 3. Change the name of the __ioremap_check_desc_other() to __ioremap_check_desc_none_and_reserved(), and modify the check condition, add comment above it. Lianbo Jiang (2): x86/mm, resource: add a new I/O resource descriptor 'IORES_DESC

[PATCH 2/2 v10] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2019-03-29 Thread Lianbo Jiang
ved ranges are not present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to the kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang ---

[PATCH 3/3 v2] kdump, proc/vmcore: Enable kdumping encrypted memory when SEV was active

2019-03-26 Thread Lianbo Jiang
y when SEV was enabled, hence the kernel elf header must be remapped as encrypted in order to access it properly. Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- fs/proc/vmcore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 2/3 v2] x86/kexec: Set the C-bit in the identity map page table when SEV is active

2019-03-26 Thread Lianbo Jiang
When SEV is active, the second kernel image is loaded into the encrypted memory. Lets make sure that when kexec builds the identity mapping page table it adds the memory encryption mask(C-bit). Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch

[PATCH 0/3 v2] Add kdump support for the SEV enabled guest

2019-03-26 Thread Lianbo Jiang
cho c > /proc/sysrq-trigger [3] check and parse the vmcore # crash vmlinux /var/crash/127.0.0.1-2019-03-15-05\:03\:42/vmcore Changes since v1: 1. Modify the patch subject prefixes. 2. Improve patch log: add parentheses at the end of the function names. 3. Fix the multiple confusing checks. 4. Ad

[PATCH 1/3 v2] x86/kexec: Do not map the kexec area as decrypted when SEV is active

2019-03-26 Thread Lianbo Jiang
Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index ceba408ea982..f60611531d17 100644 --- a/arch/x86/kernel

[PATCH 2/3 v9] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED'

2019-03-21 Thread Lianbo Jiang
and also cause some errors. Because the 'E820_TYPE_RESERVED' type is converted to the new descriptor 'IORES_DESC_RESERVED' instead of 'IORES_DESC_NONE', it has been changed. Suggested-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- arch/x86/kernel/e820.c | 2 +- include/linux/ioport.h | 1

[PATCH 3/3 v9] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2019-03-21 Thread Lianbo Jiang
ot present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/

[PATCH 0/3 v9] add reserved e820 ranges to the kdump kernel e820 table

2019-03-21 Thread Lianbo Jiang
64.(Borislav's suggestion) 2. Change the examination condition to the 'IORES_DESC_ACPI_*'. 3. Modify the signature. This patch(add the new I/O resource descriptor 'IORES_DESC_RESERVED') was suggested by Boris. Lianbo Jiang (3): x86/mm: Change the examination condition to avoid confusion resource: a

[PATCH 1/3 v9] x86/mm: Change the examination condition to avoid confusion

2019-03-21 Thread Lianbo Jiang
Following the commit <0e4c12b45aa8> ("x86/mm, resource: Use PAGE_KERNEL protection for ioremap of memory pages"), here it is really checking for the 'IORES_DESC_ACPI_*' values. Therefore, it is necessary to change the examination condition to avoid confusion. Signed-off-

[PATCH 0/3] Add kdump support for the SEV enabled guest

2019-03-15 Thread Lianbo Jiang
disable_cpu_apicid=0" [2] trigger panic # echo 1 > /proc/sys/kernel/sysrq # echo c > /proc/sysrq-trigger [3] check and parse the vmcore # crash vmlinux /var/crash/127.0.0.1-2019-03-15-05\:03\:42/vmcore Lianbo Jiang (3): kexec: Do not map the kexec area as decrypted when SEV is ac

[PATCH 3/3] kdump, proc/vmcore: Enable kdumping encrypted memory when SEV was active

2019-03-15 Thread Lianbo Jiang
y when SEV was enabled, hence the kernel elf header must be remapped as encrypted in order to access it properly. Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- fs/proc/vmcore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 2/3] kexec: Set the C-bit in the identity map page table when SEV is active

2019-03-15 Thread Lianbo Jiang
When SEV is active, the second kernel image is loaded into the encrypted memory. Lets make sure that when kexec builds the identity mapping page table it adds the memory encryption mask(C-bit). Co-developed-by: Brijesh Singh Signed-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch

[PATCH 1/3] kexec: Do not map the kexec area as decrypted when SEV is active

2019-03-15 Thread Lianbo Jiang
-off-by: Brijesh Singh Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index ceba408ea982..bcebf4993da4 100644 --- a/arch/x86/kernel

[PATCH] kexec/x86: Unconditionally add the acpi_rsdp command line

2019-03-15 Thread Lianbo Jiang
acpi_rsdp command line if it sees the first kernel support efi runtime. This is causing the second kernel boot failure. The EFI runtime is not available so early in the boot process so unconditionally pass the 'acpi_rsdp=xxx' to the second kernel. Signed-off-by: Lianbo Jiang Signed-off-by: Brijesh

[PATCH v3] Remove the memory encryption mask to obtain the true physical address

2019-01-29 Thread Lianbo Jiang
For AMD machine with SME feature, if SME is enabled in the first kernel, the crashed kernel's page table(pgd/pud/pmd/pte) contains the memory encryption mask, so makedumpfile needs to remove the memory encryption mask to obtain the true physical address. Signed-off-by: Lianbo Jiang --- Changes

[PATCH v2] Remove the memory encryption mask to obtain the true physical address

2019-01-27 Thread Lianbo Jiang
For AMD machine with SME feature, if SME is enabled in the first kernel, the crashed kernel's page table(pgd/pud/pmd/pte) contains the memory encryption mask, so makedumpfile needs to remove the memory encryption mask to obtain the true physical address. Signed-off-by: Lianbo Jiang --- Changes

[PATCH 2/2] Remove the memory encryption mask to obtain the true physical address

2019-01-22 Thread Lianbo Jiang
For AMD machine with SME feature, if SME is enabled in the first kernel, the crashed kernel's page table(pgd/pud/pmd/pte) contains the memory encryption mask, so makedumpfile needs to remove the memory encryption mask to obtain the true physical address. Signed-off-by: Lianbo Jiang --- arch

[PATCH 1/2] Makedumpfile: add a new variable 'sme_mask' to number_table

2019-01-22 Thread Lianbo Jiang
It will be used to store the sme mask for crashed kernel, the sme_mask denotes whether the old memory is encrypted or not. Signed-off-by: Lianbo Jiang --- makedumpfile.c | 3 +++ makedumpfile.h | 1 + 2 files changed, 4 insertions(+) diff --git a/makedumpfile.c b/makedumpfile.c index 8923538

[PATCH 0/2] makedumpfile needs to remove the memory encryption

2019-01-22 Thread Lianbo Jiang
to vmcoreinfo https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=65f750e5457aef9a8085a99d613fea0430303e93 https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=f263245a0ce2c4e23b89a58fa5f7dfc048e11929 Lianbo Jiang (2): Makedumpfile: add a new variable 'sme_mask

[PATCH 1/2 v6] kdump: add the vmcoreinfo documentation

2019-01-10 Thread Lianbo Jiang
This document lists some variables that export to vmcoreinfo, and briefly describles what these variables indicate. It should be instructive for many people who do not know the vmcoreinfo. Suggested-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- Documentation/kdump/vmcoreinfo.txt | 500

[PATCH 0/2 v6] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2019-01-10 Thread Lianbo Jiang
. Improve patch log. Lianbo Jiang (2): kdump: add the vmcoreinfo documentation kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Documentation/kdump/vmcoreinfo.txt | 500 + arch/x86/kernel/machine_kexec_64.c | 3 + 2 files changed, 503 insertions

[PATCH 2/2 v6] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2019-01-10 Thread Lianbo Jiang
the true physical address. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4c8acdfdc5a7..bc4108096b18 100644 --- a/arch/x86/kernel/machine_kexec_64

[PATCH 2/2 v5] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2019-01-06 Thread Lianbo Jiang
address. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4c8acdfdc5a7..bc4108096b18 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86

[PATCH 0/2 v5] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2019-01-06 Thread Lianbo Jiang
in this document. 3. Correct some of the mistakes in this document. *** BLURB HERE *** Lianbo Jiang (2): kdump: add the vmcoreinfo documentation kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Documentation/kdump/vmcoreinfo.txt | 500 + arch/x86/kernel

[PATCH 1/2 v5] kdump: add the vmcoreinfo documentation

2019-01-06 Thread Lianbo Jiang
-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- Documentation/kdump/vmcoreinfo.txt | 500 + 1 file changed, 500 insertions(+) create mode 100644 Documentation/kdump/vmcoreinfo.txt diff --git a/Documentation/kdump/vmcoreinfo.txt b/Documentation/kdump/vmcoreinfo.txt new

[PATCH 1/2 v4] kdump: add the vmcoreinfo documentation

2018-12-19 Thread Lianbo Jiang
-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- Documentation/kdump/vmcoreinfo.txt | 513 + 1 file changed, 513 insertions(+) create mode 100644 Documentation/kdump/vmcoreinfo.txt diff --git a/Documentation/kdump/vmcoreinfo.txt b/Documentation/kdump/vmcoreinfo.txt new

[PATCH 0/2 v4] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-19 Thread Lianbo Jiang
it become more clear and easy to read. 2. Move sme_mask comments in the code to the vmcoreinfo document. 3. Improve patch log. Lianbo Jiang (2): kdump: add the vmcoreinfo documentation kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Documentation/kdump/vmcoreinfo.txt | 513

[PATCH 2/2 v4] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-19 Thread Lianbo Jiang
address. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4c8acdfdc5a7..bc4108096b18 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86

[PATCH 1/2 v3] kdump: add the vmcoreinfo documentation

2018-12-16 Thread Lianbo Jiang
-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- Documentation/kdump/vmcoreinfo.txt | 456 + 1 file changed, 456 insertions(+) create mode 100644 Documentation/kdump/vmcoreinfo.txt diff --git a/Documentation/kdump/vmcoreinfo.txt b/Documentation/kdump/vmcoreinfo.txt

[PATCH 2/2 v3] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-16 Thread Lianbo Jiang
address. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4c8acdfdc5a7..1860fe24117d 100644 --- a/arch/x86/kernel/machine_kexec_64.c

[PATCH 0/2 v3] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-16 Thread Lianbo Jiang
comment for the code. 3. Improve the patch log. 4. Add the vmcoreinfo documentation. Changes since v2: 1. Improve the vmcoreinfo document, add more descripts for these variables exported. 2. Fix spelling errors in the document. Lianbo Jiang (2): kdump: add the vmcoreinfo documentation kdump

[PATCH 1/2 v2] kdump: add the vmcoreinfo documentation

2018-12-01 Thread Lianbo Jiang
-by: Borislav Petkov Signed-off-by: Lianbo Jiang --- Documentation/kdump/vmcoreinfo.txt | 400 + 1 file changed, 400 insertions(+) create mode 100644 Documentation/kdump/vmcoreinfo.txt diff --git a/Documentation/kdump/vmcoreinfo.txt b/Documentation/kdump/vmcoreinfo.txt

[PATCH 2/2 v2] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-01 Thread Lianbo Jiang
address. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 4c8acdfdc5a7..1860fe24117d 100644 --- a/arch/x86/kernel/machine_kexec_64.c

[PATCH 0/2 v2] kdump, vmcoreinfo: Export the value of sme mask to vmcoreinfo

2018-12-01 Thread Lianbo Jiang
comment for the code. 3. Improve the patch log. 4. Add the vmcoreinfo documentation. Lianbo Jiang (2): kdump: add the vmcoreinfo documentation kdump,vmcoreinfo: Export the value of sme mask to vmcoreinfo Documentation/kdump/vmcoreinfo.txt | 400 + arch/x86/kernel

[PATCH 2/2 v8] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2018-11-29 Thread Lianbo Jiang
ot present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/

[PATCH 1/2 v8] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED'

2018-11-29 Thread Lianbo Jiang
and also cause some errors. Because the 'E820_TYPE_RESERVED' type is converted to the new descriptor 'IORES_DESC_RESERVED' instead of 'IORES_DESC_NONE', it has been changed. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/ia64/kernel/efi.c | 4 arch/x86/kernel/e820.c | 2

[PATCH 0/2 v8] add reserved e820 ranges to the kdump kernel e820 table

2018-11-29 Thread Lianbo Jiang
tor 'IORES_DESC_RESERVED'. 3. Update patch log. Changes since v7: 1. Improve patch log. 2. Improve this function __ioremap_check_desc_other(). 3. Modify code comment in the __ioremap_check_desc_other() Lianbo Jiang (2): resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED' x86/kexec_

[PATCH 0/2 RESEND v7] add reserved e820 ranges to the kdump kernel e820 table

2018-11-23 Thread Lianbo Jiang
and also updates these codes relates to 'IORES_DESC_NONE'. 2. Modify the [PATCH 2/2], and walk through io resource based on the new descriptor 'IORES_DESC_RESERVED'. 3. Update patch log. Lianbo Jiang (2): resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED' x86/kexec_file: add reserved e8

[PATCH 1/2 RESEND v7] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED'

2018-11-23 Thread Lianbo Jiang
to 'IORES_DESC_NONE' have been updated. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/ia64/kernel/efi.c | 4 arch/x86/kernel/e820.c | 2 +- arch/x86/mm/ioremap.c | 9 - include/linux/ioport.h | 1 + kernel/resource.c | 6 +++--- 5 files changed, 17 insertions(+), 5

[PATCH 2/2 RESEND v7] x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table

2018-11-23 Thread Lianbo Jiang
ved ranges are not present at all in kdump kernel e820 table, those reserved regions are considered as encrypted, it goes wrong. The e820 reserved range is useful in kdump kernel, so it is necessary to pass the e820 reserved ranges to kdump kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang ---

[PATCH 1/2 v7] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED'

2018-11-15 Thread Lianbo Jiang
resource descriptor 'IORES_DESC_RESERVED' for the iomem resources search interfaces. It is helpful to exactly match the reserved resource ranges when walking through iomem resources. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- Changes since v5: 1. Improve the patch log Changes since v6

  1   2   >