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

2018-06-21 Thread lijiang
在 2018年06月21日 00:00, Tom Lendacky 写道: > On 6/16/2018 3:27 AM, Lianbo Jiang wrote: >> 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

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

2018-06-19 Thread lijiang
在 2018年06月19日 11:16, Dave Young 写道: > On 06/16/18 at 04:27pm, Lianbo Jiang wrote: >> 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

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

2018-06-20 Thread lijiang
在 2018年06月21日 09:21, Baoquan He 写道: > On 06/16/18 at 04:27pm, Lianbo Jiang wrote: >> It is convenient to remap the old memory encrypted to the second kernel by >> calling ioremap_encrypted(). >> >> When sme enabled on AMD server, we also need to support kdump. Because >> the memory is encrypted in

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

2018-06-20 Thread lijiang
在 2018年06月21日 09:53, Baoquan He 写道: > On 06/16/18 at 04:27pm, Lianbo Jiang wrote: >> 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

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

2018-06-19 Thread lijiang
在 2018年06月19日 22:46, lijiang 写道: > 在 2018年06月19日 11:16, Dave Young 写道: >> On 06/16/18 at 04:27pm, Lianbo Jiang wrote: >>> 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 >>&g

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

2018-07-02 Thread lijiang
在 2018年07月02日 18:14, Borislav Petkov 写道: > On Mon, Jul 02, 2018 at 03:26:35PM +0800, Lianbo Jiang wrote: >> @@ -131,7 +132,8 @@ static void __ioremap_check_mem(resource_size_t addr, >> unsigned long size, >> * caller shouldn't need to know that small detail. >> */ >> static void __iomem

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

2018-07-03 Thread lijiang
在 2018年07月03日 17:39, Borislav Petkov 写道: > On Tue, Jul 03, 2018 at 10:17:19AM +0800, lijiang wrote: >> for example, the elfcorehdr. In fact, the elfcorehdr and notes > > You mean this? > > ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos)

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

2018-07-03 Thread lijiang
在 2018年07月03日 19:14, Borislav Petkov 写道: > On Tue, Jul 03, 2018 at 06:58:14PM +0800, lijiang wrote: >> For kdump, the elf header finally use the crash kernel reserved memory, it >> is not an old memory. > > Lamme repeat my suggestion: > > So beef up the logic in __ior

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

