RE: [PATCH v8 10/10] iommu/vt-d: Add iotlb flush for nested domain

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > > > +static void nested_flush_pasid_iotlb(struct intel_iommu *iommu, > + struct dmar_domain *domain, u64 addr, > + unsigned long npages, bool ih) > +{ > + u16 di

RE: [PATCH v8 09/10] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-12-27 Thread Tian, Kevin
> From: Tian, Kevin > Sent: Thursday, December 28, 2023 2:38 PM > > > From: Liu, Yi L > > Sent: Thursday, December 28, 2023 12:14 AM > > +/** > > + * struct iommu_hwpt_vtd_s1_invalidate - Intel VT-d cache invalidation > > + * > > (IOMMU_HWPT_INVALIDATE_DATA_

RE: [PATCH v8 09/10] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > +/** > + * struct iommu_hwpt_vtd_s1_invalidate - Intel VT-d cache invalidation > + * (IOMMU_HWPT_INVALIDATE_DATA_VTD_S1) > + * @addr: The start address of the range to be invalidated. It needs to

RE: [PATCH v8 08/10] iommu/vt-d: Convert stage-1 cache invalidation to return QI fault

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > > From: Lu Baolu > > This makes the pasid based cache invalidation and device TLB invalidation > to return QI faults to callers. This is needed when usersapce invalidates > cache after modifying the stage-1 page table used in nest

RE: [PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > > @@ -1376,6 +1383,8 @@ int qi_submit_sync(struct intel_iommu *iommu, > struct qi_desc *desc, > > restart: > rc = 0; > + if (fault) > + *fault = 0; move it to right before the loop of qi_check_fault() > >

RE: [PATCH v8 06/10] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > > + /* Negative test: trigger error */ > + num_inv = 1; > + inv_reqs[0].flags = > IOMMU_TEST_INVALIDATE_FLAG_TRIGGER_ERROR; > + inv_reqs[0].iotlb_id = 0; > + test_cmd_hwpt_

RE: [PATCH v8 02/10] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 28, 2023 12:14 AM > > In nested translation, the stage-1 page table is user-managed but cached > by the IOMMU hardware, so an update on present page table entries in the > stage-1 page table should be followed with a cache invalidation. > > Add an IOM

RE: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Wednesday, December 27, 2023 10:13 PM > > On 2023/12/27 17:33, Ethan Zhao wrote: > > > > On 12/27/2023 5:06 PM, Duan, Zhenzhong wrote: > >> > >>> -Original Message- > >>> From: Liu, Yi L > >>> Sent: Tuesday, December 26, 2023 4:44 PM > >>> Subject: Re: [PATCH v7

Re: [PATCH v8 00/10] Add iommufd nesting (part 2/2)

2023-12-27 Thread Yi Liu
On 2023/12/28 04:58, Nicolin Chen wrote: On Wed, Dec 27, 2023 at 08:13:44AM -0800, Yi Liu wrote: [2] https://github.com/yiliu1765/iommufd/tree/iommufd_nesting This branch is still pointing to v7's iommufd_nesting-12212023-yi. Likely you should update it to v8's iommufd_nesting-12272023-yi :

RE: [PATCH V12 4/7] cpufreq: Add a notification message that the highest perf has changed

2023-12-27 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Raphael: > -Original Message- > From: Rafael J. Wysocki > Sent: Thursday, December 28, 2023 1:04 AM > To: Meng, Li (Jassmine) > Cc: Rafael J. Wysocki ; Rafael J . Wysocki > ; Huang, Ray ; linux- > p...@vger.kernel.org; linux-ker...@vger.kernel.org; x

Re: [PATCH v8 00/10] Add iommufd nesting (part 2/2)

2023-12-27 Thread Nicolin Chen
On Wed, Dec 27, 2023 at 08:13:44AM -0800, Yi Liu wrote: > [2] https://github.com/yiliu1765/iommufd/tree/iommufd_nesting This branch is still pointing to v7's iommufd_nesting-12212023-yi. Likely you should update it to v8's iommufd_nesting-12272023-yi :) Thanks Nic

Re: [PATCH v8 19/24] ima: Move to LSM infrastructure

2023-12-27 Thread Casey Schaufler
On 12/27/2023 11:52 AM, Mimi Zohar wrote: > On Tue, 2023-12-26 at 12:14 -0800, Casey Schaufler wrote: >> On 12/26/2023 10:14 AM, Mimi Zohar wrote: >>> On Thu, 2023-12-14 at 18:08 +0100, Roberto Sassu wrote: From: Roberto Sassu Move hardcoded IMA function calls (not appraisal-specifi

Re: [PATCH v8 19/24] ima: Move to LSM infrastructure

2023-12-27 Thread Mimi Zohar
On Tue, 2023-12-26 at 12:14 -0800, Casey Schaufler wrote: > On 12/26/2023 10:14 AM, Mimi Zohar wrote: > > On Thu, 2023-12-14 at 18:08 +0100, Roberto Sassu wrote: > >> From: Roberto Sassu > >> > >> Move hardcoded IMA function calls (not appraisal-specific functions) from > >> various places in the

Re: [PATCH v8 23/24] ima: Make it independent from 'integrity' LSM

2023-12-27 Thread Mimi Zohar
On Wed, 2023-12-27 at 17:39 +0100, Roberto Sassu wrote: > On 12/27/2023 2:22 PM, Mimi Zohar wrote: > > On Thu, 2023-12-14 at 18:08 +0100, Roberto Sassu wrote: > >> From: Roberto Sassu > >> > >> Make the 'ima' LSM independent from the 'integrity' LSM by introducing IMA > >> own integrity metadata (

Re: [PATCH V12 4/7] cpufreq: Add a notification message that the highest perf has changed

2023-12-27 Thread Rafael J. Wysocki
On Wed, Dec 27, 2023 at 2:40 AM Meng, Li (Jassmine) wrote: > > [AMD Official Use Only - General] > > Hi Rafael: > > > -Original Message- > > From: Meng, Li (Jassmine) > > Sent: Tuesday, December 26, 2023 4:27 PM > > To: Rafael J. Wysocki > > Cc: Rafael J . Wysocki ; Huang, Ray > > ; linux

Re: [PATCH v8 23/24] ima: Make it independent from 'integrity' LSM

2023-12-27 Thread Roberto Sassu
On 12/27/2023 2:22 PM, Mimi Zohar wrote: On Thu, 2023-12-14 at 18:08 +0100, Roberto Sassu wrote: From: Roberto Sassu Make the 'ima' LSM independent from the 'integrity' LSM by introducing IMA own integrity metadata (ima_iint_cache structure, with IMA-specific fields from the integrity_iint_cac

[PATCH v8 10/10] iommu/vt-d: Add iotlb flush for nested domain

2023-12-27 Thread Yi Liu
From: Lu Baolu This implements the .cache_invalidate_user() callback to support iotlb flush for nested domain. Signed-off-by: Lu Baolu Co-developed-by: Yi Liu Signed-off-by: Yi Liu --- drivers/iommu/intel/nested.c | 118 +++ 1 file changed, 118 insertions(+)

[PATCH v8 09/10] iommufd: Add data structure for Intel VT-d stage-1 cache invalidation

2023-12-27 Thread Yi Liu
This adds the data structure invalidating caches for the nested domain allocated with IOMMU_HWPT_DATA_VTD_S1 type. Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- include/uapi/linux/iommufd.h | 55 1 file changed, 55 insertions(+) diff --git a/include/uap

[PATCH v8 08/10] iommu/vt-d: Convert stage-1 cache invalidation to return QI fault

2023-12-27 Thread Yi Liu
From: Lu Baolu This makes the pasid based cache invalidation and device TLB invalidation to return QI faults to callers. This is needed when usersapce invalidates cache after modifying the stage-1 page table used in nested translation. Hardware errors during invalidation should be reported to use

[PATCH v8 07/10] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Yi Liu
From: Lu Baolu This allows qi_submit_sync() to return back faults to callers. Signed-off-by: Lu Baolu Signed-off-by: Yi Liu --- drivers/iommu/intel/dmar.c | 31 +++-- drivers/iommu/intel/iommu.h | 2 +- drivers/iommu/intel/irq_remapping.c | 2 +- dri

[PATCH v8 06/10] iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl

2023-12-27 Thread Yi Liu
From: Nicolin Chen Add test cases for the IOMMU_HWPT_INVALIDATE ioctl and verify it by using the new IOMMU_TEST_OP_MD_CHECK_IOTLB. Reviewed-by: Kevin Tian Signed-off-by: Nicolin Chen Co-developed-by: Yi Liu Signed-off-by: Yi Liu --- tools/testing/selftests/iommu/iommufd.c | 175 ++

[PATCH v8 05/10] iommufd/selftest: Add IOMMU_TEST_OP_MD_CHECK_IOTLB test op

2023-12-27 Thread Yi Liu
From: Nicolin Chen Allow to test whether IOTLB has been invalidated or not. Reviewed-by: Kevin Tian Signed-off-by: Nicolin Chen Signed-off-by: Yi Liu --- drivers/iommu/iommufd/iommufd_test.h | 5 drivers/iommu/iommufd/selftest.c | 26 +++ tools/tes

[PATCH v8 04/10] iommufd/selftest: Add mock_domain_cache_invalidate_user support

2023-12-27 Thread Yi Liu
From: Nicolin Chen Add mock_domain_cache_invalidate_user() data structure to support user space selftest program to cover user cache invalidation pathway. Reviewed-by: Kevin Tian Signed-off-by: Nicolin Chen Co-developed-by: Yi Liu Signed-off-by: Yi Liu --- drivers/iommu/iommufd/iommufd_test

[PATCH v8 03/10] iommu: Add iommu_copy_struct_from_user_array helper

2023-12-27 Thread Yi Liu
From: Nicolin Chen Wrap up the data pointer/num sanity and __iommu_copy_struct_from_user call for iommu drivers to copy driver specific data at a specific location in the struct iommu_user_data_array, and iommu_respond_struct_to_user_array() to copy response to a specific location in the struct i

[PATCH v8 02/10] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-27 Thread Yi Liu
In nested translation, the stage-1 page table is user-managed but cached by the IOMMU hardware, so an update on present page table entries in the stage-1 page table should be followed with a cache invalidation. Add an IOMMU_HWPT_INVALIDATE ioctl to support such a cache invalidation. It takes hwpt_

[PATCH v8 01/10] iommu: Add cache_invalidate_user op

2023-12-27 Thread Yi Liu
From: Lu Baolu The updates of the PTEs in the nested page table will be propagated to the hardware caches. Add a new domain op cache_invalidate_user for the userspace to flush the hardware caches for a nested domain through iommufd. No wrapper for it, as it's only supposed to be used by iommufd.

[PATCH v8 00/10] Add iommufd nesting (part 2/2)

2023-12-27 Thread Yi Liu
Nested translation is a hardware feature that is supported by many modern IOMMU hardwares. It has two stages (stage-1, stage-2) address translation to get access to the physical address. stage-1 translation table is owned by userspace (e.g. by a guest OS), while stage-2 is owned by kernel. Changes

Re: [PATCH v7 9/9] iommu/vt-d: Add iotlb flush for nested domain

2023-12-27 Thread Yi Liu
On 2023/12/27 17:27, Duan, Zhenzhong wrote: -Original Message- From: Liu, Yi L Subject: [PATCH v7 9/9] iommu/vt-d: Add iotlb flush for nested domain From: Lu Baolu This implements the .cache_invalidate_user() callback to support iotlb flush for nested domain. Signed-off-by: Lu Bao

Re: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Yi Liu
On 2023/12/27 17:33, Ethan Zhao wrote: On 12/27/2023 5:06 PM, Duan, Zhenzhong wrote: -Original Message- From: Liu, Yi L Sent: Tuesday, December 26, 2023 4:44 PM Subject: Re: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults On 2023/12/26 14:15, Yi Liu wrote:

Re: [PATCH v8 23/24] ima: Make it independent from 'integrity' LSM

2023-12-27 Thread Mimi Zohar
On Thu, 2023-12-14 at 18:08 +0100, Roberto Sassu wrote: > From: Roberto Sassu > > Make the 'ima' LSM independent from the 'integrity' LSM by introducing IMA > own integrity metadata (ima_iint_cache structure, with IMA-specific fields > from the integrity_iint_cache structure), and by managing it

[RFC PATCH v3 3/3] kselftest: devices: Add sample board file for XPS 13 9300

2023-12-27 Thread Nícolas F . R . A . Prado
Add a sample board file describing the file's format and with the list of devices expected to be probed on the XPS 13 9300 machine as an example x86 platform. Test output: TAP version 13 Using board file: boards/Dell Inc.,XPS 13 9300.yaml 1..22 ok 1 /pci-controller/14.0/usb2-controller/9/camera.d

[RFC PATCH v3 2/3] kselftest: devices: Add sample board file for google,spherion

2023-12-27 Thread Nícolas F . R . A . Prado
Add a sample board file describing the file's format and with the list of devices expected to be probed on the google,spherion machine as an example. Test output: TAP version 13 Using board file: boards/google,spherion.yaml 1..8 ok 1 /usb2-controller@1120/1.4.1/camera.device ok 2 /usb2-contro

[RFC PATCH v3 1/3] kselftest: Add test to verify probe of devices from discoverable busses

2023-12-27 Thread Nícolas F . R . A . Prado
Add a new test to verify that a list of expected devices from discoverable busses (ie USB, PCI) have been successfully instantiated and probed by a driver. The per-platform list of expected devices is selected from the ones under the boards/ directory based on the DT compatible or the DMI IDs. Si

[RFC PATCH v3 0/3] Add test to verify probe of devices from discoverable busses

2023-12-27 Thread Nícolas F . R . A . Prado
Hi, for this v3 I changed the approach for identifying devices in a stable way from the match fields back to the hardware topology (used in v1). The match fields were proposed as a way to avoid the possible issue of PCI topology being reconfigured, but that wasn't observed on any real system so

Re: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Ethan Zhao
On 12/27/2023 5:06 PM, Duan, Zhenzhong wrote: -Original Message- From: Liu, Yi L Sent: Tuesday, December 26, 2023 4:44 PM Subject: Re: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults On 2023/12/26 14:15, Yi Liu wrote: On 2023/12/26 12:13, Tian, Kevin wrot

RE: [PATCH v7 9/9] iommu/vt-d: Add iotlb flush for nested domain

2023-12-27 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Subject: [PATCH v7 9/9] iommu/vt-d: Add iotlb flush for nested domain > >From: Lu Baolu > >This implements the .cache_invalidate_user() callback to support iotlb >flush for nested domain. > >Signed-off-by: Lu Baolu >Co-developed-by: Yi Liu >Signe

RE: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return the QI faults

2023-12-27 Thread Duan, Zhenzhong
>-Original Message- >From: Liu, Yi L >Sent: Tuesday, December 26, 2023 4:44 PM >Subject: Re: [PATCH v7 7/9] iommu/vt-d: Allow qi_submit_sync() to return >the QI faults > >On 2023/12/26 14:15, Yi Liu wrote: >> >> >> On 2023/12/26 12:13, Tian, Kevin wrote: From: Liu, Yi L Sent: