Re: [RFC v3 18/21] vfio-pci: Add a new VFIO_REGION_TYPE_NESTED region type

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:30 +0100 Eric Auger wrote: > This patch adds a new 64kB region aiming to report nested mode > translation faults. > > The region contains a header with the size of the queue, > the producer and consumer indices and then the actual > fault queue data. The producer is

Re: [RFC v3 06/21] vfio: VFIO_IOMMU_BIND_MSI

2019-01-11 Thread Alex Williamson
On Fri, 11 Jan 2019 16:02:44 -0700 Alex Williamson wrote: > On Tue, 8 Jan 2019 11:26:18 +0100 > Eric Auger wrote: > > > This patch adds the VFIO_IOMMU_BIND_MSI ioctl which aims at > > passing the guest MSI binding to the host. > > > > Signed-off-by: Eric Auger > > > > --- > > > > v2 ->

Re: [RFC v3 06/21] vfio: VFIO_IOMMU_BIND_MSI

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:18 +0100 Eric Auger wrote: > This patch adds the VFIO_IOMMU_BIND_MSI ioctl which aims at > passing the guest MSI binding to the host. > > Signed-off-by: Eric Auger > > --- > > v2 -> v3: > - adapt to new proto of bind_guest_msi > - directly use

Re: [RFC v3 04/21] vfio: VFIO_IOMMU_SET_PASID_TABLE

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:16 +0100 Eric Auger wrote: > From: "Liu, Yi L" > > This patch adds VFIO_IOMMU_SET_PASID_TABLE ioctl which aims at > passing the virtual iommu guest configuration to the VFIO driver > downto to the iommu subsystem. > > Signed-off-by: Jacob Pan > Signed-off-by: Liu,

Re: [RFC v3 03/21] iommu: Introduce bind_guest_msi

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:15 +0100 Eric Auger wrote: > On ARM, MSI are translated by the SMMU. An IOVA is allocated > for each MSI doorbell. If both the host and the guest are exposed > with SMMUs, we end up with 2 different IOVAs allocated by each. > guest allocates an IOVA (gIOVA) to map onto

Re: [RFC v3 02/21] iommu: Introduce cache_invalidate API

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:14 +0100 Eric Auger wrote: > From: "Liu, Yi L" > > In any virtualization use case, when the first translation stage > is "owned" by the guest OS, the host IOMMU driver has no knowledge > of caching structure updates unless the guest invalidation activities > are

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread Borislav Petkov
On Fri, Jan 11, 2019 at 06:09:28PM +, James Morse wrote: > We can return on ENOENT out earlier, as nothing needs doing in that case. Its > what the GHES_TO_CLEAR spaghetti is for, we can probably move the ack thing > into > ghes_clear_estatus(), that way that thing means 'I'm done with this

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread Borislav Petkov
On Fri, Jan 11, 2019 at 06:25:21PM +, James Morse wrote: > We ack it in the corrupt-record case too, because we are done with the > memory. Ok, so the only thing that we need to do unconditionally is ACK in order to free the memory. Or is there an exception to that set of steps in error

ESORICS 2019 - Call for Workshop Proposals [24th European Symposium on Research in Computer Security, Luxembourg, 2019]

2019-01-11 Thread Publicity Chair ESORICS 2019
[apologies for cross-posting] == CALL for WORKSHOP PROPOSALS: ESORICS 2019 24th European Symposium on Research in Computer Security University of Luxembourg, Luxembourg, September 23-27, 2019 Website:

Re: [RFC v3 01/21] iommu: Introduce set_pasid_table API

2019-01-11 Thread Alex Williamson
On Tue, 8 Jan 2019 11:26:13 +0100 Eric Auger wrote: > From: Jacob Pan > > In virtualization use case, when a guest is assigned > a PCI host device, protected by a virtual IOMMU on a guest, > the physical IOMMU must be programmed to be consistent with > the guest mappings. If the physical

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread James Morse
Hi Boris, On 11/01/2019 17:45, Borislav Petkov wrote: > On Fri, Jan 11, 2019 at 10:32:23AM -0500, Tyler Baicar wrote: >> The kernel would have no way of knowing what to do here. > > What do you mean, there's no way of knowing what to do? It needs to > clear registers so that the next error can

Re: [RFC v3 01/21] iommu: Introduce set_pasid_table API

