Hi,
Just adding Michael in Cc:
Thanks
>cmd
On 30/05/2024 14:24, CLEMENT MATHIEU--DRIF wrote:
> This series belongs to a list of series that add SVM support for VT-d.
>
> Here we focus on the implementation of PRI support in the IOMMU and on a
> PCI-level
> API for PRI to
On 03/06/2024 08:10, Zhenzhong Duan wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> From: Yi Liu
>
> Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU.
> In set call, a
From: Clément Mathieu--Drif
The 'level' field in vtd_iotlb_key is an unsigned integer.
We don't need to store level as an int in vtd_lookup_iotlb.
VTDIOTLBPageInvInfo.mask is used in binary operations with addresses.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2
From: Clément Mathieu--Drif
As the SVM-capable devices will need to cache translations, we provide
an first implementation.
This cache uses a two-level design based on hash tables.
The first level is indexed by a PASID and the second by a virtual addresse.
Signed-off-by: Clément Mathieu--Drif
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c| 24 ++--
include/hw/pci/pci_device.h | 1 +
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index c8a8aab306..51feede3cf 100644
From: Clément Mathieu--Drif
This series belongs to a list of series that add SVM support for VT-d.
As a starting point, we use the series called 'intel_iommu: Enable stage-1
translation' (rfc2) by Zhenzhong Duan and Yi Liu.
Here we focus on the implementation of ATS support in the IOMMU and
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 6a68df0154..d607562de2 100644
--- a/hw/i386/intel_iommu.c
+++
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 13 ++---
include/hw/i386/intel_iommu.h | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2 +-
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 7b0c22fc07..fb6c7d1e33 100644
---
From: Clément Mathieu--Drif
Devices implementing ATS can send translation requests using
pci_ats_request_translation_pasid.
The invalidation events are sent back to the device using the iommu
notifier managed with pci_register_iommu_tlb_event_notifier and
pci_unregister_iommu_tlb_event_notifier
From: Clément Mathieu--Drif
This will be useful for devices that support ATS
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 359bca2ae2..56ef48780f 100644
---
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
tests/unit/meson.build | 1 +
tests/unit/test-atc.c | 527 +
2 files changed, 528 insertions(+)
create mode 100644 tests/unit/test-atc.c
diff --git a/tests/unit/meson.build
From: Clément Mathieu--Drif
ats_enabled and pasid_enabled check whether the capabilities are
present or not. If so, we read the configuration space to get
the status of the feature (enabled or not).
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 18 ++
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index d607562de2..0f3bd5978e 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 24 +++
include/hw/pci/pcie.h | 6 +-
include/hw/pci/pcie_regs.h| 3 +++
include/standard-headers/linux/pci_regs.h | 1
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 75 --
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
From: Clément Mathieu--Drif
We add a convenient way to initialize an device-iotlb notifier.
This is meant to be used by ATS-capable devices.
pci_device_iommu_memory_region_pasid is introduces in this commit and
will be used in several other SVM-related functions exposed in
the PCI API.
From: Clément Mathieu--Drif
This will be necessary for devices implementing ATS.
We also define a new macro IOMMU_ACCESS_FLAG_FULL in addition to
IOMMU_ACCESS_FLAG to support more access flags.
IOMMU_ACCESS_FLAG is kept for convenience and backward compatibility.
Here are the flags added
From: Clément Mathieu--Drif
We use this information in vtd_do_iommu_translate to populate the
IOMMUTLBEntry and indicate the correct page mask. This prevents ATS
devices from sending many useless translation requests when a megapage
or gigapage iova is not mapped to a physical address.
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
Reviewed-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 772b1cea88..7b0c22fc07 100644
--- a/hw/i386/intel_iommu.c
+++
From: Clément Mathieu--Drif
Implements the behavior defined in section 10.2.3.5 of PCIe spec rev 5.
This is needed by devices that support ATS.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
From: Clément Mathieu--Drif
This will help developers of svm devices to track a state
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 0067b2266a..359bca2ae2 100644
---
From: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c | 19 +++
include/hw/pci/pci.h | 34 ++
2 files changed, 53 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 51feede3cf..3fe47d4002 100644
---
From: Clément Mathieu--Drif
IOMMU have to implement iommu_ats_request_translation to support ATS.
Devices can use IOMMU_TLB_ENTRY_TRANSLATION_ERROR to check the tlb
entries returned by a translation request.
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 26
From: Clément Mathieu--Drif
The constant must be unsigned, otherwise the two's complement
overrides the other fields when a PASID is present
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
On 02/06/2024 16:10, Michael S. Tsirkin wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> On Mon, Apr 22, 2024 at 03:52:52PM +, CLEMENT MATHIEU--DRIF wrote:
The API deliberately designed to be similar to the ATS one.
We define a struct that stores a function pointer to the device's callback.
Registering and unregistering a notifier is done using a pair of functions
that will be added in a future commit of this series.
An IOMMU can support PRI by
This series belongs to a list of series that add SVM support for VT-d.
Here we focus on the implementation of PRI support in the IOMMU and on a
PCI-level
API for PRI to be used by virtual devices.
This work is based on the VT-d specification version 4.1 (March 2023).
Here is a link to a GitHub
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu_internal.h | 52 +-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h
index 461158f588..9e01251335 100644
---
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 67 +++
1 file changed, 67 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 2e78ebe6d2..899655928d 100644
--- a/hw/i386/intel_iommu.c
+++
Implement the iommu_pri_request_page IOMMU operation
and the behavior when receiving a page group response descriptor
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 235 +
hw/i386/intel_iommu_internal.h | 2 +
2 files changed, 237
A device can send a PRI request to the IOMMU using pci_pri_request_page_pasid.
The PRI response is sent back using the notifier managed with
pci_pri_register_notifier and pci_pri_unregister_notifier.
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c | 37
the pri configuration offset is also stored into the PCIExpressDevice
to make it easier to get the PRI status register
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 25 +
include/hw/pci/pcie.h | 5 -
include/hw/pci/pcie_regs.h | 4
pri_enabled can be used to check whether the capability is present and
enabled on a PCIe device
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 9 +
include/hw/pci/pcie.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 8
include/hw/pci/pcie.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 3fb6588c31..d11b11fc34 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -1227,6 +1227,14 @@ void
On 27/05/2024 05:16, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> Hi Clement,
>
>> -Original Message-
>> From: CLEMENT MATHIEU-
Hi Zhenzhong,
I already sent you my comments about this patch earlier (question about
checking pgtt) but here is a style review
On 22/05/2024 08:23, Zhenzhong Duan wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you
Hi Zhenzhong
On 22/05/2024 08:23, Zhenzhong Duan wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> According to spec, Page-Selective-within-Domain Invalidation (11b):
>
> 1. IOTLB
Hi Zhenzhong
On 22/05/2024 08:23, Zhenzhong Duan wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> According to VTD spec, stage-1 page table could support 4-level and
> 5-level paging.
>
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c | 19 +++
include/hw/pci/pci.h | 34 ++
2 files changed, 53 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 51feede3cf..3fe47d4002 100644
--- a/hw/pci/pci.c
+++
Signed-off-by: Clément Mathieu--Drif
Reviewed-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index a2b275016c..f71c04d370 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@
Implements the behavior defined in section 10.2.3.5 of PCIe spec rev 5.
This is needed by devices that support ATS.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/i386/intel_iommu.c
The 'level' field in vtd_iotlb_key is an uint8_t.
We don't need to store level as an int in vtd_lookup_iotlb (avoids a
'loosing precision' warning).
VTDIOTLBPageInvInfo.mask is used in binary operations with addresses.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2
We use this information in vtd_do_iommu_translate to populate the
IOMMUTLBEntry and indicate the correct page mask. This prevents ATS
devices from sending many useless translation requests when a megapage
or gigapage iova is not mapped to a physical address.
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
tests/unit/meson.build | 1 +
tests/unit/test-atc.c | 527 +
2 files changed, 528 insertions(+)
create mode 100644 tests/unit/test-atc.c
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c| 24 ++--
include/hw/pci/pci_device.h | 1 +
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index c8a8aab306..51feede3cf 100644
--- a/hw/pci/pci.c
+++
We add a convenient way to initialize an device-iotlb notifier.
This is meant to be used by ATS-capable devices.
pci_device_iommu_memory_region_pasid is introduces in this commit and
will be used in several other SVM-related functions exposed in
the PCI API.
Signed-off-by: Clément Mathieu--Drif
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index a42938aacd..f08c3e8f00 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2187,6 +2187,9 @@ static bool
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 75 --
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 496bed9447..2e78ebe6d2
As the SVM-capable devices will need to cache translations, we provide
an first implementation.
This cache uses a two-level design based on hash tables.
The first level is indexed by a PASID and the second by a virtual addresse.
Signed-off-by: Clément Mathieu--Drif
---
util/atc.c | 211
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2 +-
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index f71c04d370..7d86a31bea 100644
--- a/hw/i386/intel_iommu.c
+++
Devices implementing ATS can send translation requests using
pci_ats_request_translation_pasid.
The invalidation events are sent back to the device using the iommu
notifier managed with pci_register_iommu_tlb_event_notifier and
pci_unregister_iommu_tlb_event_notifier
Signed-off-by: Clément
This will be useful for devices that support ATS
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 359bca2ae2..56ef48780f 100644
--- a/include/exec/memory.h
+++
The constant must be unsigned, otherwise the two's complement
overrides the other fields when a PASID is present
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu_internal.h
This will help developers of svm devices to track a state
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 0067b2266a..359bca2ae2 100644
--- a/include/exec/memory.h
+++
This series belongs to a list of series that add SVM support for VT-d.
As a starting point, we use the series called 'intel_iommu: Enable stage-1
translation for passthrough device' by Zhenzhong Duan and Yi Liu.
Here we focus on the implementation of ATS support in the IOMMU and on a
PCI-level
ats_enabled and pasid_enabled check whether the capabilities are
present or not. If so, we read the configuration space to get
the status of the feature (enabled or not).
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 18 ++
include/hw/pci/pcie.h | 3 +++
2
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index e83985f2f7..a42938aacd 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -5975,9 +5975,24 @@
This will be necessary for devices implementing ATS.
We also define a new macro IOMMU_ACCESS_FLAG_FULL in addition to
IOMMU_ACCESS_FLAG to support more access flags.
IOMMU_ACCESS_FLAG is kept for convenience and backward compatibility.
Here are the flags added (defined by the PCIe 5
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 24 +++
include/hw/pci/pcie.h | 6 +-
include/hw/pci/pcie_regs.h| 3 +++
include/standard-headers/linux/pci_regs.h | 1 +
4 files changed, 33
IOMMU have to implement iommu_ats_request_translation to support ATS.
Devices can use IOMMU_TLB_ENTRY_TRANSLATION_ERROR to check the tlb
entries returned by a translation request.
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 26 ++
system/memory.c
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 13 ++---
include/hw/i386/intel_iommu.h | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 7d86a31bea..e83985f2f7 100644
---
On 21/05/2024 05:11, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
>> -Original Message-
>> From: CLEMENT MATHIEU--DRIF
>> Subjec
> From: CLEMENT MATHIEU--DRIF
> Sent: Friday, May 17, 2024 9:13 PM
>
> Hi Zhenzhong
>
> On 17/05/2024 12:23, Zhenzhong Duan wrote:
> > Caution: External email. Do not open attachments or click links, unless
> > this email
> comes from a known sender
Hi Zhenzhong
On 17/05/2024 12:23, Zhenzhong Duan wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> From: Yu Zhang
>
> Currently we use only VTD_FR_PASID_TABLE_INV as fault reason.
>
On 17/05/2024 12:44, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
>> -Original Message-
>> From: CLEMENT MATHIEU--DRIF
>> Su
On 17/05/2024 12:40, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
>> -Original Message-
>> From: CLEMENT MATHIEU--DRIF
>> Su
Hi,
On 16/05/2024 08:41, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
>> -Original Message-
>> From: CLEMENT MATHIEU--DRIF
>>
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c | 19 +++
include/hw/pci/pci.h | 34 ++
2 files changed, 53 insertions(+)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index e5f72f9f1d..2b42b4e4cc 100644
--- a/hw/pci/pci.c
+++
Devices implementing ATS can send translation requests using
pci_ats_request_translation_pasid.
The invalidation events are sent back to the device using the iommu
notifier managed with pci_register_iommu_tlb_event_notifier and
pci_unregister_iommu_tlb_event_notifier
Signed-off-by: Clément
This will be necessary for devices implementing ATS.
We also define a new macro IOMMU_ACCESS_FLAG_FULL in addition to
IOMMU_ACCESS_FLAG to support more access flags.
IOMMU_ACCESS_FLAG is kept for convenience and backward compatibility.
Here are the flags added (defined by the PCIe 5
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pci.c| 24 ++--
include/hw/pci/pci_device.h | 1 +
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 045d69f4c1..e5f72f9f1d 100644
--- a/hw/pci/pci.c
+++
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2 +-
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 373f3d254a..3bb4d385a8 100644
--- a/hw/i386/intel_iommu.c
+++
This piece of code can be shared by both IOTLB invalidation and
PASID-based IOTLB invalidation
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 57 +--
1 file changed, 33 insertions(+), 24 deletions(-)
ats_enabled and pasid_enabled check whether the capabilities are
present or not. If so, we read the configuration space to get
the status of the feature (enabled or not).
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 18 ++
include/hw/pci/pcie.h | 3 +++
2
First stage translation must fail if the address to translate is
not canonical.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 21 +
hw/i386/intel_iommu_internal.h | 2 ++
2 files changed, 23 insertions(+)
diff --git a/hw/i386/intel_iommu.c
IOMMU have to implement iommu_ats_request_translation to support ATS.
Devices can use IOMMU_TLB_ENTRY_TRANSLATION_ERROR to check the tlb
entries returned by a translation request.
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 26 ++
system/memory.c
Signed-off-by: Clément Mathieu--Drif
Reviewed-by: Zhenzhong Duan
---
hw/i386/intel_iommu.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index dbdf13470d..373f3d254a 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 15 +++
1 file changed, 15 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index e48b169cda..53f17d66c0 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -5997,9 +5997,24 @@
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 75 --
hw/i386/intel_iommu_internal.h | 1 +
2 files changed, 73 insertions(+), 3 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 67b9ff4934..7421a99373
Implements the behavior defined in section 10.2.3.5 of PCIe spec rev 5.
This is needed by devices that support ATS.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/i386/intel_iommu.c
As the SVM-capable devices will need to cache translations, we provide
an first implementation.
This cache uses a two-level design based on hash tables.
The first level is indexed by a PASID and the second by a virtual addresse.
Signed-off-by: Clément Mathieu--Drif
---
tests/unit/meson.build |
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 42 ++
hw/i386/intel_iommu_internal.h | 10
2 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index
The constant must be unsigned, otherwise the two's complement
overrides the other fields when a PASID is present
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/intel_iommu_internal.h
This will be useful for devices that support ATS
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 2c0e964c07..198b71e9af 100644
--- a/include/exec/memory.h
+++
We add a convenient way to initialize an device-iotlb notifier.
This is meant to be used by ATS-capable devices.
pci_device_iommu_memory_region_pasid is introduces in this commit and
will be used in several other SVM-related functions exposed in
the PCI API.
Signed-off-by: Clément Mathieu--Drif
This series belongs to a list of series that add SVM support for VT-d.
As a starting point, we use the series called 'intel_iommu: Enable stage-1
translation' (rfc2) by Zhenzhong Duan and Yi Liu.
Here we focus on the implementation of ATS support in the IOMMU and on a
PCI-level
API for ATS to
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 25 +
hw/i386/intel_iommu_internal.h | 3 +++
2 files changed, 28 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 0ecf00f37a..252364893b 100644
---
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 13 ++---
include/hw/i386/intel_iommu.h | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index fd4710ba28..e48b169cda 100644
---
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 53f17d66c0..c4ebd4569e 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2299,6 +2299,7 @@ out:
This will be used to implement the device IOTLB invalidation
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 39 ---
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index
The 'level' field in vtd_iotlb_key is an uint8_t.
We don't need to store level as an int in vtd_lookup_iotlb (avoids a
'loosing precision' warning).
VTDIOTLBPageInvInfo.mask is used in binary operations with addresses.
Signed-off-by: Clément Mathieu--Drif
---
hw/i386/intel_iommu.c | 2
Signed-off-by: Clément Mathieu--Drif
---
hw/pci/pcie.c | 24 +++
include/hw/pci/pcie.h | 6 +-
include/hw/pci/pcie_regs.h| 3 +++
include/standard-headers/linux/pci_regs.h | 1 +
4 files changed, 33
We use this information in vtd_do_iommu_translate to populate the
IOMMUTLBEntry and indicate the correct page mask. This prevents ATS
devices from sending many useless translation requests when a megapage
or gigapage iova is not mapped to a physical address.
Signed-off-by: Clément Mathieu--Drif
Hi zhenzhong,
On 14/05/2024 09:34, Duan, Zhenzhong wrote:
> Caution: External email. Do not open attachments or click links, unless this
> email comes from a known sender and you know the content is safe.
>
>
> Hi Clement,
>
>> -Original Message-
>&g
ts this week.
>
> Thanks
> Zhenzhong
>
>> -----Original Message-
>> From: CLEMENT MATHIEU--DRIF
>> Subject: Re: [PATCH intel_iommu 0/7] FLTS for VT-d
>>
>> Hi Zhenzhong
>>
>> Have you had time to review the ATS series rebased on you FLTS
t is safe.
>
>
> Hi Clement,
>
> Sorry for late response, just back from vacation.
> I saw your rebased version and thanks for your work.
> I'll schedule a timeslot to review them.
>
> Thanks
> Zhenzhong
>
>> -----Original Message-
>> From: CLEMENT MATHI
Hi Zhenzhong,
On 07/05/2024 11:20, Zhenzhong Duan wrote:
Caution: External email. Do not open attachments or click links, unless this
email comes from a known sender and you know the content is safe.
If check fails, host device (either VFIO or VDPA device) is not
compatible with current
Devices implementing ATS can send translation requests using
pci_ats_request_translation_pasid.
The invalidation events are sent back to the device using the iommu
notifier managed with pci_register_iommu_tlb_event_notifier and
pci_unregister_iommu_tlb_event_notifier
Signed-off-by: Clément
This will be useful for devices that support ATS
Signed-off-by: Clément Mathieu--Drif
---
include/exec/memory.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 304504de02..f4b33415d7 100644
--- a/include/exec/memory.h
+++
1 - 100 of 135 matches
Mail list logo