Re: [PATCH -next v3 1/2] platform-msi: Save the msg context to desc in platform_msi_write_msg()

2021-09-14 Thread Greg KH
On Sat, Aug 28, 2021 at 02:39:14PM +0800, Bixuan Cui wrote: > Save the msg context to desc when the msi interrupt is requested. > The drivers can use it in special scenarios(such as resume). > > Signed-off-by: Bixuan Cui > --- > drivers/base/platform-msi.c | 3 +++ > 1 file changed, 3

Re: AMD-Vi: [Firmware Warn]: EFR mismatch. Use IVHD EFR (0xf77ef22294ada : 0x400f77ef22294ada).

2021-09-14 Thread Paul Menzel
[Cc: +Dell Linux kernel client team] Dear Linux folks, Am 12.04.21 um 20:07 schrieb Paul Menzel: On the Dell OptiPlex 5055, Linux warns about an EFR mismatch in the firmware. ``` […] [    0.00] DMI: Dell Inc. OptiPlex 5055 Ryzen CPU/0P03DX, BIOS 1.1.20 05/31/2019 […] [    1.479774]

Re: AMD-Vi: [Firmware Warn]: EFR mismatch. Use IVHD EFR (0xf77ef22294ada : 0x400f77ef22294ada).

2021-09-14 Thread Jörg Rödel
On Tue, Sep 14, 2021 at 11:10:57AM +0200, Paul Menzel wrote: > Linux 5.15-rc1 still warns about that (also with latest system firmware > 1.1.50). The reason is most likely that the latest firmware still reports a different EFR feature set in the IVRS table than the IOMMU reports in its EFR MMIO

[PATCH V5 00/12] x86/Hyper-V: Add Hyper-V Isolation VM support

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Hyper-V provides two kinds of Isolation VMs. VBS(Virtualization-based security) and AMD SEV-SNP unenlightened Isolation VMs. This patchset is to add support for these Isolation VM support in Linux. The memory of these vms are encrypted and host can't access guest memory

[PATCH V5 01/12] x86/hyperv: Initialize GHCB page in Isolation VM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Hyperv exposes GHCB page via SEV ES GHCB MSR for SNP guest to communicate with hypervisor. Map GHCB page for all cpus to read/write MSR register and submit hvcall request via ghcb page. Signed-off-by: Tianyu Lan --- Change since v4: * Fix typo comment Chagne since v3:

[PATCH V5 02/12] x86/hyperv: Initialize shared memory boundary in the Isolation VM.

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Hyper-V exposes shared memory boundary via cpuid HYPERV_CPUID_ISOLATION_CONFIG and store it in the shared_gpa_boundary of ms_hyperv struct. This prepares to share memory with host for SNP guest. Signed-off-by: Tianyu Lan --- Change since v4: * Rename reserve field.

[PATCH V5 07/12] Drivers: hv: vmbus: Add SNP support for VMbus channel initiate message

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan The monitor pages in the CHANNELMSG_INITIATE_CONTACT msg are shared with host in Isolation VM and so it's necessary to use hvcall to set them visible to host. In Isolation VM with AMD SEV SNP, the access address should be in the extra space which is above shared gpa boundary. So

[PATCH V5 08/12] Drivers: hv : vmbus: Initialize VMbus ring buffer for Isolation VM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan VMbus ring buffer are shared with host and it's need to be accessed via extra address space of Isolation VM with AMD SNP support. This patch is to map the ring buffer address in extra address space via vmap_pfn(). Hyperv set memory host visibility hvcall smears data in the ring

[PATCH V5 09/12] x86/Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan In Isolation VM with AMD SEV, bounce buffer needs to be accessed via extra address space which is above shared_gpa_boundary (E.G 39 bit address line) reported by Hyper-V CPUID ISOLATION_CONFIG. The access physical address will be original physical address + shared_gpa_boundary.

[PATCH V5 03/12] x86/hyperv: Add new hvcall guest address host visibility support

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Add new hvcall guest address host visibility support to mark memory visible to host. Call it inside set_memory_decrypted /encrypted(). Add HYPERVISOR feature check in the hv_is_isolation_supported() to optimize in non-virtualization environment. Acked-by: Dave Hansen

[PATCH V5 04/12] Drivers: hv: vmbus: Mark vmbus ring buffer visible to host in Isolation VM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Mark vmbus ring buffer visible with set_memory_decrypted() when establish gpadl handle. Signed-off-by: Tianyu Lan --- Change sincv v4 * Change gpadl handle in netvsc and uio driver from u32 to struct vmbus_gpadl. * Change vmbus_establish_gpadl()'s

[PATCH V5 05/12] x86/hyperv: Add Write/Read MSR registers via ghcb page

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan Hyperv provides GHCB protocol to write Synthetic Interrupt Controller MSR registers in Isolation VM with AMD SEV SNP and these registers are emulated by hypervisor directly. Hyperv requires to write SINTx MSR registers twice. First writes MSR via GHCB page to communicate with

[PATCH V5 06/12] x86/hyperv: Add ghcb hvcall support for SNP VM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan hyperv provides ghcb hvcall to handle VMBus HVCALL_SIGNAL_EVENT and HVCALL_POST_MESSAGE msg in SNP Isolation VM. Add such support. Signed-off-by: Tianyu Lan --- Change since v3: * Add hv_ghcb_hypercall() stub function to avoid compile error for ARM. ---

[PATCH V5 10/12] hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan hyperv Isolation VM requires bounce buffer support to copy data from/to encrypted memory and so enable swiotlb force mode to use swiotlb bounce buffer for DMA transaction. In Isolation VM with AMD SEV, the bounce buffer needs to be accessed via extra address space which is

[PATCH V5 11/12] scsi: storvsc: Add Isolation VM support for storvsc driver

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for storvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ mpb_desc() still needs to be handled. Use DMA API(scsi_dma_map/unmap) to

[PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver

2021-09-14 Thread Tianyu Lan
From: Tianyu Lan In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ pagebuffer() stills need to be handled. Use DMA API to map/umap these memory

Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has()

2021-09-14 Thread Borislav Petkov
On Wed, Sep 08, 2021 at 05:58:35PM -0500, Tom Lendacky wrote: > Introduce a powerpc version of the cc_platform_has() function. This will > be used to replace the powerpc mem_encrypt_active() implementation, so > the implementation will initially only support the CC_ATTR_MEM_ENCRYPT > attribute. >

[PATCH v4 06/13] memory: mtk-smi: Add error handle for smi_probe

2021-09-14 Thread Yong Wu
Add error handle while component_add fail. Signed-off-by: Yong Wu Reviewed-by: Ikjoon Jang --- drivers/memory/mtk-smi.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 33b6c5efe102..b362d528944e 100644 ---

[PATCH v4 03/13] memory: mtk-smi: Use clk_bulk clock ops

2021-09-14 Thread Yong Wu
Use clk_bulk interface instead of the orginal one to simplify the code. For SMI larbs: Require apb/smi clocks while gals is optional. For SMI common: Require apb/smi/gals0/gal1 in has_gals case. Otherwise, also only require apb/smi, No optional clk here. About the "has_gals"

[PATCH v4 05/13] memory: mtk-smi: Adjust some code position

2021-09-14 Thread Yong Wu
No functional change. Only move the code position to make the code more readable. 1. Put the register smi-common above smi-larb. Prepare to add some others register setting. 2. Put mtk_smi_larb_unbind around larb_bind. 3. Sort the SoC data alphabetically. and put them in one line as the

[PATCH v4 01/13] dt-bindings: memory: mediatek: Add mt8195 smi binding

2021-09-14 Thread Yong Wu
Add mt8195 smi supporting in the bindings. In mt8195, there are two smi-common HW, one is for vdo(video output), the other is for vpp(video processing pipe). They connect with different smi-larbs, then some setting(bus_sel) is different. Differentiate them with the compatible string. Something

[PATCH v4 04/13] memory: mtk-smi: Rename smi_gen to smi_type

2021-09-14 Thread Yong Wu
Prepare for adding smi sub common. Only rename from smi_gen to smi_type. No functional change. About the current "smi_gen", we have gen1/gen2 that stand for the generation number for HW. I plan to add a new type(sub_common), then the name "gen" is not proper. Signed-off-by: Yong Wu Reviewed-by:

[PATCH v4 02/13] dt-bindings: memory: mediatek: Add mt8195 smi sub common

2021-09-14 Thread Yong Wu
Add the binding for smi-sub-common. The SMI block diagram like this: IOMMU | | smi-common -- | | larb0 larb7 <-max is 8 The smi-common connects with smi-larb and IOMMU. The maximum larbs number that connects with a

[PATCH v4 12/13] memory: mtk-smi: mt8195: Add initial setting for smi-larb

2021-09-14 Thread Yong Wu
To improve the performance, We add some initial setting for smi larbs. there are two part: 1), Each port has the special ostd(outstanding) value in each larb. 2), Two general settings for each larb. a. THRT_UPDATE: the value in bits[7:4] of 0x24 is not so good. The HW default is 4, and we

[PATCH v4 07/13] memory: mtk-smi: Add device link for smi-sub-common

2021-09-14 Thread Yong Wu
In mt8195, there are some larbs connect with the smi-sub-common, then connect with smi-common. Before we create device link between smi-larb with smi-common. If we have sub-common, we should use device link the smi-larb and smi-sub-common, then use device link between the smi-sub-common with

[PATCH v4 08/13] memory: mtk-smi: Add clocks for smi-sub-common

2021-09-14 Thread Yong Wu
SMI sub common only have one output port. thus it has only one gals clocks(gals0). then, smi-sub-common require the three clocks(apb/smi/gals0) in has_gals case. Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[PATCH v4 10/13] memory: mtk-smi: mt8195: Add smi support

2021-09-14 Thread Yong Wu
MT8195 has two smi-common, their IP are the same. Only the larbs that connect with the smi-common are different. thus the bus_sel are different for the two smi-common. Signed-off-by: Yong Wu Reviewed-by: Ikjoon Jang --- drivers/memory/mtk-smi.c | 26 ++ 1 file changed,

[PATCH v4 11/13] memory: mtk-smi: mt8195: Add initial setting for smi-common

2021-09-14 Thread Yong Wu
To improve the performance, add initial setting for smi-common. some register use some fix setting(suggested from DE). Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 42 1 file changed, 38 insertions(+), 4 deletions(-) diff --git

[PATCH v4 09/13] memory: mtk-smi: Use devm_platform_ioremap_resource

2021-09-14 Thread Yong Wu
No functional change. Simplify probing code. Signed-off-by: Yong Wu Reviewed-by: Ikjoon Jang --- drivers/memory/mtk-smi.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 58d9f7667490..a001e41f5074 100644

[PATCH v4 13/13] MAINTAINERS: Add entry for MediaTek SMI

2021-09-14 Thread Yong Wu
I am the author of MediaTek SMI driver, and will to maintain and develop it further. Add myself to cover these items. Signed-off-by: Yong Wu --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index eeb4c70b3d5b..52b956fedfbc 100644 ---

Re: [PATCH v6 6/6] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-09-14 Thread Dmitry Osipenko
14.09.2021 04:38, Nicolin Chen пишет: > +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned int > pt_index) > +{ > + return ((dma_addr_t)pd_index & (SMMU_NUM_PDE - 1)) << SMMU_PDE_SHIFT | > +((dma_addr_t)pt_index & (SMMU_NUM_PTE - 1)) << SMMU_PTE_SHIFT; > +} We

[PATCH v4 00/13] MT8195 SMI support

2021-09-14 Thread Yong Wu
This patchset mainly adds SMI support for mt8195. Comparing with the previous version, add two new functions: a) add smi sub common b) add initial setting for smi-common and smi-larb. Change note: v4:1) base on v5.15-rc1 2) In the dt-binding: a. add "else mediatek,smi: false." in the

Re: DPAA2 triggers, [PATCH] dma debug: report -EEXIST errors in add_dma_entry

2021-09-14 Thread Ioana Ciornei
On Wed, Sep 08, 2021 at 10:33:26PM -0500, Jeremy Linton wrote: > +DPAA2, netdev maintainers > Hi, > > On 5/18/21 7:54 AM, Hamza Mahfooz wrote: > > Since, overlapping mappings are not supported by the DMA API we should > > report an error if active_cacheline_insert returns -EEXIST. > > It seems

Re: [PATCH V4 00/13] x86/Hyper-V: Add Hyper-V Isolation VM support

2021-09-14 Thread Tianyu Lan
Hi Michael and Christoph: I just sent out V5 patchset. I use alloc_pages() to allocate rx/tx ring buffer in Isolation VM and use vmap() to map rx/tx buffer first because the vmbus_establish_gpadl() still needs to va of low end memory to initialize gpadl buffer. After calling

Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has()

2021-09-14 Thread Christophe Leroy
Le 14/09/2021 à 13:58, Borislav Petkov a écrit : On Wed, Sep 08, 2021 at 05:58:35PM -0500, Tom Lendacky wrote: Introduce a powerpc version of the cc_platform_has() function. This will be used to replace the powerpc mem_encrypt_active() implementation, so the implementation will initially only

Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has()

2021-09-14 Thread Borislav Petkov
On Tue, Sep 14, 2021 at 04:47:41PM +0200, Christophe Leroy wrote: > Yes, see > https://lore.kernel.org/linuxppc-dev/20210914123919.58203...@canb.auug.org.au/T/#t Aha, more compiler magic stuff ;-\ Oh well, I guess that fix will land upstream soon. Thx. -- Regards/Gruss, Boris.

[PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-14 Thread Roman Skakun
From: Roman Skakun It is possible when default IO TLB size is not enough to fit a long buffers as described here [1]. This patch makes a way to set this parameter using cmdline instead of recompiling a kernel. [1] https://www.xilinx.com/support/answers/72694.html Signed-off-by: Roman Skakun

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-14 Thread Christoph Hellwig
On Tue, Sep 14, 2021 at 05:29:07PM +0200, Jan Beulich wrote: > I'm not convinced the swiotlb use describe there falls under "intended > use" - mapping a 1280x720 framebuffer in a single chunk? (As an aside, > the bottom of this page is also confusing, as following "Then we can > confirm the

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-14 Thread Jan Beulich via iommu
On 14.09.2021 17:10, Roman Skakun wrote: > From: Roman Skakun > > It is possible when default IO TLB size is not > enough to fit a long buffers as described here [1]. > > This patch makes a way to set this parameter > using cmdline instead of recompiling a kernel. > > [1]

Re: [PATCH v6 6/6] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-09-14 Thread Nicolin Chen
On Tue, Sep 14, 2021 at 04:29:15PM +0300, Dmitry Osipenko wrote: > 14.09.2021 04:38, Nicolin Chen пишет: > > +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned int > > pt_index) > > +{ > > + return ((dma_addr_t)pd_index & (SMMU_NUM_PDE - 1)) << SMMU_PDE_SHIFT | > > +

Re: AMD-Vi: [Firmware Warn]: EFR mismatch. Use IVHD EFR (0xf77ef22294ada : 0x400f77ef22294ada).

2021-09-14 Thread Paul Menzel
[Use Mario’s current address] Am 15.09.21 um 00:15 schrieb Paul Menzel: [Cc: +Mario from AMD] Dear Jörg, Am 14.09.21 um 14:09 schrieb Jörg Rödel: On Tue, Sep 14, 2021 at 11:10:57AM +0200, Paul Menzel wrote: Linux 5.15-rc1 still warns about that (also with latest system firmware 1.1.50).

Re: AMD-Vi: [Firmware Warn]: EFR mismatch. Use IVHD EFR (0xf77ef22294ada : 0x400f77ef22294ada).

2021-09-14 Thread Paul Menzel
[Cc: +Mario from AMD] Dear Jörg, Am 14.09.21 um 14:09 schrieb Jörg Rödel: On Tue, Sep 14, 2021 at 11:10:57AM +0200, Paul Menzel wrote: Linux 5.15-rc1 still warns about that (also with latest system firmware 1.1.50). The reason is most likely that the latest firmware still reports a

Re: [PATCH] swiotlb: set IO TLB segment size via cmdline

2021-09-14 Thread Stefano Stabellini
On Tue, 14 Sep 2021, Christoph Hellwig wrote: > On Tue, Sep 14, 2021 at 05:29:07PM +0200, Jan Beulich wrote: > > I'm not convinced the swiotlb use describe there falls under "intended > > use" - mapping a 1280x720 framebuffer in a single chunk? (As an aside, > > the bottom of this page is also

Re: [PATCH v3 4/8] powerpc/pseries/svm: Add a powerpc version of cc_platform_has()

2021-09-14 Thread Michael Ellerman
Borislav Petkov writes: > On Wed, Sep 08, 2021 at 05:58:35PM -0500, Tom Lendacky wrote: >> Introduce a powerpc version of the cc_platform_has() function. This will >> be used to replace the powerpc mem_encrypt_active() implementation, so >> the implementation will initially only support the

RE: [PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver

2021-09-14 Thread Haiyang Zhang via iommu
> -Original Message- > From: Tianyu Lan > Sent: Tuesday, September 14, 2021 9:39 AM > To: KY Srinivasan ; Haiyang Zhang > ; Stephen Hemminger ; > wei@kernel.org; Dexuan Cui ; t...@linutronix.de; > mi...@redhat.com; b...@alien8.de; x...@kernel.org; h...@zytor.com; >

Re: [PATCH v6 6/6] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-09-14 Thread Dmitry Osipenko
14.09.2021 21:49, Nicolin Chen пишет: > On Tue, Sep 14, 2021 at 04:29:15PM +0300, Dmitry Osipenko wrote: >> 14.09.2021 04:38, Nicolin Chen пишет: >>> +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned int >>> pt_index) >>> +{ >>> + return ((dma_addr_t)pd_index &

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-14 Thread Borislav Petkov
On Wed, Sep 08, 2021 at 05:58:36PM -0500, Tom Lendacky wrote: > diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c > index 18fe19916bc3..4b54a2377821 100644 > --- a/arch/x86/mm/mem_encrypt.c > +++ b/arch/x86/mm/mem_encrypt.c > @@ -144,7 +144,7 @@ void __init sme_unmap_bootdata(char

Re: [PATCH v6 6/6] iommu/tegra-smmu: Add pagetable mappings to debugfs

2021-09-14 Thread Nicolin Chen
On Tue, Sep 14, 2021 at 10:20:30PM +0300, Dmitry Osipenko wrote: > 14.09.2021 21:49, Nicolin Chen пишет: > > On Tue, Sep 14, 2021 at 04:29:15PM +0300, Dmitry Osipenko wrote: > >> 14.09.2021 04:38, Nicolin Chen пишет: > >>> +static unsigned long pd_pt_index_iova(unsigned int pd_index, unsigned >