Re: [PATCH v9 0/25] security: Move IMA and EVM to the LSM infrastructure

2024-02-08 Thread Roberto Sassu
On Wed, 2024-02-07 at 22:18 -0500, Paul Moore wrote: > On Jan 15, 2024 Roberto Sassu wrote: > > > > IMA and EVM are not effectively LSMs, especially due to the fact that in > > the past they could not provide a security blob while there is another LSM > > active. > > > > That changed in the rece

[PATCH rc 0/8] Add missing cache flush and dirty tracking set for nested parent domain

2024-02-08 Thread Yi Liu
This series adds the missing cache flush and dirty track set for nested parent domain (it's s2_domain but used as parent) which has no insight into devices/DID's under the nested domain (a.k.a s1_domain). This results in missing cache flush per parent domain change and incomplete dirty tracking set

[PATCH rc 1/8] iommu/vt-d: Track nested domains in parent

2024-02-08 Thread Yi Liu
Today the parent domain (s2_domain) is unaware of which DID's are used by and which devices are attached to nested domains (s1_domain) nested on it. This leads to a problem that some operations (flush iotlb/devtlb and enable dirty tracking) on parent domain only apply to DID's and devices directly

[PATCH rc 2/8] iommu/vt-d: Add __iommu_flush_iotlb_psi()

2024-02-08 Thread Yi Liu
Add __iommu_flush_iotlb_psi() to do the psi iotlb flush with a DID input rather than calculating it within the helper. This is useful when flushing cache for parent domain which reuses DIDs of its nested domains. Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 79 +--

[PATCH rc 3/8] iommu/vt-d: Add missing iotlb flush for parent domain

2024-02-08 Thread Yi Liu
If a domain is used as the parent in nested translation its mappings might be cached using DID of the nested domain. But the existing code ignores this fact to only invalidate the iotlb entries tagged by the domain's own DID. Loop the s1_domains list, if any, to invalidate all iotlb entries relate

[PATCH rc 4/8] iommu/vt-d: Update iotlb in nested domain attach

2024-02-08 Thread Yi Liu
Should call domain_update_iotlb() to update the has_iotlb_device flag of the domain after attaching device to nested domain. Without it, this flag is not set properly and would result in missing device TLB flush. Fixes: 9838f2bb6b6b ("iommu/vt-d: Set the nested domain to a device") Signed-off-by:

[PATCH rc 5/8] iommu/vt-d: Add missing device iotlb flush for parent domain

2024-02-08 Thread Yi Liu
ATS-capable devices cache the result of nested translation. This result relies on the mappings in s2 domain (a.k.a. parent). When there are modifications in the s2 domain, the related nested translation caches on the device should be flushed. This includes the devices that are attached to the s1 do

[PATCH rc 6/8] iommu/vt-d: Remove @domain parameter from intel_pasid_setup_dirty_tracking()

2024-02-08 Thread Yi Liu
The only usage of input @domain is to get the domain id (DID) to flush cache after setting dirty tracking. However, DID can be obtained from the pasid entry. So no need to pass in domain. This can make this helper cleaner when adding the missing dirty tracking for the parent domain, which needs to

[PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper

2024-02-08 Thread Yi Liu
Add device_set_dirty_tracking() to loop all the devices and set the dirty tracking per the @enable parameter. Signed-off-by: Yi Liu --- drivers/iommu/intel/iommu.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/intel/iommu.c b

[PATCH rc 8/8] iommu/vt-d: Add missing dirty tracking set for parent domain

2024-02-08 Thread Yi Liu
Setting dirty tracking for a s2 domain requires to loop all the related devices and set the dirty tracking enable bit in the PASID table entry. This includes the devices that are attached to the nested domains of a s2 domain if this s2 domain is used as parent. However, the existing dirty tracking

RE: [PATCH rc 1/8] iommu/vt-d: Track nested domains in parent

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > static void intel_nested_domain_free(struct iommu_domain *domain) > { > + struct dmar_domain *dmar_domain = to_dmar_domain(domain); > + struct dmar_domain *s2_domain = dmar_domain->s2_domain; > + > + spin_lock(&s2_doma

RE: [PATCH rc 2/8] iommu/vt-d: Add __iommu_flush_iotlb_psi()

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > Add __iommu_flush_iotlb_psi() to do the psi iotlb flush with a DID input > rather than calculating it within the helper. > > This is useful when flushing cache for parent domain which reuses DIDs of > its nested domains. > > Signe

RE: [PATCH rc 3/8] iommu/vt-d: Add missing iotlb flush for parent domain

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > +/* > + * Flush the relevant caches in nested translation if the domain > + * also serves as a parent > + */ > +static void parent_domain_flush(struct dmar_domain *domain, > + unsigned long pfn, > +

RE: [PATCH rc 4/8] iommu/vt-d: Update iotlb in nested domain attach

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > Should call domain_update_iotlb() to update the has_iotlb_device flag > of the domain after attaching device to nested domain. Without it, this > flag is not set properly and would result in missing device TLB flush. > > Fixes: 983

RE: [PATCH rc 5/8] iommu/vt-d: Add missing device iotlb flush for parent domain

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > ATS-capable devices cache the result of nested translation. This result > relies on the mappings in s2 domain (a.k.a. parent). When there are > modifications in the s2 domain, the related nested translation caches on > the device sh

RE: [PATCH rc 6/8] iommu/vt-d: Remove @domain parameter from intel_pasid_setup_dirty_tracking()

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > The only usage of input @domain is to get the domain id (DID) to flush > cache after setting dirty tracking. However, DID can be obtained from > the pasid entry. So no need to pass in domain. This can make this helper > cleaner when

RE: [PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > Add device_set_dirty_tracking() to loop all the devices and set the dirty > tracking per the @enable parameter. > > Signed-off-by: Yi Liu Reviewed-by: Kevin Tian

Re: [PATCH v12 11/20] KVM: xen: allow shared_info to be mapped by fixed HVA

2024-02-08 Thread Paul Durrant
On 07/02/2024 04:10, Sean Christopherson wrote: On Mon, Jan 15, 2024, Paul Durrant wrote: @@ -638,20 +637,32 @@ int kvm_xen_hvm_set_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data) } break; - case KVM_XEN_ATTR_TYPE_SHARED_INFO: { + case KVM_XEN_ATTR

RE: [PATCH rc 8/8] iommu/vt-d: Add missing dirty tracking set for parent domain

2024-02-08 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, February 8, 2024 4:23 PM > > @@ -4760,6 +4790,12 @@ static int intel_iommu_set_dirty_tracking(struct > iommu_domain *domain, > if (ret) > goto err_unwind; > > + if (dmar_domain->nested_parent) { > + ret = parent_domain_set_d

Re: [PATCH] selftests: Add missing gitignore entries

2024-02-08 Thread Javier Carrasco
On 26.01.24 06:24, Bernd Edlinger wrote: > Prevent them from polluting git status after building selftests. > > Signed-off-by: Bernd Edlinger > --- > tools/testing/selftests/damon/.gitignore | 1 + > tools/testing/selftests/thermal/intel/power_floor/.gitignore | 2 ++ > t

[PATCH] iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking

2024-02-08 Thread Yi Liu
Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the pasid entry when attaching a device to a nested domain if its parent has already enabled dirty tracking. Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation") Signed-off-by: Yi Liu --- base commit: 5

Re: [PATCH rc 1/8] iommu/vt-d: Track nested domains in parent

2024-02-08 Thread Yi Liu
On 2024/2/8 16:28, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, February 8, 2024 4:23 PM static void intel_nested_domain_free(struct iommu_domain *domain) { + struct dmar_domain *dmar_domain = to_dmar_domain(domain); + struct dmar_domain *s2_domain = dmar_domain->s2_dom

Re: [PATCH rc 8/8] iommu/vt-d: Add missing dirty tracking set for parent domain

2024-02-08 Thread Yi Liu
On 2024/2/8 16:53, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, February 8, 2024 4:23 PM @@ -4760,6 +4790,12 @@ static int intel_iommu_set_dirty_tracking(struct iommu_domain *domain, if (ret) goto err_unwind; + if (dmar_domain->nested_parent) { +

Re: [PATCH rc 6/8] iommu/vt-d: Remove @domain parameter from intel_pasid_setup_dirty_tracking()

2024-02-08 Thread Joao Martins
On 08/02/2024 08:23, Yi Liu wrote: > The only usage of input @domain is to get the domain id (DID) to flush > cache after setting dirty tracking. However, DID can be obtained from > the pasid entry. So no need to pass in domain. This can make this helper > cleaner when adding the missing dirty trac

Re: [PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper

2024-02-08 Thread Joao Martins
On 08/02/2024 08:23, Yi Liu wrote: > Add device_set_dirty_tracking() to loop all the devices and set the dirty > tracking per the @enable parameter. > > Signed-off-by: Yi Liu Nice cleanup, Reviewed-by: Joao Martins > --- > drivers/iommu/intel/iommu.c | 32 +--- >

Re: [PATCH] iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking

2024-02-08 Thread Joao Martins
On 08/02/2024 09:14, Yi Liu wrote: > Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the > pasid entry when attaching a device to a nested domain if its parent > has already enabled dirty tracking. > > Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested > transla

Re: [PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup()

2024-02-08 Thread Marco Elver
On Thu, Feb 08, 2024 at 08:37AM +0100, Marco Elver wrote: > On Thu, 8 Feb 2024 at 00:58, Yonghong Song wrote: > > On 2/7/24 4:26 AM, Marco Elver wrote: > > > In various performance profiles of kernels with BPF programs attached, > > > bpf_local_storage_lookup() appears as a significant portion of

Re: [RFC PATCH 0/5] RISC-V: Add dynamic TSO support

2024-02-08 Thread Andrea Parri
On Fri, Nov 24, 2023 at 12:04:09PM +0100, Jonas Oberhauser wrote: > Unfortunately, at least last time I checked RISC-V still hadn't gotten such > instructions. > What they have is the *semantics* of the instructions, but no actual opcodes > to encode them. > I argued for them in the RISC-V memory g

Re: [PATCH net v2 1/2] net: openvswitch: limit the number of recursions from action sets

2024-02-08 Thread Simon Horman
On Wed, Feb 07, 2024 at 08:24:15AM -0500, Aaron Conole wrote: > The ovs module allows for some actions to recursively contain an action > list for complex scenarios, such as sampling, checking lengths, etc. > When these actions are copied into the internal flow table, they are > evaluated to valida

Re: [PATCH net v2 2/2] selftests: openvswitch: Add validation for the recursion test

2024-02-08 Thread Simon Horman
On Wed, Feb 07, 2024 at 08:24:16AM -0500, Aaron Conole wrote: > Add a test case into the netlink checks that will show the number of > nested action recursions won't exceed 16. Going to 17 on a small > clone call isn't enough to exhaust the stack on (most) systems, so > it should be safe to run ev

[PATCH net v2] selftests: net: Fix bridge backup port test flakiness

2024-02-08 Thread Ido Schimmel
The test toggles the carrier of a bridge port in order to test the bridge backup port feature. Due to the linkwatch delayed work the carrier change is not always reflected fast enough to the bridge driver and packets are not forwarded as the test expects, resulting in failures [1]. Fix by busy wa

Re: [PATCH v9 0/25] security: Move IMA and EVM to the LSM infrastructure

2024-02-08 Thread Paul Moore
On Thu, Feb 8, 2024 at 3:06 AM Roberto Sassu wrote: > On Wed, 2024-02-07 at 22:18 -0500, Paul Moore wrote: ... > > I had some pretty minor comments but I think the only thing I saw that > > I think needs a change/addition is a comment in the Makefile regarding > > the IMA/EVM ordering; take a lo

[PATCH net] selftests: net: wait for receiver startup in so_txtime.sh

2024-02-08 Thread Paolo Abeni
The mentioned test is failing in slow environments: # SO_TXTIME ipv4 clock monotonic # ./so_txtime: recv: timeout: Resource temporarily unavailable not ok 1 selftests: net: so_txtime.sh # exit=1 The receiver is started in background and the sender could end-up transmitting the packet before

[PATCH net 0/4] selftests: forwarding: Various fixes

2024-02-08 Thread Ido Schimmel
Fix various problems in the forwarding selftests so that they will pass in the netdev CI instead of being ignored. See commit messages for details. Ido Schimmel (4): selftests: forwarding: Fix layer 2 miss test flakiness selftests: forwarding: Fix bridge MDB test flakiness selftests: forward

[PATCH net 1/4] selftests: forwarding: Fix layer 2 miss test flakiness

2024-02-08 Thread Ido Schimmel
After enabling a multicast querier on the bridge (like the test is doing), the bridge will wait for the Max Response Delay before starting to forward according to its MDB in order to let Membership Reports enough time to be received and processed. Currently, the test is waiting for exactly the def

[PATCH net 2/4] selftests: forwarding: Fix bridge MDB test flakiness

2024-02-08 Thread Ido Schimmel
After enabling a multicast querier on the bridge (like the test is doing), the bridge will wait for the Max Response Delay before starting to forward according to its MDB in order to let Membership Reports enough time to be received and processed. Currently, the test is waiting for exactly the def

[PATCH net 3/4] selftests: forwarding: Suppress grep warnings

2024-02-08 Thread Ido Schimmel
Suppress the following grep warnings: [...] INFO: # Port group entries configuration tests - (*, G) TEST: Common port group entries configuration tests (IPv4 (*, G)) [ OK ] TEST: Common port group entries configuration tests (IPv6 (*, G)) [ OK ] grep: warning: stray \ before / grep: warning: s

[PATCH net 4/4] selftests: forwarding: Fix bridge locked port test flakiness

2024-02-08 Thread Ido Schimmel
The redirection test case fails in the netdev CI on debug kernels because an FDB entry is learned despite the presence of a tc filter that redirects incoming traffic [1]. I am unable to reproduce the failure locally, but I can see how it can happen given that learning is first enabled and only the

Re: [PATCH v12 11/20] KVM: xen: allow shared_info to be mapped by fixed HVA

2024-02-08 Thread Sean Christopherson
On Thu, Feb 08, 2024, Paul Durrant wrote: > On 07/02/2024 04:10, Sean Christopherson wrote: > > On Mon, Jan 15, 2024, Paul Durrant wrote: > > > @@ -638,20 +637,32 @@ int kvm_xen_hvm_set_attr(struct kvm *kvm, struct > > > kvm_xen_hvm_attr *data) > > > } > > > bre

Re: [PATCH v12 11/20] KVM: xen: allow shared_info to be mapped by fixed HVA

2024-02-08 Thread Paul Durrant
On 08/02/2024 16:48, Sean Christopherson wrote: On Thu, Feb 08, 2024, Paul Durrant wrote: On 07/02/2024 04:10, Sean Christopherson wrote: On Mon, Jan 15, 2024, Paul Durrant wrote: @@ -638,20 +637,32 @@ int kvm_xen_hvm_set_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data) }

Re: [PATCH net v2] selftests: net: Fix bridge backup port test flakiness

2024-02-08 Thread Paolo Abeni
On Thu, 2024-02-08 at 14:31 +0200, Ido Schimmel wrote: > The test toggles the carrier of a bridge port in order to test the > bridge backup port feature. > > Due to the linkwatch delayed work the carrier change is not always > reflected fast enough to the bridge driver and packets are not forwarde

[PATCH net-next] selftests: forwarding: Add missing multicast routing config entries

2024-02-08 Thread Ido Schimmel
The two tests that make use of multicast routig (router.sh and router_multicast.sh) are currently failing in the netdev CI because the kernel is missing multicast routing support. Fix by adding the required config entries. Fixes: 6d4efada3b82 ("selftests: forwarding: Add multicast routing test")

Re: [PATCH v12 11/20] KVM: xen: allow shared_info to be mapped by fixed HVA

2024-02-08 Thread David Woodhouse
On Thu, 2024-02-08 at 16:51 +, Paul Durrant wrote: > On 08/02/2024 16:48, Sean Christopherson wrote: > > On Thu, Feb 08, 2024, Paul Durrant wrote: > > > With the benefit of some sleep, I'm wondering why 0 is a 'ridiculous' > > > invalid value for a *virtual* address? Surely it's essentially a n

[PATCH net-next] selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW

2024-02-08 Thread Paolo Abeni
This test is time sensitive. It may fail on virtual machines and for debug builds. Similar to commit c41dfb0dfbec ("selftests/net: ignore timing errors in so_txtime if KSFT_MACHINE_SLOW"), optionally suppress failure for timing errors (only). Signed-off-by: Paolo Abeni --- tools/testing/selftes

Re: [PATCH v2 7/7] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

2024-02-08 Thread Thomas Huth
On 26/01/2024 20.32, Sean Christopherson wrote: On Thu, Oct 05, 2023, Thomas Huth wrote: Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Note: We're not using the KVM_ONE_VCPU_TEST() macro here (but the gener

Re: resctrl selftests ready for inclusion

2024-02-08 Thread Reinette Chatre
Hi Shuah, On 1/22/2024 10:06 AM, Reinette Chatre wrote: > Could you please consider Ilpo's resctrl selftest enhancements [1] > for inclusion into kselftest's "next" branch in preparation for the > next merge window? I just confirmed that, even though [1] is almost two months old, it does apply cl

Re: [PATCH net] selftests: net: wait for receiver startup in so_txtime.sh

2024-02-08 Thread Willem de Bruijn
Paolo Abeni wrote: > The mentioned test is failing in slow environments: > > # SO_TXTIME ipv4 clock monotonic > # ./so_txtime: recv: timeout: Resource temporarily unavailable > not ok 1 selftests: net: so_txtime.sh # exit=1 > > The receiver is started in background and the sender could end-

[PATCH v3 0/8] Use TAP in some more x86 KVM selftests

2024-02-08 Thread Thomas Huth
Basic idea of this series is now to use the kselftest_harness.h framework to get TAP output in the tests, so that it is easier for the user to see what is going on, and e.g. to be able to detect whether a certain test is part of the test binary or not (which is useful when tests get extended in the

[PATCH v3 1/8] KVM: selftests: x86: sync_regs_test: Use vcpu_run() where appropriate

2024-02-08 Thread Thomas Huth
In the spots where we are expecting a successful run, we should use vcpu_run() instead of _vcpu_run() to make sure that the run did not fail. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/x86_64/sync_regs_test.c | 10 +- 1 file changed, 5 i

[PATCH v3 3/8] KVM: selftests: Move setting a vCPU's entry point to a dedicated API

2024-02-08 Thread Thomas Huth
From: Sean Christopherson Extract the code to set a vCPU's entry point out of vm_arch_vcpu_add() and into a new API, vcpu_arch_set_entry_point(). Providing a separate API will allow creating a KVM selftests hardness that can handle tests that use different entry points for sub-tests, whereas *re

[PATCH v3 4/8] KVM: selftests: Add a macro to define a test with one vcpu

2024-02-08 Thread Thomas Huth
Most tests are currently not giving any proper output for the user to see how much sub-tests have already been run, or whether new sub-tests are part of a binary or not. So it would be good to support TAP output in the KVM selftests. There is already a nice framework for this in the kselftest_harne

[PATCH v3 6/8] KVM: selftests: x86: Use TAP interface in the fix_hypercall test

2024-02-08 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/fix_hypercall_test.c | 27 --- 1 file changed, 18 insertions(+), 9 deletions(-) diff --gi

[PATCH v3 5/8] KVM: selftests: x86: Use TAP interface in the sync_regs test

2024-02-08 Thread Thomas Huth
The sync_regs test currently does not have any output (unless one of the TEST_ASSERT statement fails), so it's hard to say for a user whether a certain new sub-test has been included in the binary or not. Let's make this a little bit more user-friendly and include some TAP output via the kselftest_

[PATCH v3 2/8] KVM: selftests: x86: sync_regs_test: Get regs structure before modifying it

2024-02-08 Thread Thomas Huth
The regs structure just accidentally contains the right values from the previous test in the spot where we want to change rbx. It's cleaner if we properly initialize the structure here before using it. Suggested-by: Sean Christopherson Signed-off-by: Thomas Huth --- tools/testing/selftests/kvm/

[PATCH v3 7/8] KVM: selftests: x86: Use TAP interface in the vmx_pmu_caps test

2024-02-08 Thread Thomas Huth
Use the kvm_test_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 50 --- 1 file changed, 11 insertions(+), 39 deletions(-) diff --g

[PATCH v3 8/8] KVM: selftests: x86: Use TAP interface in the userspace_msr_exit test

2024-02-08 Thread Thomas Huth
Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth --- .../kvm/x86_64/userspace_msr_exit_test.c | 52 +-- 1 file changed, 13 insertions(+), 39 deletions(-) diff --

Re: [PATCH net-next] selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW

2024-02-08 Thread Willem de Bruijn
Paolo Abeni wrote: > This test is time sensitive. It may fail on virtual machines and for > debug builds. > > Similar to commit c41dfb0dfbec ("selftests/net: ignore timing errors in > so_txtime if KSFT_MACHINE_SLOW"), optionally suppress failure for timing > errors (only). > > Signed-off-by: Paol

[PATCH] selftests/mqueue: Set timeout to 100 seconds

2024-02-08 Thread SeongJae Park
While mq_perf_tests runs with the default kselftest timeout limit, which is 45 seconds, the test takes about 60 seconds to complete on i3.metal AWS instances. Hence, the test always times out. Increase the timeout to 100 seconds. Fixes: 852c8cbf34d3 ("selftests/kselftest/runner.sh: Add 45 second

Re: [PATCH net-next] selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW

2024-02-08 Thread Jakub Kicinski
On Thu, 08 Feb 2024 15:51:31 -0500 Willem de Bruijn wrote: > Paolo Abeni wrote: > > This test is time sensitive. It may fail on virtual machines and for > > debug builds. > > > > Similar to commit c41dfb0dfbec ("selftests/net: ignore timing errors in > > so_txtime if KSFT_MACHINE_SLOW"), optionall

Re: [PATCH net-next] selftests: net: ignore timing errors in txtimestamp if KSFT_MACHINE_SLOW

2024-02-08 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Thu, 08 Feb 2024 15:51:31 -0500 Willem de Bruijn wrote: > > Paolo Abeni wrote: > > > This test is time sensitive. It may fail on virtual machines and for > > > debug builds. > > > > > > Similar to commit c41dfb0dfbec ("selftests/net: ignore timing errors in > > > so_txti

Re: [PATCH bpf-next v2] bpf: Allow compiler to inline most of bpf_local_storage_lookup()

2024-02-08 Thread Yonghong Song
On 2/8/24 2:54 AM, Marco Elver wrote: On Thu, Feb 08, 2024 at 08:37AM +0100, Marco Elver wrote: On Thu, 8 Feb 2024 at 00:58, Yonghong Song wrote: On 2/7/24 4:26 AM, Marco Elver wrote: In various performance profiles of kernels with BPF programs attached, bpf_local_storage_lookup() appears a

Re: [PATCH rc 3/8] iommu/vt-d: Add missing iotlb flush for parent domain

2024-02-08 Thread Baolu Lu
On 2024/2/8 16:38, Tian, Kevin wrote: From: Liu, Yi L Sent: Thursday, February 8, 2024 4:23 PM +/* + * Flush the relevant caches in nested translation if the domain + * also serves as a parent + */ +static void parent_domain_flush(struct dmar_domain *domain, + unsig

Re: [PATCH] iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking

2024-02-08 Thread Baolu Lu
On 2024/2/8 17:14, Yi Liu wrote: Should set the SSADE (Second Stage Access/Dirty bit Enable) bit of the pasid entry when attaching a device to a nested domain if its parent has already enabled dirty tracking. Fixes: 111bf85c68f6 ("iommu/vt-d: Add helper to setup pasid nested translation") Signed

Re: [PATCH rc 7/8] iommu/vt-d: Wrap the dirty tracking loop to be a helper

2024-02-08 Thread Baolu Lu
On 2024/2/8 16:23, Yi Liu wrote: --- a/drivers/iommu/intel/iommu.c +++ b/drivers/iommu/intel/iommu.c @@ -4730,23 +4730,35 @@ static void *intel_iommu_hw_info(struct device *dev, u32 *length, u32 *type) return vtd; } +static int +device_set_dirty_tracking(struct list_head *devices,

Re: [PATCH net] selftests: net: add more missing kernel config

2024-02-08 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski : On Wed, 7 Feb 2024 18:31:10 +0100 you wrote: > The reuseport_addr_any.sh is currently skipping DCCP tests and > pmtu.sh is skipping all the FOU/GUE related cases: add the missing > options. > > Signed-off-by: Paolo Abeni

[RFC PATCH v2 0/6] RISC-V: Add dynamic TSO support

2024-02-08 Thread Christoph Müllner
The upcoming RISC-V Ssdtso specification introduces a bit in the senvcfg CSR to switch the memory consistency model of user mode at run-time from RVWMO to TSO. The active consistency model can therefore be switched on a per-hart base and managed by the kernel on a per-process base. This patchset i

[RFC PATCH v2 2/6] uapi: prctl: Add new prctl call to set/get the memory consistency model

2024-02-08 Thread Christoph Müllner
This patch defines a prctl uAPI for switching the active memory consistency model of user-space processes. The implementation follows the way other prctl calls are implemented by disabling them unless arch-specific code provides the relevant macros. Signed-off-by: Christoph Müllner --- .../mm/d

[RFC PATCH v2 1/6] mm: Add dynamic memory consistency model switching

2024-02-08 Thread Christoph Müllner
Some architectures have support to change the memory consistency model at run time. This patch adds a new field 'active_memory_consistency_model' to task_struct that allows architecture code to store the active model as a per-process property. To avoid useless overhead, the mechanism needs to be e

[RFC PATCH v2 3/6] RISC-V: Enable dynamic memory consistency model support with Ssdtso

2024-02-08 Thread Christoph Müllner
This patch implements dynamic memory consistency switching on RISC-V using the Ssdtso ISA extension. Ssdtso is a RISC-V ISA extension, which allows to switch the memory consistency model of less privileged modes from RVWMO to TSO at runtime. The active model is controlled by a DTSO bit in the {m,h

[RFC PATCH v2 4/6] RISC-V: Implement prctl call to set/get the memory consistency model

2024-02-08 Thread Christoph Müllner
We can use the PR_{S,G}ET_MEMORY_CONSISTENCY_MODEL prctl calls to change the memory consistency model at run-time if we have Ssdtso. This patch registers RISCV_WMO and RISCV_TSO as valid arguments for these prctl calls and implements the glue code to switch between these. Signed-off-by: Christoph

[RFC PATCH v2 5/6] RISC-V: Expose Ssdtso via hwprobe API

2024-02-08 Thread Christoph Müllner
This patch adds Ssdtso to the list of extensions which are announced to user-space using te hwprobe API. Signed-off-by: Christoph Müllner --- Documentation/arch/riscv/hwprobe.rst | 3 +++ arch/riscv/include/uapi/asm/hwprobe.h | 1 + arch/riscv/kernel/sys_hwprobe.c | 2 ++ 3 files changed,

[RFC PATCH v2 6/6] RISC-V: selftests: Add DTSO tests

2024-02-08 Thread Christoph Müllner
This patch tests the dynamic memory consistency model prctl() behaviour on RISC-V. It does not depend on CONFIG_RISCV_ISA_SSDTSO or the availability of Ssdtso, but will test other aspects if these are not given. Signed-off-by: Christoph Müllner --- tools/testing/selftests/riscv/Makefile|