[PATCH 2/2] support kdump when AMD secure memory encryption is active

2018-05-14 Thread Lianbo Jiang
| | on | off | no| | off | on| no| |__|___|___| Signed-off-by: Lianbo Jiang <liji...@redhat.com> --- arch/x86/include/asm/dmi.h | 14 +- arch/x86/kernel/acpi/boot.c | 8 arch/x86/

[PATCH 1/2] add a function(ioremap_encrypted) for kdump when AMD sme enabled.

2018-05-14 Thread Lianbo Jiang
It is convenient to remap the old memory encrypted to the second kernel by calling ioremap_encrypted(). Signed-off-by: Lianbo Jiang <liji...@redhat.com> --- arch/x86/include/asm/io.h | 2 ++ arch/x86/mm/ioremap.c | 25 + 2 files changed, 19 insertions(+), 8 del

[PATCH 0/2] support kdump for AMD secure memory encryption(sme)

2018-05-14 Thread Lianbo Jiang
/makedumpfile commit e1de103eca8f (A draft for kdump vmcore about AMD SME) Author: Lianbo Jiang <liji...@redhat.com> Date: Mon May 14 17:02:40 2018 +0800 Note: This patch can only dump vmcore in the case of SME enabled. crash-7.2.1: https://github.com/crash-utility/crash.git commit 1e1bd9c4c1b

[PATCH 0/4 V3] Support kdump for AMD secure memory encryption(SME)

2018-06-16 Thread Lianbo Jiang
tools: makedumpfile[v1.6.3]: https://github.com/LianboJ/makedumpfile commit e1de103eca8f (A draft for kdump vmcore about AMD SME) Author: Lianbo Jiang Date: Mon May 14 17:02:40 2018 +0800 Note: This patch can only dump vmcore in the case of SME enabled. crash-7.2.1: https://github.com/crash

[PATCH 2/4 V3] Allocate pages for kdump without encryption when SME is enabled

2018-06-16 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate pages for kdump without encryption in order to be able to boot the second kernel in the same manner as kexec, which helps to keep the same code style. Signed-off-by: Lianbo Jiang --- kernel/kexec_core.c | 12 1 file changed

[PATCH 3/4 V3] Remap the device table of IOMMU in encrypted manner for kdump

2018-06-16 Thread Lianbo Jiang
In kdump mode, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So we must remap it in encrypted manner in order to be automatically decrypted when we read. Signed-off-by: Lianbo Jiang --- Some changes: 1. add some

[PATCH 1/4 V3] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-06-16 Thread Lianbo Jiang
It is convenient to remap the old memory encrypted to the second kernel by calling ioremap_encrypted(). Signed-off-by: Lianbo Jiang --- Some changes: 1. remove the sme_active() check in __ioremap_caller(). 2. put some logic into the early_memremap_pgprot_adjust() for early memremap. arch/x86

[PATCH 4/4 V3] Help to dump the old memory encrypted into vmcore file

2018-06-16 Thread Lianbo Jiang
In kdump mode, we need to dump the old memory into vmcore file, if SME is enabled in the first kernel, we must remap the old memory in encrypted manner, which will be automatically decrypted when we read from DRAM. It helps to parse the vmcore for some tools. Signed-off-by: Lianbo Jiang --- Some

[PATCH 1/2 V2] Add a function(ioremap_encrypted) for kdump when AMD sme enabled.

2018-06-14 Thread Lianbo Jiang
It is convenient to remap the old memory encrypted to the second kernel by calling ioremap_encrypted(). Signed-off-by: Lianbo Jiang --- Some changes based on V1: 1. remove the sme_active() check in __ioremap_caller(). arch/x86/include/asm/io.h | 3 +++ arch/x86/mm/ioremap.c | 24

[PATCH 0/2 V2] Support kdump for AMD secure memory encryption(sme)

2018-06-14 Thread Lianbo Jiang
/makedumpfile commit e1de103eca8f (A draft for kdump vmcore about AMD SME) Author: Lianbo Jiang Date: Mon May 14 17:02:40 2018 +0800 Note: This patch can only dump vmcore in the case of SME enabled. crash-7.2.1: https://github.com/crash-utility/crash.git commit 1e1bd9c4c1be (Fix for the "bpf&quo

[PATCH 2/2 V2] Support kdump when AMD secure memory encryption is active

