Re: [RFC PATCH v4 26/28] x86: Allow kexec to be used with SME

2017-03-08 Thread Dave Young
On 03/06/17 at 11:58am, Tom Lendacky wrote: > On 3/1/2017 3:25 AM, Dave Young wrote: > > Hi Tom, > > Hi Dave, > > > > > On 02/17/17 at 10:43am, Tom Lendacky wrote: > > > On 2/17/2017 9:57 AM, Konrad Rzeszutek Wilk wrote: > > > > On Thu, Feb 16, 2017 at 09:47:55AM -0600, Tom Lendacky wrote: > > >

Re: iommu/rockchip: Fix bugs and enable on ARM64

2017-03-08 Thread Caesar Wang
Shunqian, something is depending on these patches, can you resend these patches to solve the compile errors? -Caesar 在 2016年07月16日 00:16, Joerg Roedel 写道: On Fri, Jul 15, 2016 at 05:32:02PM +0200, Matthias Brugger wrote: The drm rockchip patches are dependent on iommu/rockchip patches, can yo

Re: [PATCH v7 01/07] iommu/ipmmu-vmsa: Remove platform data handling

2017-03-08 Thread Geert Uytterhoeven
On Tue, Mar 7, 2017 at 4:16 AM, Magnus Damm wrote: > From: Magnus Damm > > The IPMMU driver is using DT these days, and platform data is no longer > used by the driver. Remove unused code. > > Signed-off-by: Magnus Damm > Reviewed-by: Laurent Pinchart > Reviewed-by: Joerg Roedel Reviewed-by:

Re: [PATCH v7 04/07] iommu/ipmmu-vmsa: Break out domain allocation code

2017-03-08 Thread Geert Uytterhoeven
On Tue, Mar 7, 2017 at 4:17 AM, Magnus Damm wrote: > From: Magnus Damm > > Break out the domain allocation code into a separate function. > This is preparation for future code sharing. > > Signed-off-by: Magnus Damm > Reviewed-by: Joerg Roedel Reviewed-by: Geert Uytterhoeven Gr{oetje,eeting}

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-08 Thread Geert Uytterhoeven
Hi Magnus, On Tue, Mar 7, 2017 at 4:17 AM, Magnus Damm wrote: > From: Magnus Damm > > Not all architectures have an iommu member in their archdata, so > use #ifdefs support build with COMPILE_TEST on any architecture. to support > Signed-off-by: Magnus Damm > Reviewed-by: Joerg Roedel Revie

[PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-03-08 Thread Magnus Damm
From: Magnus Damm Introduce struct ipmmu_features to track various hardware and software implementation changes inside the driver for different kinds of IPMMU hardware. Add use_ns_alias_offset as a first example of a feature to control if the secure register bank offset should be used or not. Si

[PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-03-08 Thread Magnus Damm
From: Magnus Damm Add root device handling to the IPMMU driver by allowing certain DT compat strings to enable has_cache_leaf_nodes that in turn will support both root devices with interrupts and leaf devices that face the actual IPMMU consumer devices. Signed-off-by: Magnus Damm --- Changes

[PATCH v3 00/09] iommu/ipmmu-vmsa: r8a7795 support V3

2017-03-08 Thread Magnus Damm
iommu/ipmmu-vmsa: r8a7795 support V3 [PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias [PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature [PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support [PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DE

[PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Magnus Damm
From: Magnus Damm Add support for up to 8 contexts. Each context is mapped to one domain. One domain is assigned one or more slave devices. Contexts are allocated dynamically and slave devices are grouped together based on which IPMMU device they are connected to. This makes slave devices tied to

[PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-03-08 Thread Magnus Damm
From: Magnus Damm Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA is enabled. The only current supported case for 32-bit ARM is disabled, however for 64-bit ARM usage of OF is required. Signed-off-by: Magnus Damm --- Changes since V2: - Reworked registration code to make use of r

[PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Magnus Damm
From: Magnus Damm Write IMCTR both in the root device and the leaf node. Signed-off-by: Magnus Damm --- Changes since V2: - None Changes since V1: - None drivers/iommu/ipmmu-vmsa.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) --- 0018/drivers/iommu/ipmmu-v

[PATCH v3 05/09] iommu/ipmmu-vmsa: IPMMU device is 40-bit bus master

2017-03-08 Thread Magnus Damm
From: Magnus Damm The r8a7795 IPMMU supports 40-bit bus mastering. Both the coherent DMA mask and the streaming DMA mask are set to unlock the 40-bit address space for coherent allocations and streaming operations. Signed-off-by: Magnus Damm --- Changes since V2: - Updated the code and commi

[PATCH v3 07/09] iommu/ipmmu-vmsa: Make IMBUSCTR setup optional

2017-03-08 Thread Magnus Damm
From: Magnus Damm Introduce a feature to allow opt-out of setting up IMBUSCR. The default case is unchanged. Signed-off-by: Magnus Damm --- Changes since V2: - None Changes since V1: - Updated the commit message - Reworked patch to coexist with the multi context feature drivers/iommu/i

[PATCH v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-03-08 Thread Magnus Damm
From: Magnus Damm Tie in r8a7795 features and update the IOMMU_OF_DECLARE compat string to include the updated compat string. TODO: - Consider making use of iommu_fwspec_add_ids() for uTLB handling Needed to coexist with non-OF R-Car Gen2 somehow... - Break out stuff useful for R-Car Gen2

[PATCH v3 08/09] iommu/ipmmu-vmsa: Allow two bit SL0

2017-03-08 Thread Magnus Damm
From: Magnus Damm Introduce support for two bit SL0 bitfield in IMTTBCR by using a separate feature flag. Signed-off-by: Magnus Damm --- Changes since V2: - None Changes since V1: - None drivers/iommu/ipmmu-vmsa.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-)

Re: [PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-03-08 Thread Robin Murphy
Hi Magnus, On 08/03/17 11:01, Magnus Damm wrote: > From: Magnus Damm > > Introduce struct ipmmu_features to track various hardware > and software implementation changes inside the driver for > different kinds of IPMMU hardware. Add use_ns_alias_offset > as a first example of a feature to control

Re: [PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Robin Murphy
On 08/03/17 11:01, Magnus Damm wrote: > From: Magnus Damm > > Add support for up to 8 contexts. Each context is mapped to one > domain. One domain is assigned one or more slave devices. Contexts > are allocated dynamically and slave devices are grouped together > based on which IPMMU device they

Re: [PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Robin Murphy
On 08/03/17 11:02, Magnus Damm wrote: > From: Magnus Damm > > Write IMCTR both in the root device and the leaf node. > > Signed-off-by: Magnus Damm > --- > > Changes since V2: > - None > > Changes since V1: > - None > > drivers/iommu/ipmmu-vmsa.c | 17 ++--- > 1 file chang

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-08 Thread Robin Murphy
On 07/03/17 03:17, Magnus Damm wrote: > From: Magnus Damm > > Not all architectures have an iommu member in their archdata, so > use #ifdefs support build with COMPILE_TEST on any architecture. I have a feeling I might be repeating myself, but ipmmu_vmsa_archdata looks to be trivially convertibl

Re: [PATCH v7 05/07] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2017-03-08 Thread Robin Murphy
On 07/03/17 03:17, Magnus Damm wrote: > From: Magnus Damm > > Introduce an alternative set of iommu_ops suitable for 64-bit ARM > as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. Also adjust the > Kconfig to depend on ARM or IOMMU_DMA. Initialize the device > from ->xlate() when CONFIG_IOMMU_DMA=y.

Re: [PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-03-08 Thread Geert Uytterhoeven
Hi Magnus, On Wed, Mar 8, 2017 at 12:01 PM, Magnus Damm wrote: > From: Magnus Damm > > Add root device handling to the IPMMU driver by allowing certain > DT compat strings to enable has_cache_leaf_nodes that in turn will > support both root devices with interrupts and leaf devices that > face th

Re: [PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-03-08 Thread Geert Uytterhoeven
Hi Magnus, On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm wrote: > From: Magnus Damm > > Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA > is enabled. The only current supported case for 32-bit ARM > is disabled, however for 64-bit ARM usage of OF is required. > > Signed-off-by: Magnus

Re: [PATCH v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-03-08 Thread Geert Uytterhoeven
Hi Magnus, On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm wrote: > From: Magnus Damm > > Tie in r8a7795 features and update the IOMMU_OF_DECLARE > compat string to include the updated compat string. > > TODO: > - Consider making use of iommu_fwspec_add_ids() for uTLB handling > Needed to coe

Re: [RFC PATCH v4 28/28] x86: Add support to make use of Secure Memory Encryption

2017-03-08 Thread Borislav Petkov
On Tue, Mar 07, 2017 at 10:05:00AM -0600, Tom Lendacky wrote: > > And then you need to correct the function signature in the > > !CONFIG_AMD_MEM_ENCRYPT case, at the end of this file, too: > > > > unsigned long __init sme_enable(struct boot_params *bp) { > > return 0; } > > Yup, miss

Re: [PATCH] iommu/arm-smmu: Report smmu type in dmesg

2017-03-08 Thread Aleksey Makarov
On 03/06/2017 02:58 PM, Robert Richter wrote: The ARM SMMU detection especially depends from system firmware. For better diagnostic, log the detected type in dmesg. The smmu type's name is now stored in struct arm_smmu_type and ACPI code is modified to use that struct too. Rename ARM_SMMU_MATC

Re: [RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-03-08 Thread Sinan Kaya
On 2/27/2017 2:54 PM, Jean-Philippe Brucker wrote: > + ats_enabled = !arm_smmu_enable_ats(master); > + You should make ats_supported field in IORT table part of the decision process for when to enable ATS. -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Tech

Re: Partial BAR Address Allocation

2017-03-08 Thread Sinan Kaya
On 3/6/2017 6:04 AM, Joerg Roedel wrote: > On Wed, Feb 22, 2017 at 05:39:44PM -0600, Bjorn Helgaas wrote: >> [+cc Joerg, iommu list] >> >> On Wed, Feb 22, 2017 at 03:44:53PM -0500, Sinan Kaya wrote: >>> On 2/22/2017 1:44 PM, Bjorn Helgaas wrote: There is no way for a driver to say "I only need

Re: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-03-08 Thread Jean-Philippe Brucker
Hello, On 03/02/17 15:48, Sricharan R wrote: > From: Robin Murphy > > In preparation for some upcoming cleverness, rework the control flow in > of_iommu_configure() to minimise duplication and improve the propogation > of errors. It's also as good a time as any to switch over from the > now-just

Re: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-03-08 Thread Robin Murphy
On 08/03/17 18:58, Jean-Philippe Brucker wrote: [...] >> static const struct iommu_ops >> -*of_pci_iommu_configure(struct pci_dev *pdev, struct device_node *bridge_np) >> +*of_pci_iommu_init(struct pci_dev *pdev, struct device_node *bridge_np) >> { >> const struct iommu_ops *ops; >> str

Re: [PATCH v7 06/07] iommu/ipmmu-vmsa: ARM and ARM64 archdata access

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 9:48 PM, Robin Murphy wrote: > On 07/03/17 03:17, Magnus Damm wrote: >> From: Magnus Damm >> >> Not all architectures have an iommu member in their archdata, so >> use #ifdefs support build with COMPILE_TEST on any architecture. > > I have a feeling I might be re

Re: [PATCH v3 04/09] iommu/ipmmu-vmsa: Make use of IOMMU_OF_DECLARE()

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:52 PM, Geert Uytterhoeven wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm wrote: >> From: Magnus Damm >> >> Hook up IOMMU_OF_DECLARE() support in case CONFIG_IOMMU_DMA >> is enabled. The only current supported case for 32-bit ARM >> is di

Re: [PATCH v3 06/09] iommu/ipmmu-vmsa: Write IMCTR twice

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 9:34 PM, Robin Murphy wrote: > On 08/03/17 11:02, Magnus Damm wrote: >> From: Magnus Damm >> >> Write IMCTR both in the root device and the leaf node. >> >> Signed-off-by: Magnus Damm >> --- >> >> Changes since V2: >> - None >> >> Changes since V1: >> - None

Re: [PATCH v3 01/09] iommu/ipmmu-vmsa: Introduce features, break out alias

2017-03-08 Thread Magnus Damm
Hi Robin, On Wed, Mar 8, 2017 at 8:53 PM, Robin Murphy wrote: > Hi Magnus, > > On 08/03/17 11:01, Magnus Damm wrote: >> From: Magnus Damm >> >> Introduce struct ipmmu_features to track various hardware >> and software implementation changes inside the driver for >> different kinds of IPMMU hardw

Re: [PATCH v3 03/09] iommu/ipmmu-vmsa: Enable multi context support

2017-03-08 Thread Magnus Damm
Hi Robin, Thanks for your feedback! On Wed, Mar 8, 2017 at 9:21 PM, Robin Murphy wrote: > On 08/03/17 11:01, Magnus Damm wrote: >> From: Magnus Damm >> >> Add support for up to 8 contexts. Each context is mapped to one >> domain. One domain is assigned one or more slave devices. Contexts >> are

Re: [PATCH v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:58 PM, Geert Uytterhoeven wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm wrote: >> From: Magnus Damm >> >> Tie in r8a7795 features and update the IOMMU_OF_DECLARE >> compat string to include the updated compat string. >> >> TODO: >> - C

Re: [PATCH v3 02/09] iommu/ipmmu-vmsa: Add optional root device feature

2017-03-08 Thread Magnus Damm
Hi Geert, On Wed, Mar 8, 2017 at 10:47 PM, Geert Uytterhoeven wrote: > Hi Magnus, > > On Wed, Mar 8, 2017 at 12:01 PM, Magnus Damm wrote: >> From: Magnus Damm >> >> Add root device handling to the IPMMU driver by allowing certain >> DT compat strings to enable has_cache_leaf_nodes that in turn