2018-07-03 Thread lijiang
在 2018年07月03日 10:17, lijiang 写道: > 在 2018年07月02日 18:14, Borislav Petkov 写道: >> On Mon, Jul 02, 2018 at 03:26:35PM +0800, Lianbo Jiang wrote: >>> @@ -131,7 +132,8 @@ static void __ioremap_check_mem(resource_size_t addr, >>> unsigned long size, >>> * call

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

2018-06-21 Thread lijiang
在 2018年06月21日 16:39, Baoquan He 写道: > On 06/21/18 at 01:42pm, lijiang wrote: >> 在 2018年06月21日 00:42, Tom Lendacky 写道: >>> On 6/16/2018 3:27 AM, Lianbo Jiang wrote: >>>> In kdump mode, it will copy the device table of IOMMU from the old >>>> device tab

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

2018-06-21 Thread lijiang
在 2018年06月21日 18:23, Baoquan He 写道: > On 06/21/18 at 01:06pm, lijiang wrote: >> 在 2018年06月21日 09:53, Baoquan He 写道: >>> On 06/16/18 at 04:27pm, Lianbo Jiang wrote: >>>> When SME is enabled in the first kernel, we will allocate pages >>>> for kdump with

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

2018-08-15 Thread lijiang
在 2018年07月20日 18:08, Boris Petkov 写道: > On July 20, 2018 12:55:04 PM GMT+03:00, lijiang wrote:> >> Thanks for your advice, I will rewrite the log and send them again. > > Do not send them again - explain the problem properly first! > I have compared two solutions to handle

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

2018-07-20 Thread lijiang
在 2018年07月20日 15:32, Borislav Petkov 写道: > On Fri, Jul 20, 2018 at 01:23:04PM +0800, Dave Young wrote: >>> Here, it doesn't need to dump MMIO space of the previous kernel, when the >>> kdump kernel boot, the MMIO address will be remapped in decryption manners, >>> but the MMIO address don't belong

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

2018-07-19 Thread lijiang
在 2018年07月14日 01:08, Borislav Petkov 写道: > On Mon, Jul 09, 2018 at 09:55:35PM +0800, lijiang wrote: >> About this issue, i want to use an example to describe it. >> /* drivers/iommu/amd_iommu_init.c */ >> static u8 __iomem * __init iommu_map_mmio_space(u64 address, u64 end)

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

2018-09-05 Thread lijiang
在 2018年09月05日 14:46, Dave Young 写道: > [snip] >> >> As previously mentioned, there are also many differences between kexec and >> kdump. In general, >> kexec needs to look at all of available physical memory, but kdump doesn't >> need. >> >> For kexec, kexec-tools will read /sys/firmware/memmap

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

2018-09-05 Thread lijiang
在 2018年09月04日 09:51, Dave Young 写道: > On 09/04/18 at 09:29am, Dave Young wrote: >> On 09/04/18 at 08:44am, Dave Young wrote: >>> On 09/03/18 at 10:06pm, lijiang wrote: >>>> 在 2018年09月03日 10:45, Dave Young 写道: >>>>> On 08/31/18 at 04:19pm, Lianbo J

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

2018-07-09 Thread lijiang
在 2018年07月03日 19:44, lijiang 写道: > 在 2018年07月03日 19:14, Borislav Petkov 写道: >> On Tue, Jul 03, 2018 at 06:58:14PM +0800, lijiang wrote: >>> For kdump, the elf header finally use the crash kernel reserved memory, it >>> is not an old memory. >> >> Lamme

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

2018-07-09 Thread lijiang
在 2018年07月09日 17:29, Borislav Petkov 写道: > On Mon, Jul 09, 2018 at 02:28:11PM +0800, lijiang wrote: >> Last week, I had tried many ways to do this work, but it looks >> like that the ways of deducing address is not suitable to another >> scenarios, such as mapping some devi

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

2018-06-20 Thread lijiang
在 2018年06月21日 00:42, Tom Lendacky 写道: > On 6/16/2018 3:27 AM, Lianbo Jiang wrote: >> 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 >>

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

2018-09-03 Thread lijiang
在 2018年09月03日 10:45, Dave Young 写道: > On 08/31/18 at 04:19pm, Lianbo Jiang wrote: >> 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

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

2018-09-03 Thread lijiang
在 2018年09月04日 08:44, Dave Young 写道: > On 09/03/18 at 10:06pm, lijiang wrote: >> 在 2018年09月03日 10:45, Dave Young 写道: >>> On 08/31/18 at 04:19pm, Lianbo Jiang wrote: >>>> For kdump kernel, when SME is enabled, the acpi table and dmi table will >>>> n

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

2018-09-26 Thread lijiang
在 2018年09月25日 20:04, Joerg Roedel 写道: > On Fri, Sep 07, 2018 at 04:18:04PM +0800, Lianbo Jiang wrote: >> 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

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

2018-09-26 Thread lijiang
Also cc maintainer and other reviewer. Thanks. 在 2018年09月26日 13:52, lijiang 写道: > 在 2018年09月26日 03:10, Lendacky, Thomas 写道: >> On 09/07/2018 03:18 AM, Lianbo Jiang wrote: >>> When SME is enabled on AMD machine, we also need to support kdump. Because >>> the memory is en

Re: [PATCH v3 5/6] fs/core/vmcore: Move sev_active() reference to x86 arch code

2019-07-18 Thread lijiang
在 2019年07月19日 01:47, Lendacky, Thomas 写道: > On 7/17/19 10:28 PM, Thiago Jung Bauermann wrote: >> Secure Encrypted Virtualization is an x86-specific feature, so it shouldn't >> appear in generic kernel code because it forces non-x86 architectures to >> define the sev_active() function, which

Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-04 Thread lijiang
Hi, Also add Joerg to cc list. Thanks. Lianbo 在 2020年12月26日 13:39, Lianbo Jiang 写道: > Currently, because domain attach allows to be deferred from iommu > driver to device driver, and when iommu initializes, the devices > on the bus will be scanned and the default groups will be allocated. > >

Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-04 Thread lijiang
在 2021年01月05日 11:55, lijiang 写道: > Hi, > > Also add Joerg to cc list. > Also add more people to cc list, Jerry Snitselaar and Tom Lendacky. Thanks. > Thanks. > Lianbo > 在 2020年12月26日 13:39, Lianbo Jiang 写道: >> Currently, because domain attach allows to be de

Re: [PATCH 2/2 v2] iommu: use the __iommu_attach_device() directly for deferred attach

2021-01-21 Thread lijiang
Hi, Christoph 在 2021年01月19日 23:29, Christoph Hellwig 写道: >> +int iommu_do_deferred_attach(struct device *dev, >> + struct iommu_domain *domain) > > I'd remove the "do_" from the name, it doesn't really add any value. > OK. >> +{ >> +const struct iommu_ops *ops =

Re: [PATCH 1/2 v2] dma-iommu: use static-key to minimize the impact in the fast-path

2021-01-21 Thread lijiang
Hi, Christoph Thanks for the comment. 在 2021年01月19日 23:26, Christoph Hellwig 写道: > On Tue, Jan 19, 2021 at 07:16:15PM +0800, Lianbo Jiang wrote: >> +static DEFINE_STATIC_KEY_FALSE(__deferred_attach); > Why the strange underscores? Wouldn't iommu_deferred_attach_enabled The variable is defined

Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-18 Thread lijiang
在 2021年01月15日 23:15, Robin Murphy 写道: > On 2021-01-15 14:26, lijiang wrote: >> Hi, Robin >> >> Thank you for the comment. >> >> 在 2021年01月13日 01:29, Robin Murphy 写道: >>> On 2021-01-05 07:52, lijiang wrote: >>>> 在 2021年01月05日 11:55, lijia

Re: [PATCH] iommu: check for the deferred attach when attaching a device

2021-01-15 Thread lijiang
Hi, Robin Thank you for the comment. 在 2021年01月13日 01:29, Robin Murphy 写道: > On 2021-01-05 07:52, lijiang wrote: >> 在 2021年01月05日 11:55, lijiang 写道: >>> Hi, >>> >>> Also add Joerg to cc list. >>> >> >> Also add more people to