2018-06-14 Thread Lianbo Jiang
| | on | off | no| | off | on| no| |__|___|___| Signed-off-by: Lianbo Jiang --- Some changes based on V1: 1. remove the '#ifdef' stuff throughout this patch. 2. put some logic into the early_memremap_pgprot_adjust

[PATCH 2/5 V5] Allocate pages for kdump without encryption when SME is enabled

2018-07-02 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate pages for kdump without encryption in order to be able to boot the second kernel in the same manner as kexec, which helps to keep the same code style. Signed-off-by: Lianbo Jiang --- Some changes: 1. remove some redundant codes for crash

[PATCH 0/5 V5] Support kdump for AMD secure memory encryption(SME)

2018-07-02 Thread Lianbo Jiang
akedumpfile commit e1de103eca8f (A draft for kdump vmcore about AMD SME) Author: Lianbo Jiang Date: Mon May 14 17:02:40 2018 +0800 Note: This patch can only dump vmcore in the case of SME enabled. crash-7.2.1: https://github.com/crash-utility/crash.git commit 1e1bd9c4c1be (Fix for the "bpf&quo

[PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-07-02 Thread Lianbo Jiang
It is convenient to remap the old memory encrypted to the second kernel by calling ioremap_encrypted(). Signed-off-by: Lianbo Jiang --- Some changes: 1. remove the sme_active() check in __ioremap_caller(). 2. revert some logic in the early_memremap_pgprot_adjust() for early memremap and make

[PATCH 4/5 V5] Adjust some permanent mappings in unencrypted ways for kdump when SME is enabled.

2018-07-02 Thread Lianbo Jiang
into the early_memremap_pgprot_adjust(), which will have an opportunity to adjust it. Signed-off-by: Lianbo Jiang --- arch/x86/mm/ioremap.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index e01e6c6..3c1c8c4 100644 --- a/arch/x86/mm

[PATCH 5/5 V5] Help to dump the old memory encrypted into vmcore file

2018-07-02 Thread Lianbo Jiang
In kdump mode, we need to dump the old memory into vmcore file, if SME is enabled in the first kernel, we must remap the old memory in encrypted manner, which will be automatically decrypted when we read from DRAM. It helps to parse the vmcore for some tools. Signed-off-by: Lianbo Jiang --- Some

[PATCH 3/5 V5] Remap the device table of IOMMU in encrypted manner for kdump

2018-07-02 Thread Lianbo Jiang
In kdump mode, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So we must remap it in encrypted manner in order to be automatically decrypted when we read. Signed-off-by: Lianbo Jiang --- Some changes: 1. add some

[PATCH] kdump: fix an error that can not parse the e820 reserved region

2018-09-05 Thread Lianbo Jiang
"reserved" in the /proc/iomem, so we use the strncasecmp() instead of the memcmp() to fix it. Signed-off-by: Lianbo Jiang --- kexec/arch/i386/crashdump-x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump

[PATCH v2] kdump: fix an error that can not parse the e820 reserved region

2018-09-05 Thread Lianbo Jiang
"reserved" in the /proc/iomem, so we have to fix these cases. Signed-off-by: Lianbo Jiang --- kexec/arch/i386/crashdump-x86.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c index 437e8a8..140f45b 100644 --- a/kexec

[PATCH 0/4 v7] Support kdump for AMD secure memory encryption(SME)

2018-09-07 Thread Lianbo Jiang
input_data: 0x00087e91c3b4 input_len: 0x0067fcbd output: 0x00087d40 output_len: 0x01b6fa90 kernel_total_size: 0x01a9d000 trampoline_32bit: 0x00099000 Decompressing Linux... Parsing ELF...[---Here the system will hang] Lianbo Jiang (4): x86/io

[PATCH 3/4 v7] amd_iommu: remap the device table of IOMMU with the memory encryption mask for kdump

2018-09-07 Thread Lianbo Jiang
In kdump kernel, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So we have to remap the old device table with the memory encryption mask. Signed-off-by: Lianbo Jiang --- drivers/iommu/amd_iommu_init.c | 14

[PATCH 2/4 v7] kexec: allocate unencrypted control pages for kdump in case SME is enabled

2018-09-07 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate unencrypted pages for kdump in order to be able to boot the kdump kernel like kexec. Signed-off-by: Lianbo Jiang --- kernel/kexec_core.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel/kexec_core.c b/kernel

[PATCH 4/4 v7] kdump/vmcore: support encrypted old memory with SME enabled

2018-09-07 Thread Lianbo Jiang
the SME flag from the first kernel to the kdump kernel, it is really too expensive to do this. This patches are only for SME kdump, the patches don't support SEV kdump. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/crash_dump_encrypt.c | 53

[PATCH 1/4 v7] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory

2018-09-07 Thread Lianbo Jiang
When SME is enabled on AMD machine, the memory is encrypted in the first kernel. In this case, SME also needs to be enabled in kdump kernel, and we have to remap the old memory with the memory encryption mask. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/io.h | 3 +++ arch/x86/mm

[PATCH 0/5 V6] Support kdump for AMD secure memory encryption(SME)

2018-08-31 Thread Lianbo Jiang
R11: 0246 R12: [ 369.584177] R13: 55602a075260 R14: 0002 R15: Lianbo Jiang (5): x86/ioremap: add a function ioremap_encrypted() to remap kdump old memroy x86/ioremap: strengthen the logic in early_memremap_pgprot_adjust() to adj

[PATCH 3/5 V6] kexec: allocate unencrypted control pages for kdump in case SME is enabled

2018-08-31 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate unencrypted pages for kdump in order to be able to boot the kdump kernel like kexec. Signed-off-by: Lianbo Jiang --- kernel/kexec_core.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel/kexec_core.c b/kernel

[PATCH 4/5 V6] iommu/amd_iommu: remap the device table of IOMMU with the memory encryption mask for kdump

2018-08-31 Thread Lianbo Jiang
In kdump kernel, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So we have to remap the old device table with the memory encryption mask. Signed-off-by: Lianbo Jiang --- drivers/iommu/amd_iommu_init.c | 14

[PATCH 5/5 V6] kdump/vmcore: support encrypted old memory with SME enabled

2018-08-31 Thread Lianbo Jiang
the SME flag from the first kernel to the kdump kernel, it is really too expensive to do this. This patches are only for SME kdump, the patches don't support SEV kdump. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/crash_dump_encrypt.c | 53

[PATCH 1/5 V6] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memroy

2018-08-31 Thread Lianbo Jiang
When SME is enabled on AMD machine, the memory is encrypted in the first kernel. In this case, SME also needs to be enabled in kdump kernel, and we have to remap the old memory with the memory encryption mask. Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/io.h | 3 +++ arch/x86/mm

[PATCH 2/5 V6] x86/ioremap: strengthen the logic in early_memremap_pgprot_adjust() to adjust encryption mask

2018-08-31 Thread Lianbo Jiang
For kdump kernel, when SME is enabled, the acpi table and dmi table will need to be remapped without the memory encryption mask. So we have to strengthen the logic in early_memremap_pgprot_adjust(), which makes us have an opportunity to adjust the memory encryption mask. Signed-off-by: Lianbo

[PATCH] Fix array index out of bound exception

2018-03-06 Thread Lianbo Jiang
. Signed-off-by: Lianbo Jiang <liji...@redhat.com> --- print_info.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/print_info.c b/print_info.c index e0e6a27..09e215a 100644 --- a/print_info.c +++ b/print_info.c @@ -16,6 +16,8 @@ #include "p

[PATCH 1/5 V4] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-06-28 Thread Lianbo Jiang
It is convenient to remap the old memory encrypted to the second kernel by calling ioremap_encrypted(). Signed-off-by: Lianbo Jiang --- Some changes: 1. remove the sme_active() check in __ioremap_caller(). 2. revert some logic in the early_memremap_pgprot_adjust() for early memremap and make

[PATCH 0/5 V4] Support kdump for AMD secure memory encryption(SME)

2018-06-28 Thread Lianbo Jiang
akedumpfile commit e1de103eca8f (A draft for kdump vmcore about AMD SME) Author: Lianbo Jiang Date: Mon May 14 17:02:40 2018 +0800 Note: This patch can only dump vmcore in the case of SME enabled. crash-7.2.1: https://github.com/crash-utility/crash.git commit 1e1bd9c4c1be (Fix for the "bpf&quo

[PATCH 3/5 V4] Remap the device table of IOMMU in encrypted manner for kdump

2018-06-28 Thread Lianbo Jiang
In kdump mode, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So we must remap it in encrypted manner in order to be automatically decrypted when we read. Signed-off-by: Lianbo Jiang --- Some changes: 1. add some

[PATCH 4/5 V4] Adjust some permanent mappings in unencrypted ways for kdump when SME is enabled.

2018-06-28 Thread Lianbo Jiang
into the early_memremap_pgprot_adjust(), which will have an opportunity to adjust it. Signed-off-by: Lianbo Jiang --- arch/x86/mm/ioremap.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index e01e6c6..3c1c8c4 100644 --- a/arch/x86/mm

[PATCH 5/5 V4] Help to dump the old memory encrypted into vmcore file

2018-06-28 Thread Lianbo Jiang
In kdump mode, we need to dump the old memory into vmcore file, if SME is enabled in the first kernel, we must remap the old memory in encrypted manner, which will be automatically decrypted when we read from DRAM. It helps to parse the vmcore for some tools. Signed-off-by: Lianbo Jiang --- Some

[PATCH 2/5 V4] Allocate pages for kdump without encryption when SME is enabled

2018-06-28 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate pages for kdump without encryption in order to be able to boot the second kernel in the same manner as kexec, which helps to keep the same code style. Signed-off-by: Lianbo Jiang --- Some changes: 1. remove some redundant codes for crash

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

2018-10-22 Thread Lianbo Jiang
d you need to apply the follow patch before test kdump file_load, otherwise these patches won't work. commit <010a93bf97c7> "resource: Fix find_next_iomem_res() iteration issue" Lianbo Jiang (2): x86/kexec_file: add e820 entry in case e820 type string matches to io reso

[PATCH 1/2 v4] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name

2018-10-22 Thread Lianbo Jiang
in memmap_entry_callback() to match the e820 type and resource name. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/e820/api.h | 2 ++ arch/x86/kernel/crash.c | 6 +- arch/x86/kernel/e820.c | 2 +- kernel/resource.c | 1 + 4 files changed, 9

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

2018-10-22 Thread Lianbo Jiang
sit in e820 reserved ranges, thus the early ioremap code naturally map them as decrypted. If it also has same e820 reserve setup in kdump kernel then it will just work like normal kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 4 1 file changed, 4

[PATCH] kdump, vmcoreinfo: Export sme_me_mask value to vmcoreinfo

2018-10-26 Thread Lianbo Jiang
For AMD machine with SME feature, makedumpfile tools need to know whether the crash kernel was encrypted or not. So it is necessary to write the sme_me_mask to vmcoreinfo. Signed-off-by: Lianbo Jiang --- arch/x86/kernel/machine_kexec_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH 1/2 v5] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name

