Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

2024-09-13 Thread Yi Liu
On 2024/9/12 23:11, Matthew Wilcox wrote: On Thu, Sep 12, 2024 at 06:17:26AM -0700, Yi Liu wrote: There is no helpers for user to check if a given ID is allocated or not, neither a helper to loop all the allocated IDs in an IDA and do something for cleanup. With the two needs, a helper to get th

Re: [PATCH 3/3] iommu: Add a wrapper for remove_dev_pasid

2024-09-13 Thread Yi Liu
On 2024/9/13 10:24, Baolu Lu wrote: On 9/12/24 9:06 PM, Yi Liu wrote: The iommu drivers are on the way to drop the remove_dev_pasid op by extending the blocked_domain to support PASID. However, this cannot be done in one shot. So far, the Intel iommu and the ARM SMMUv3 driver have supported it,

[PATCH v3 0/3] selftests: kvm: s390: Add ucontrol memory selftests

2024-09-13 Thread Christoph Schlameuss
This patch series adds a some not yet picked selftests to the kvm s390x selftest suite. The additional test cases are covering: * Assert KVM_EXIT_S390_UCONTROL exit on not mapped memory access * Assert functionality of storage keys in ucontrol VM * Assert that memory region operations are rejected

[PATCH v3 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-09-13 Thread Christoph Schlameuss
Add a test case verifying basic running and interaction of ucontrol VMs. Fill the segment and page tables for allocated memory and map memory on first access. * uc_map_unmap Store and load data to mapped and unmapped memory and use pic segment translation handling to map memory on access. Sig

[PATCH v3 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-09-13 Thread Christoph Schlameuss
Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss --- .../selftests/kvm/s390x/ucontrol_test.c | 89 ++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/s390x/ucontrol_tes

[PATCH v3 3/3] selftests: kvm: s390: Verify reject memory region operations for ucontrol VMs

2024-09-13 Thread Christoph Schlameuss
Add a test case verifying KVM_SET_USER_MEMORY_REGION and KVM_SET_USER_MEMORY_REGION2 cannot be executed on ucontrol VMs. Executing this test case on not patched kernels will cause a null pointer dereference in the host kernel. This is fixed with commit: commit 7816e58967d0 ("kvm: s390: Reject memo

Re: [PATCH v4 01/10] iommu: Introduce a replace API for device pasid

2024-09-13 Thread Yi Liu
On 2024/9/13 10:44, Baolu Lu wrote: On 9/12/24 9:12 PM, Yi Liu wrote: Provide a high-level API to allow replacements of one domain with another for specific pasid of a device. This is similar to iommu_group_replace_domain() and it is expected to be used only by IOMMUFD. Co-developed-by: Lu Baol

Re: [PATCH v2 2/6] iommu/vt-d: Move intel_drain_pasid_prq() into intel_pasid_tear_down_entry()

2024-09-13 Thread Yi Liu
On 2024/9/12 21:22, Baolu Lu wrote: On 2024/9/12 21:04, Yi Liu wrote: Draining PRQ is mostly conjuncted with pasid teardown, and with more callers coming, move it into it in the intel_pasid_tear_down_entry(). But there is scenario that only teardown pasid entry but no PRQ drain, so passing a f

Re: [PATCH v2 2/6] iommu/vt-d: Move intel_drain_pasid_prq() into intel_pasid_tear_down_entry()

2024-09-13 Thread Yi Liu
On 2024/9/13 10:11, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c index b51fc268dc84..ceb9c5274a39 100644 --- a/drivers/iommu/intel/pasid.c +++ b/drivers/iommu/intel/pasid.c @@ -236,8 +236,13 @@ devtlb_invalidation_with_p

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Yi Liu
On 2024/9/13 09:35, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: set_dev_pasid op is going to support domain replacement and keep the old hardware config if it fails. Make the Intel iommu driver be prepared for it. Signed-off-by: Yi Liu ---   drivers/iommu/intel/iommu.c | 98 +

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Yi Liu
On 2024/9/13 10:17, Baolu Lu wrote: On 9/13/24 9:35 AM, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: set_dev_pasid op is going to support domain replacement and keep the old hardware config if it fails. Make the Intel iommu driver be prepared for it. Signed-off-by: Yi Liu ---   drivers/i

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Yi Liu
On 2024/9/13 09:42, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4325,24 +4363,18 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain,   ret = intel_pasid_setup_second_level(iommu, dmar_domain,    dev, pasid);   if (ret) -   

Re: [PATCH v2 4/6] iommu/vt-d: Add set_dev_pasid callback for nested domain

2024-09-13 Thread Yi Liu
On 2024/9/13 09:52, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4299,7 +4304,12 @@ domain_prepare_dev_pasid(struct iommu_domain *domain,   unsigned long flags;   int ret; -    ret = prepare_domain_attach_device(domain, dev); +    /* Nested type domain should prepare its parent

Re: [PATCH v3 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-09-13 Thread Janosch Frank
On 9/13/24 1:52 PM, Christoph Schlameuss wrote: Add a test case verifying basic running and interaction of ucontrol VMs. Fill the segment and page tables for allocated memory and map memory on first access. * uc_map_unmap Store and load data to mapped and unmapped memory and use pic segment

[PATCH] selftests: livepatch: test livepatching a kprobed function

2024-09-13 Thread Michael Vetter
The test proves that a function that is being kprobed and uses a post_handler cannot be livepatched. Only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered to any given function at a time. Signed-off-by: Michael Vetter --- tools/testing/selftests/livepatch/Makefile| 3 +- ..

Re: [PATCH v3 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-09-13 Thread Janosch Frank
On 9/13/24 1:52 PM, Christoph Schlameuss wrote: Add a test case manipulating s390 storage keys from within the ucontrol VM. Signed-off-by: Christoph Schlameuss Except for the two nits: Reviewed-by: Janosch Frank I'll think about what to do with the nits next week. --- .../selftests/kvm

Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

2024-09-13 Thread Matthew Wilcox
On Fri, Sep 13, 2024 at 07:45:55PM +0800, Yi Liu wrote: > > No test cases for the test suite? ;-( > > let me add something like the below. :) That looks pretty comprehensive, thanks! Acked-by: Matthew Wilcox (Oracle)

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-13 Thread Will Deacon
On Thu, Sep 12, 2024 at 01:48:35PM +0100, Joey Gouly wrote: > On Thu, Sep 12, 2024 at 11:50:18AM +0100, Will Deacon wrote: > > On Wed, Sep 11, 2024 at 08:33:54AM -0700, Dave Hansen wrote: > > > On 9/11/24 08:01, Kevin Brodsky wrote: > > > > On 22/08/2024 17:10, Joey Gouly wrote: > > > >> @@ -371,6

Re: [PATCH v3 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-09-13 Thread Claudio Imbrenda
On Fri, 13 Sep 2024 13:52:46 +0200 Christoph Schlameuss wrote: > Add a test case verifying basic running and interaction of ucontrol VMs. > Fill the segment and page tables for allocated memory and map memory on > first access. > > * uc_map_unmap > Store and load data to mapped and unmapped me

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Baolu Lu
On 9/13/24 8:21 PM, Yi Liu wrote: On 2024/9/13 09:42, Baolu Lu wrote: On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4325,24 +4363,18 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain,   ret = intel_pasid_setup_second_level(iommu, dmar_domain,    de

Re: [PATCH v2 3/6] iommu/vt-d: Make intel_iommu_set_dev_pasid() to handle domain replacement

2024-09-13 Thread Liu, Yi L
> On Sep 14, 2024, at 09:08, Baolu Lu wrote: > > On 9/13/24 8:21 PM, Yi Liu wrote: >>> On 2024/9/13 09:42, Baolu Lu wrote: >>> On 9/12/24 9:04 PM, Yi Liu wrote: @@ -4325,24 +4363,18 @@ static int intel_iommu_set_dev_pasid(struct iommu_domain *domain, ret = intel_pasid_

Re: [PATCH v3 1/4] ida: Add ida_find_first_range()

2024-09-13 Thread Yi Liu
On 2024/9/13 23:09, Matthew Wilcox wrote: On Fri, Sep 13, 2024 at 07:45:55PM +0800, Yi Liu wrote: No test cases for the test suite? ;-( let me add something like the below. :) That looks pretty comprehensive, thanks! Acked-by: Matthew Wilcox (Oracle) thanks, and FYI. I found a bug when