On Thu, Sep 21, 2023 at 08:12:03PM +0800, Baolu Lu wrote:
> On 2023/9/21 15:51, Yi Liu wrote:
> > diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h
> > index 4a7c5c8fdbb4..3c8660fe9bb1 100644
> > --- a/include/uapi/linux/iommufd.h
> > +++ b/include/uapi/linux/iommufd.h
> > @@
[AMD Official Use Only - General]
Hi Natalenko and Mario:
> -Original Message-
> From: Limonciello, Mario
> Sent: Thursday, September 21, 2023 4:12 AM
> To: Oleksandr Natalenko ; Huang, Ray
> ; Meng, Li (Jassmine)
> Cc: linux...@vger.kernel.org; linux-ker...@vger.kernel.org;
> x...@kern
On 2023/9/21 15:54, Yi Liu wrote:
This adds the data structure for flushing iotlb for the nested domain
allocated with IOMMU_HWPT_TYPE_VTD_S1 type.
This only supports invalidating IOTLB, but no for device-TLB as device-TLB
invalidation will be covered automatically in the IOTLB invalidation if t
On Wed, Sep 20, 2023 at 01:50:32PM +0300, Nikolay Aleksandrov wrote:
> On 9/19/23 11:12, Johannes Nixdorf wrote:
> > [...]
> > diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
> > index 505683ef9a26..f5d49a05e61b 100644
> > --- a/net/bridge/br_netlink.c
> > +++ b/net/bridge/br_netlink
On Wed, Sep 20, 2023 at 9:16 PM Anup Patel wrote:
>
> This series includes few assorted fixes for KVM RISC-V ONE_REG interface
> and KVM_GET_REG_LIST API.
>
> These patches can also be found in riscv_kvm_onereg_fixes_v2 branch at:
> https://github.com/avpatel/linux.git
>
> Changes since v1:
> - A
On Wed, Sep 20, 2023 at 02:00:27PM +0300, Nikolay Aleksandrov wrote:
> On 9/19/23 11:12, Johannes Nixdorf wrote:
> > Add a Kconfig option to configure a default FDB learning limit system
> > wide, so a distributor building a special purpose kernel can limit all
> > created bridges by default.
> >
On Thu, Sep 14, 2023 at 9:28 PM Jann Horn wrote:
> Though, uh, I guess if that's true, the existing
> vma_is_anonymous() is broken, since that also just checks ->vm_ops?
> I'm not sure what the consequences of that would be... Either way,
> vma_is_anonymous() might be the better way to check f
On Tue, Sep 19, 2023 at 10:12:48AM +0200, Johannes Nixdorf wrote:
> In preparation of the following fdb limit for dynamically learned entries,
> allow fdb_create to detect that the entry was added by the user. This
> way it can skip applying the limit in this case.
>
> Signed-off-by: Johannes Nixd
This adds the helper for setting the nested domain to a device hence
enable nested domain usage on Intel VT-d.
Signed-off-by: Jacob Pan
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 50
1 file changed, 50 insertions(+)
di
From: Lu Baolu
When remapping hardware is configured by system software in scalable mode
as Nested (PGTT=011b) and with PWSNP field Set in the PASID-table-entry,
it may Set Accessed bit and Dirty bit (and Extended Access bit if enabled)
in first-stage page-table entries even when second-stage map
This makes the helpers visible to nested.c.
Reviewed-by: Kevin Tian
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 10 +-
drivers/iommu/intel/iommu.h | 6 ++
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/i
On 2023/9/21 15:51, Yi Liu wrote:
diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h
index 4a7c5c8fdbb4..3c8660fe9bb1 100644
--- a/include/uapi/linux/iommufd.h
+++ b/include/uapi/linux/iommufd.h
@@ -357,6 +357,14 @@ enum iommufd_hwpt_alloc_flags {
IOMMU_HWPT_ALLOC_NE
On 9/21/23 10:23, Johannes Nixdorf wrote:
On Wed, Sep 20, 2023 at 01:46:02PM +0300, Nikolay Aleksandrov wrote:
On 9/19/23 11:12, Johannes Nixdorf wrote:
Set any new attributes added to br_policy to be parsed strictly, to
prevent userspace from passing garbage.
Signed-off-by: Johannes Nixdorf
iommu core already supports accepting user_data and hwpt_type to allocate
a user iommu_domain, which allows the caller iommufd_hw_pagetable_alloc()
to accept the hwpt_type and user_data too. Thus, pass them in.
Reviewed-by: Kevin Tian
Co-developed-by: Nicolin Chen
Signed-off-by: Nicolin Chen
Si
On Wed, 2023-09-13 at 08:54 +1000, Michael Ellerman wrote:
> Aboorva Devarajan writes:
> > From: Pratik R. Sampat
> >
> > Introduce a mechanism to fire directed IPIs from a source CPU to a
> > specified target CPU and measure the time incurred on waking up the
> > target CPU in response.
> >
>
On 9/21/23 15:41, Nikolay Aleksandrov wrote:
On 9/19/23 11:12, Johannes Nixdorf wrote:
The previous patch added accounting and a limit for the number of
dynamically learned FDB entries per bridge. However it did not provide
means to actually configure those bounds or read back the count. This
pa
From: Nicolin Chen
TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL
from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl().
This has been working when min_size is exactly the size of the structure.
However, if the size of the structure becomes larger than
On Thu, Sep 21, 2023 at 4:31 AM Atish Patra wrote:
>
> On Wed, Sep 20, 2023 at 6:56 AM Anup Patel wrote:
> >
> > On Wed, Sep 20, 2023 at 1:24 AM Atish Patra wrote:
> > >
> > > On Mon, Sep 18, 2023 at 11:07 AM Anup Patel
> > > wrote:
> > > >
> > > > Same set of ISA_EXT registers are not present
In order to use run_kselftest.sh the list of tests must be emitted to
populate kselftest-list.txt.
The powerpc Makefile is written to use EMIT_TESTS. But support for
EMIT_TESTS was dropped in commit d4e59a536f50 ("selftests: Use runner.sh
for emit targets"). Although prior to that commit a548de0fe
From: Nicolin Chen
The iopt_table_enforce_dev_resv_regions() and iopt_remove_reserved_iova()
require callers to pass in an ioas->iopt pointer. It simply works with a
kernel-managed hw_pagetable by passing in its hwpt->ioas->iopt pointer.
However, now there could be a user-managed hw_pagetable tha
From: Nicolin Chen
As one of the previous commits mentioned, a user-managed HWPT will have
some different attributes/members. It'd be more clear by having separate
allocators. Since the existing iommufd_hw_pagetable_alloc() serves well
kernel-managed HWPTs, apply some minimal updates to mark it a
IOMMU_HWPT_ALLOC already supports iommu_domain allocation for usersapce.
But it can only allocate a hw_pagetable that associates to a given IOAS,
i.e. only a kernel-managed hw_pagetable of IOMMU_HWPT_TYPE_DEFAULT type.
IOMMU drivers can now support user-managed hw_pagetables, for two-stage
transla
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_
On 9/21/23 11:06, Johannes Nixdorf wrote:
On Wed, Sep 20, 2023 at 02:00:27PM +0300, Nikolay Aleksandrov wrote:
On 9/19/23 11:12, Johannes Nixdorf wrote:
Add a Kconfig option to configure a default FDB learning limit system
wide, so a distributor building a special purpose kernel can limit all
c
On 9/19/23 11:12, Johannes Nixdorf wrote:
The previous patch added accounting and a limit for the number of
dynamically learned FDB entries per bridge. However it did not provide
means to actually configure those bounds or read back the count. This
patch does that.
Two new netlink attributes are
From: Nicolin Chen
This allows iommufd_hwpt_alloc() to have a common routine but jump to a
different allocator and hold a different mutex, corresponding to types
of HWPT allocation (either kernel-managed or user-managed). This shared
function pointer takes "pt_obj" as an input that would be cover
From: Nicolin Chen
Add a parent hw_pagetable pointer for user-managed hw_pagetables. Similar
to the ioas->mutex, add another mutex in the kernel-managed hw_pagetable
to serialize associating user-managed hw_pagetable allocations. Then, add
user_managed flag too in the struct to ease identifying a
From: Lu Baolu
Introduce a new domain type for a user I/O page table, which is nested on
top of another user space address represented by a UNMANAGED domain. The
mappings of a nested domain are managed by user space software, so it is
not necessary to have map/unmap callbacks. But the updates of
domain_alloc_user op already accepts user flags for domain allocation,
add hwpt_type and user_data support as well. This op chooses to make the
special parameters opaque to the core. This suits the current usage model
where accessing any of the IOMMU device special parameters does require
a userspa
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
This is to add Intel VT-d nested translation based on IOMMUFD nesting
infrastructure. As the iommufd nesting infrastructure series[1], iommu
core supports new ops to report iommu hardware information, allocate
domains with user data and invalidate stage-1 IOTLB when there is mapping
changed in stag
On Thu, Sep 14, 2023 at 6:45 PM David Hildenbrand wrote:
>
> On 14.09.23 20:43, David Hildenbrand wrote:
> > On 14.09.23 20:11, Matthew Wilcox wrote:
> >> On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote:
> >>> +++ b/include/linux/userfaultfd_k.h
> >>> @@ -93,6 +93,23 @@ extern i
From: Nicolin Chen
The IOMMU_HWPT_ALLOC ioctl now supports passing user_data to allocate a
user-managed domain for nested HWPTs. Add its coverage for that. Also,
update _test_cmd_hwpt_alloc() and add test_cmd/err_hwpt_alloc_nested().
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
tools
From: Nicolin Chen
This allows to test whether IOTLB has been invalidated or not.
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 5
drivers/iommu/iommufd/selftest.c | 25 +++
tools/testing/selftests/iomm
From: Nicolin Chen
Add mock_domain_cache_invalidate_user() data structure to support user
space selftest program to cover user cache invalidation pathway.
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
drivers/iommu/iommufd/iommufd_test.h | 17 +++
drivers/iommu/iommufd/selftes
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.
Signed-off-by: Nicolin Chen
Signed-off-by: Yi Liu
---
tools/testing/selftests/iommu/iommufd.c | 61 +++
tools/testing/selftests/iommu/iommuf
On 2023/9/21 15:51, Yi Liu wrote:
+/**
+ * iommu_copy_user_data - Copy iommu driver specific user space data
+ * @dst_data: Pointer to an iommu driver specific user data that is defined in
+ *include/uapi/linux/iommufd.h
+ * @src_data: Pointer to a struct iommu_user_data for user spac
On Wed, Sep 20, 2023 at 9:41 PM 'Jinjie Ruan' via KUnit Development
wrote:
>
> When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and
> CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected.
>
> If kunit_filter_suites() succeeds, not only copy but also filtered_suite
> an
On 07/07/2023 22:55, Axel Rasmussen wrote:
> The test is pretty basic, and exercises UFFDIO_POISON straightforwardly.
> We register a region with userfaultfd, in missing fault mode. For each
> fault, we either UFFDIO_COPY a zeroed page (odd pages) or UFFDIO_POISON
> (even pages). We do this mix to
From: Lu Baolu
This adds helper for accepting user parameters and allocate a nested
domain.
Reviewed-by: Kevin Tian
Signed-off-by: Jacob Pan
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/Makefile | 2 +-
drivers/iommu/intel/iommu.h | 2 ++
drivers/iommu/intel/nest
On 21.09.23 20:04, Suren Baghdasaryan wrote:
On Thu, Sep 14, 2023 at 6:45 PM David Hildenbrand wrote:
On 14.09.23 20:43, David Hildenbrand wrote:
On 14.09.23 20:11, Matthew Wilcox wrote:
On Thu, Sep 14, 2023 at 08:26:12AM -0700, Suren Baghdasaryan wrote:
+++ b/include/linux/userfaultfd_k.h
From: Lu Baolu
This adds the support for IOMMU_HWPT_TYPE_VTD_S1 type.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 24
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/drivers/iommu/intel/iommu.
This implements the .cache_invalidate_user() callback to support iotlb
flush for nested domain.
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/nested.c | 58
1 file changed, 58 insertions(+)
diff --git a/drivers/iommu/intel/nested.c b
This adds the data structure for flushing iotlb for the nested domain
allocated with IOMMU_HWPT_TYPE_VTD_S1 type.
This only supports invalidating IOTLB, but no for device-TLB as device-TLB
invalidation will be covered automatically in the IOTLB invalidation if the
underlying IOMMU driver has enabl
From: Lu Baolu
The configurations are passed in from the user when the user domain is
allocated. This helper interprets these configurations according to the
data structure defined in uapi/linux/iommufd.h. The EINVAL error will be
returned if any of configurations are not compatible with the hard
This makes the helpers visible to nested.c.
Suggested-by: Lu Baolu
Reviewed-by: Kevin Tian
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.c | 15 ++-
drivers/iommu/intel/iommu.h | 7 +++
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/intel/i
From: Nicolin Chen
Now enforce_cache_coherency and msi_cookie are kernel-managed hwpt things.
So, they should be only setup on kernel-managed domains. If the attaching
domain is a user-managed domain, redirect the hwpt to hwpt->parent to do
it correctly.
Signed-off-by: Nicolin Chen
Co-developed
From: Nicolin Chen
Add nested domain support in the ->domain_alloc_user op with some proper
sanity checks. Then, add a domain_nested_ops for all nested domains.
Also, add an iotlb as a testing property of a nested domain. A following
patch will verify its value for the success of a nested domain
From: Nicolin Chen
The struct iommufd_hw_pagetable has been representing a kernel-managed
HWPT, yet soon will be reused to represent a user-managed HWPT. These
two types of HWPTs has the same IOMMUFD object type and an iommu_domain
object, but have quite different attributes/members.
Add a union
On Wed, 20 Sept 2023 at 16:21, Mark Rutland wrote:
>
> Hi Naresh,
>
> As a general thing, for arm64 issues could you please Cc the linux-arm-kernel
> mailing list?
>
> On Wed, Sep 20, 2023 at 02:40:24PM +0200, Naresh Kamboju wrote:
> > Following selftests: user_events: ftrace_test running on arm64
From: Lu Baolu
The nested domain fields are exclusive to those that used for a DMA
remapping domain. Use union to avoid memory waste.
Reviewed-by: Kevin Tian
Signed-off-by: Lu Baolu
Signed-off-by: Yi Liu
---
drivers/iommu/intel/iommu.h | 35 +--
1 file changed
On Wed, Sep 20, 2023 at 01:46:02PM +0300, Nikolay Aleksandrov wrote:
> On 9/19/23 11:12, Johannes Nixdorf wrote:
> > Set any new attributes added to br_policy to be parsed strictly, to
> > prevent userspace from passing garbage.
> >
> > Signed-off-by: Johannes Nixdorf
> > ---
> > net/bridge/br_
Add a configuration file for the mt8192-asurada-spherion platform to
validate that the card and PCMs used for speaker, headphone and
microphones (internal and headset) are correctly exposed to userspace.
Signed-off-by: Nícolas F. R. A. Prado
---
Sending this patch as RFC because I'd like to ask
On Thu, Sep 21, 2023 at 08:10:58PM +0800, Baolu Lu wrote:
> On 2023/9/21 15:51, Yi Liu wrote:
> > +/**
> > + * iommu_copy_user_data - Copy iommu driver specific user space data
> > + * @dst_data: Pointer to an iommu driver specific user data that is
> > defined in
> > + *include/uapi/l
This adds IOMMU_HWPT_TYPE_VTD_S1 for stage-1 hw_pagetable of Intel VT-d
and the corressponding data structure for userspace specified parameter
for the domain allocation.
Signed-off-by: Yi Liu
---
include/uapi/linux/iommufd.h | 30 ++
1 file changed, 30 insertions(+)
Aboorva Devarajan writes:
> On Wed, 2023-09-13 at 08:54 +1000, Michael Ellerman wrote:
>> Aboorva Devarajan writes:
>> > From: Pratik R. Sampat
>> >
>> > Introduce a mechanism to fire directed IPIs from a source CPU to a
>> > specified target CPU and measure the time incurred on waking up the
>
On Thu, Sep 21, 2023 at 11:17 AM David Hildenbrand wrote:
>
> On 21.09.23 20:04, Suren Baghdasaryan wrote:
> > On Thu, Sep 14, 2023 at 6:45 PM David Hildenbrand wrote:
> >>
> >> On 14.09.23 20:43, David Hildenbrand wrote:
> >>> On 14.09.23 20:11, Matthew Wilcox wrote:
> On Thu, Sep 14, 2023
On 2023/9/22 3:50, Rae Moar wrote:
> On Wed, Sep 20, 2023 at 9:41 PM 'Jinjie Ruan' via KUnit Development
> wrote:
>>
>> When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and
>> CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected.
>>
>> If kunit_filter_suites() succe
58 matches
Mail list logo