2018-11-06 Thread Lianbo Jiang
in memmap_entry_callback() to match the e820 type and resource name. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/e820/api.h | 2 ++ arch/x86/kernel/crash.c | 6 +- arch/x86/kernel/e820.c | 2 +- kernel/resource.c | 1 + 4 files changed, 9

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

2018-11-06 Thread Lianbo Jiang
reserved ranges, thus the early ioremap code naturally map them as decrypted. If it also has same e820 reserve setup in kdump kernel then it will just work like normal kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 4 1 file changed, 4 insertions

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

2018-11-06 Thread Lianbo Jiang
walks through iomem resources. Please refer to this commit <010a93bf97c7> "resource: Fix find_next_iomem_res() iteration issue" Changes since v4: 1. Improve the patch log, and add kernel log. Lianbo Jiang (2): x86/kexec_file: add e820 entry in case e820 type string m

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

2018-11-13 Thread Lianbo Jiang
res() iteration issue" Changes since v4: 1. Improve the patch log, and add kernel log. Changes since v5: 1. Rewrite these patches log. Lianbo Jiang (2): x86/kexec_file: add e820 entry in case e820 type string matches to io resource name x86/kexec_file: add reserved e820 ranges to k

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

2018-11-13 Thread Lianbo Jiang
ved 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 --- Changes since v5: 1. Improve the patch log arch/x86/kernel/crash.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/x