2019-01-11 Thread Jean-Philippe Brucker
On 08/01/2019 10:26, Eric Auger wrote: > From: Jacob Pan > > In virtualization use case, when a guest is assigned > a PCI host device, protected by a virtual IOMMU on a guest, > the physical IOMMU must be programmed to be consistent with > the guest mappings. If the physical IOMMU supports two >

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread James Morse
Hi guys, On 11/01/2019 15:32, Tyler Baicar wrote: > On Fri, Jan 11, 2019 at 7:03 AM Borislav Petkov wrote: >> On Thu, Jan 10, 2019 at 04:01:27PM -0500, Tyler Baicar wrote: >>> On Thu, Jan 10, 2019 at 1:23 PM James Morse wrote: >> >> +if (is_hest_type_generic_v2(ghes) && >>

Re: [PATCH kvmtool v2 4/6] arm: Support firmware loading

2019-01-11 Thread Andre Przywara
On Thu, 10 Jan 2019 14:20:44 + Julien Thierry wrote: Hi, > Implement firmware image loading for arm and set the boot start > address to the firmware address. > > Add an option for the user to specify where to map the firmware. Many thanks for making this optional! > Signed-off-by: Julien

Re: [RFC v3 17/21] iommu/smmuv3: Report non recoverable faults

2019-01-11 Thread Jean-Philippe Brucker
On 08/01/2019 10:26, Eric Auger wrote: > When a stage 1 related fault event is read from the event queue, > let's propagate it to potential external fault listeners, ie. users > who registered a fault handler. > > Signed-off-by: Eric Auger > --- > drivers/iommu/arm-smmu-v3.c | 124

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread Borislav Petkov
On Fri, Jan 11, 2019 at 10:32:23AM -0500, Tyler Baicar wrote: > The kernel would have no way of knowing what to do here. What do you mean, there's no way of knowing what to do? It needs to clear registers so that the next error can get reported properly. Or of the status read failed and it

Re: [RFC v3 11/21] iommu/smmuv3: Implement cache_invalidate

2019-01-11 Thread Jean-Philippe Brucker
On 08/01/2019 10:26, Eric Auger wrote: > Implement IOMMU_INV_TYPE_TLB invalidations. When > nr_pages is null we interpret this as a context > invalidation. > > Signed-off-by: Eric Auger > > --- > > The user API needs to be refined to discriminate context > invalidations from NH_VA

Re: [RFC v3 09/21] iommu/smmuv3: Get prepared for nested stage support

2019-01-11 Thread Jean-Philippe Brucker
Hi Eric, On 08/01/2019 10:26, Eric Auger wrote: > To allow nested stage support, we need to store both > stage 1 and stage 2 configurations (and remove the former > union). > > arm_smmu_write_strtab_ent() is modified to write both stage > fields in the STE. > > We add a nested_bypass field to

Re: [PATCH v6 0/7] Add virtio-iommu driver

2019-01-11 Thread Jean-Philippe Brucker
On 11/01/2019 12:28, Joerg Roedel wrote: > Hi Jean-Philippe, > > On Thu, Dec 13, 2018 at 12:50:29PM +, Jean-Philippe Brucker wrote: >> We already do deferred flush: UNMAP requests are added to the queue by >> iommu_unmap(), and then flushed out by iotlb_sync(). So we switch to the >> host

Re: [PATCH v6 0/7] Add virtio-iommu driver

2019-01-11 Thread Joerg Roedel
Hi Jean-Philippe, On Thu, Dec 13, 2018 at 12:50:29PM +, Jean-Philippe Brucker wrote: > We already do deferred flush: UNMAP requests are added to the queue by > iommu_unmap(), and then flushed out by iotlb_sync(). So we switch to the > host only on iotlb_sync(), or when the request queue is

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread Borislav Petkov
On Thu, Jan 10, 2019 at 04:01:27PM -0500, Tyler Baicar wrote: > On Thu, Jan 10, 2019 at 1:23 PM James Morse wrote: > > >> > > >> +if (is_hest_type_generic_v2(ghes) && > > >> ghes_ack_error(ghes->generic_v2)) > > > > > > Since ghes_ack_error() is always prepended with this check, you could >

Re: [PATCH v7 09/25] ACPI / APEI: Generalise the estatus queue's notify code

2019-01-11 Thread Borislav Petkov
On Thu, Jan 10, 2019 at 06:21:21PM +, James Morse wrote: > Something like: > ghes_notify_nmi() -> in_nmi_spool_from_list(list) -> > in_nmi_queue_one_entry(ghes). Yah, but make that ghes_notify_nmi() -> ghes_nmi_spool_from_list(list) -> ghes_nmi_queue_one_entry(ghes). to denote it is the

(ghes|hest)_disable

2019-01-11 Thread Borislav Petkov
Ok, lemme split this out into a separate thread and add Tony. On Thu, Jan 10, 2019 at 06:20:35PM +, James Morse wrote: > > Grrr, what an effing mess that code is! There's hest_disable *and* > > ghes_disable. Do we really need them both? > > ghes_disable lets you ignore the firmware-first

Re: [RFC v3 14/21] iommu: introduce device fault data

2019-01-11 Thread Jean-Philippe Brucker
On 10/01/2019 18:45, Jacob Pan wrote: > On Tue, 8 Jan 2019 11:26:26 +0100 > Eric Auger wrote: > >> From: Jacob Pan >> >> Device faults detected by IOMMU can be reported outside IOMMU >> subsystem for further processing. This patch intends to provide >> a generic device fault data such that

Re: [PATCH v7 10/25] ACPI / APEI: Tell firmware the estatus queue consumed the records

2019-01-11 Thread Tyler Baicar
On Thu, Jan 10, 2019 at 1:23 PM James Morse wrote: > >> > >> +if (is_hest_type_generic_v2(ghes) && ghes_ack_error(ghes->generic_v2)) > > > > Since ghes_ack_error() is always prepended with this check, you could > > push it down into the function: > > > > ghes_ack_error(ghes) > > ... > > > >