[PATCH 1/2 v6] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name

2018-11-13 Thread Lianbo Jiang
these redundant type(such as E820_TYPE_RAM/E820_TYPE_ UNUSABLE/E820_TYPE_KERN) in order to add exact e820 reserved type to kdump kernel e820 table. Thus it also needs an extra checking in memmap_entry_ callback() to match the e820 type and resource name. Suggested-by: Dave Young Signed-off-by: Lianbo

[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

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

2018-11-15 Thread Lianbo Jiang
ese patches log. Changes since v6: 1. Modify the [PATCH 1/2], and add the new I/O resource descriptor 'IORES_DESC_RESERVED' for the iomem resources search interfaces. 2. Modify the [PATCH 2/2], and walk through io resource based on the new descriptor 'IORES_DESC_RESERVED'. Lianbo Jiang (2):

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

2018-11-15 Thread Lianbo Jiang
ved 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 --- Changes since v5: 1. Improve the patch log Changes since v6: 1. Modify this patch, and walk through io resource based on the new d

[PATCH 3/4 v8] iommu/amd: Remap the device table of IOMMU with the memory encryption mask for kdump

2018-09-29 Thread Lianbo Jiang
In kdump kernel, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So the old device table has to be remapped with the memory encryption mask. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky Acked-by: Joerg Roedel

[PATCH 1/4 v8] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory

2018-09-29 Thread Lianbo Jiang
for encrypted to make them as before. ioremap_encrypted()\ ioremap_cache() | ioremap_prot() | ioremap_wt()|->__ioremap_caller() ioremap_wc()| ioremap_uc() | ioremap_nocache() / Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- Changes

[PATCH 0/4 v8] Support kdump for AMD secure memory encryption(SME)

2018-09-29 Thread Lianbo Jiang
l_size: 0x01a9d000 trampoline_32bit: 0x00099000 Decompressing Linux... Parsing ELF...[---Here the system will hang] Lianbo Jiang (4): x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory kexec: allocate decrypted control pages for kdump in case

[PATCH 2/4 v8] kexec: allocate decrypted control pages for kdump in case SME is enabled

2018-09-29 Thread Lianbo Jiang
When SME is enabled in the first kernel, it needs to allocate decrypted pages for kdump, because when it boots to the kdump kernel, these pages won't be accessed encrypted at the initial stage, in order to boot the kdump kernel in the same manner as originally booted. Signed-off-by: Lianbo Jiang

[PATCH 4/4 v8] kdump/vmcore: support encrypted old memory with SME enabled

2018-09-29 Thread Lianbo Jiang
to consider how to pass the SME flag from the first kernel to the kdump kernel, it is really too expensive to do this. This patches are only for SME kdump, the patches don't support SEV kdump. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- Changes since v7: 1. Delete a file arch/x86/kernel

[PATCH v8 RESEND 1/4] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory

2018-09-29 Thread Lianbo Jiang
for encrypted to make them as before. ioremap_encrypted()\ ioremap_cache() | ioremap_prot() | ioremap_wt()|->__ioremap_caller() ioremap_wc()| ioremap_uc() | ioremap_nocache() / Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- Changes

[PATCH v8 RESEND 0/4] Support kdump for AMD secure memory encryption(SME)

2018-09-29 Thread Lianbo Jiang
ta: 0x00087e91c3b4 input_len: 0x0067fcbd output: 0x00087d40 output_len: 0x01b6fa90 kernel_total_size: 0x01a9d000 trampoline_32bit: 0x00099000 Decompressing Linux... Parsing ELF...[---Here the system will hang] Lianbo Jiang (4): x86/ioremap:

[PATCH v8 RESEND 4/4] kdump/vmcore: support encrypted old memory with SME enabled

2018-09-29 Thread Lianbo Jiang
to consider how to pass the SME flag from the first kernel to the kdump kernel, it is really too expensive to do this. This patches are only for SME kdump, the patches don't support SEV kdump. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- Changes since v7: 1. Delete a file arch/x86/kernel

[PATCH v8 RESEND 3/4] iommu/amd: Remap the device table of IOMMU with the memory encryption mask for kdump

2018-09-29 Thread Lianbo Jiang
In kdump kernel, it will copy the device table of IOMMU from the old device table, which is encrypted when SME is enabled in the first kernel. So the old device table has to be remapped with the memory encryption mask. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky Acked-by: Joerg Roedel

[PATCH v8 RESEND 2/4] kexec: allocate decrypted control pages for kdump in case SME is enabled

2018-09-29 Thread Lianbo Jiang
When SME is enabled in the first kernel, it needs to allocate decrypted pages for kdump, because when it boots to the kdump kernel, these pages won't be accessed encrypted at the initial stage, in order to boot the kdump kernel in the same manner as originally booted. Signed-off-by: Lianbo Jiang

[PATCH 2/3 v3] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name

2018-09-21 Thread Lianbo Jiang
in memmap_entry_callback() to match the e820 type and resource name. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/e820/api.h | 2 ++ arch/x86/kernel/crash.c | 6 +- arch/x86/kernel/e820.c | 2 +- kernel/resource.c | 1 + 4 files changed, 9

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

2018-09-21 Thread Lianbo Jiang
, these ranges sit in e820 reserved ranges, thus the early ioremap code naturally map them as unencrypted. If we also have same e820 reserve setup in kdump kernel then it will just work like normal kernel. Suggested-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 5 + 1 file

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

2018-09-21 Thread Lianbo Jiang
e for e820 reserved ranges. 2. Modified the invalid SOB chain issue. Lianbo Jiang (3): resource: fix an error which walks through iomem resources x86/kexec_file: add e820 entry in case e820 type string matches to io resource name x86/kexec_file: add reserved e820 ranges to kdump kernel

[PATCH 1/3 v3] resource: fix an error which walks through iomem resources

2018-09-21 Thread Lianbo Jiang
A and B when we walk through the whole tree, but it only gets the resource A, the resource B is missed. Signed-off-by: Lianbo Jiang --- kernel/resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/resource.c b/kernel/resource.c index 30e1bc68503b..f5d9fc70a04c 100644 --- a/ke

[PATCH v7 RESEND 0/4] Support kdump for AMD secure memory encryption(SME)

2018-09-27 Thread Lianbo Jiang
1a9d000 trampoline_32bit: 0x00099000 Decompressing Linux... Parsing ELF...[---Here the system will hang] Lianbo Jiang (4): x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory kexec: allocate unencrypted control pages for kdump in case SME is

[PATCH v7 RESEND 1/4] x86/ioremap: add a function ioremap_encrypted() to remap kdump old memory

2018-09-27 Thread Lianbo Jiang
ke them an before. ioremap_encrypted()\ ioremap_cache() | ioremap_prot() | ioremap_wt()|->__ioremap_caller() ioremap_wc()| ioremap_uc() | ioremap_nocache() / Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- arch/x86/include/asm/io

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

2018-09-19 Thread Lianbo Jiang
ved ranges. Lianbo Jiang (3): resource: fix an error which walks through iomem resources x86/kexec_file: add e820 entry in case e820 type string matches to io resource name x86/kexec_file: add reserved e820 ranges to kdump kernel e820 table arch/x86/include/asm/e820/api.h | 2 ++ arch/

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

2018-09-19 Thread Lianbo Jiang
these ranges sit in e820 reserved ranges thus the early ioremap code naturally map them as unencrypted. So if we have same e820 reserve setup in kdump kernel then it will just work like normal kernel. Signed-off-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/kernel/crash.c | 5 + 1 file

[PATCH 1/3 v2] resource: fix an error which walks through iomem resources

2018-09-19 Thread Lianbo Jiang
A and B when we walk through the whole tree, but it only gets the resource A, the resource B is missed. Signed-off-by: Dave Young Signed-off-by: Lianbo Jiang --- kernel/resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/resource.c b/kernel/resource.c index 30e1bc68503b..f5d9

[PATCH 2/3 v2] x86/kexec_file: add e820 entry in case e820 type string matches to io resource name

2018-09-19 Thread Lianbo Jiang
() to match the e820 type and resource name. Signed-off-by: Dave Young Signed-off-by: Lianbo Jiang --- arch/x86/include/asm/e820/api.h | 2 ++ arch/x86/kernel/crash.c | 6 +- arch/x86/kernel/e820.c | 2 +- kernel/resource.c | 1 + 4 files changed, 9 insertions(+), 2

[PATCH v7 RESEND 2/4] kexec: allocate unencrypted control pages for kdump in case SME is enabled

2018-09-27 Thread Lianbo Jiang
When SME is enabled in the first kernel, we will allocate unencrypted pages for kdump in order to be able to boot the kdump kernel like kexec. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- kernel/kexec_core.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel

[PATCH v7 RESEND 4/4] kdump/vmcore: support encrypted old memory with SME enabled

2018-09-27 Thread Lianbo Jiang
the SME flag from the first kernel to the kdump kernel, it is really too expensive to do this. This patches are only for SME kdump, the patches don't support SEV kdump. Signed-off-by: Lianbo Jiang Reviewed-by: Tom Lendacky --- arch/x86/kernel/Makefile | 1 + arch/x86/kernel

[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 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] 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 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 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 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 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 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 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 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 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 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 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 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/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 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-

  1   2   >