Re: [PATCH 2/4] fortify: test: Use kunit_device

2023-12-07 Thread David Gow
On Thu, 7 Dec 2023 at 05:07, Kees Cook wrote: > > On Tue, Dec 05, 2023 at 03:31:34PM +0800, david...@google.com wrote: > > Using struct root_device to create fake devices for tests is something > > of a hack. The new struct kunit_device is meant for this purpose, so use > > it instead. > > > >

Re: [PATCH v2 2/6] iommufd: Add iommu page fault uapi data

2023-12-07 Thread Baolu Lu
On 12/1/23 11:14 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:26AM +0800, Lu Baolu wrote: + * @IOMMU_HWPT_ALLOC_IOPF_CAPABLE: User is capable of handling IO page faults. This does not seem like the best name? Probably like this given my remark in the cover letter: ---

Re: [PATCH v2 1/6] iommu: Add iommu page fault cookie helpers

2023-12-07 Thread Baolu Lu
On 12/1/23 10:38 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:25AM +0800, Lu Baolu wrote: +void *iopf_pasid_cookie_get(struct device *dev, ioasid_t pasid) +{ + struct iommu_fault_param *iopf_param = iopf_get_dev_fault_param(dev); + void *curr; + + if (!iopf_param)

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-07 Thread Baolu Lu
On 12/1/23 10:24 PM, Jason Gunthorpe wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space through the IOMMUFD framework for nested translation. Nested translation is a hardware feature

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Baolu Lu
On 12/8/23 1:17 AM, Jason Gunthorpe wrote: On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct hw_pgtable_fault *fault) WARN_ON(!list_empty(>deliver)); WARN_ON(!list_empty(>response)); +

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-07 Thread Baolu Lu
On 12/4/23 11:07 PM, Joel Granados wrote: On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: Hi folks, This series implements the functionality of delivering IO page faults to user space through the IOMMUFD framework for nested translation. Nested Does this mean the IOPF_CAPABLE HWPT

Re: [PATCH v1] KVM: selftests: Fix Assertion on non-x86_64 platforms

2023-12-07 Thread Gavin Shan
On 12/8/23 13:35, Shaoqin Huang wrote: When running the set_memory_region_test on arm64 platform, it causes the below assert: Test Assertion Failure set_memory_region_test.c:355: r && errno == EINVAL pid=40695 tid=40695 errno=0 - Success 1 0x00401baf:

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Yonghong Song
On 12/7/23 5:08 PM, Kyle Huey wrote: On Thu, Dec 7, 2023 at 2:56 PM Kyle Huey wrote: On Thu, Dec 7, 2023 at 11:20 AM Marco Elver wrote: On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko wrote: On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: The test sets a hardware breakpoint and uses a bpf

[PATCH v1] KVM: selftests: Fix Assertion on non-x86_64 platforms

2023-12-07 Thread Shaoqin Huang
When running the set_memory_region_test on arm64 platform, it causes the below assert: Test Assertion Failure set_memory_region_test.c:355: r && errno == EINVAL pid=40695 tid=40695 errno=0 - Success 1 0x00401baf: test_invalid_memory_region_flags at

Re: [PATCH v2 2/2] kunit: tool: add test for parsing attributes

2023-12-07 Thread David Gow
On Fri, 8 Dec 2023 at 05:34, Rae Moar wrote: > > Add test for parsing attributes to kunit_tool_test.py. Test checks > attributes are parsed and saved in the test logs. > > This test also checks that the attributes have not interfered with the > parsing of other test information, specifically the

Re: [PATCH v2 1/2] kunit: tool: fix parsing of test attributes

2023-12-07 Thread David Gow
On Fri, 8 Dec 2023 at 05:34, Rae Moar wrote: > > Add parsing of attributes as diagnostic data. Fixes issue with test plan > being parsed incorrectly as diagnostic data when located after > suite-level attributes. > > Note that if there does not exist a test plan line, the diagnostic lines >

Re: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED

2023-12-07 Thread Chao Gao
On Thu, Dec 07, 2023 at 06:09:46PM +0800, Li, Xin3 wrote: >> >> > Exiting-event identification can also have bit 13 set, indicating a >> >> > nested exception encountered and caused VM-exit. when reinjecting the >> >> > exception to guests, kvm needs to set the "nested" bit, right? I >> >> >

Re: [net-next v1 00/16] Device Memory TCP

2023-12-07 Thread Mina Almasry
On Thu, Dec 7, 2023 at 4:52 PM Mina Almasry wrote: > > Major changes in v1: > -- > > 1. Implemented MVP queue API ndos to remove the userspace-visible >driver reset. > > 2. Fixed issues in the napi_pp_put_page() devmem frag unref path. > > 3. Removed RFC tag. > > Many smaller

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Kyle Huey
On Thu, Dec 7, 2023 at 2:56 PM Kyle Huey wrote: > > On Thu, Dec 7, 2023 at 11:20 AM Marco Elver wrote: > > > > On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko > > wrote: > > > > > > On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: > > > > > > > > The test sets a hardware breakpoint and uses a bpf

[net-next v1 15/16] net: add devmem TCP documentation

2023-12-07 Thread Mina Almasry
Signed-off-by: Mina Almasry --- Documentation/networking/devmem.rst | 270 1 file changed, 270 insertions(+) create mode 100644 Documentation/networking/devmem.rst diff --git a/Documentation/networking/devmem.rst b/Documentation/networking/devmem.rst new file mode

[net-next v1 16/16] selftests: add ncdevmem, netcat for devmem TCP

2023-12-07 Thread Mina Almasry
ncdevmem is a devmem TCP netcat. It works similarly to netcat, but it sends and receives data using the devmem TCP APIs. It uses udmabuf as the dmabuf provider. It is compatible with a regular netcat running on a peer, or a ncdevmem running on a peer. In addition to normal netcat support,

[net-next v1 13/16] tcp: RX path for devmem TCP

2023-12-07 Thread Mina Almasry
In tcp_recvmsg_locked(), detect if the skb being received by the user is a devmem skb. In this case - if the user provided the MSG_SOCK_DEVMEM flag - pass it to tcp_recvmsg_devmem() for custom handling. tcp_recvmsg_devmem() copies any data in the skb header to the linear buffer, and returns a

[net-next v1 12/16] net: add support for skbs with unreadable frags

2023-12-07 Thread Mina Almasry
For device memory TCP, we expect the skb headers to be available in host memory for access, and we expect the skb frags to be in device memory and unaccessible to the host. We expect there to be no mixing and matching of device memory frags (unaccessible) with host memory frags (accessible) in the

[net-next v1 14/16] net: add SO_DEVMEM_DONTNEED setsockopt to release RX frags

2023-12-07 Thread Mina Almasry
Add an interface for the user to notify the kernel that it is done reading the devmem dmabuf frags returned as cmsg. The kernel will drop the reference on the frags to make them available for re-use. Signed-off-by: Willem de Bruijn Signed-off-by: Kaiyuan Zhang Signed-off-by: Mina Almasry ---

[net-next v1 11/16] net: support non paged skb frags

2023-12-07 Thread Mina Almasry
Make skb_frag_page() fail in the case where the frag is not backed by a page, and fix its relevant callers to handle this case. Correctly handle skb_frag refcounting in the page_pool_iovs case. Signed-off-by: Mina Almasry --- Changes in v1: - Fix illegal_highdma() (Yunsheng). - Rework

[net-next v1 09/16] page_pool: device memory support

2023-12-07 Thread Mina Almasry
Overload the LSB of struct page* to indicate that it's a page_pool_iov. Refactor mm calls on struct page* into helpers, and add page_pool_iov handling on those helpers. Modify callers of these mm APIs with calls to these helpers instead. In areas where struct page* is dereferenced, add a check

[net-next v1 10/16] page_pool: don't release iov on elevanted refcount

2023-12-07 Thread Mina Almasry
Currently the page_pool behavior is that a page is considered for recycling only once, the first time __page_pool_put_page() is called on it. This works because in practice the net stack only holds 1 reference to the skb frags. In that case, the page_pool recycling works as expected, as the skb

[net-next v1 08/16] memory-provider: dmabuf devmem memory provider

2023-12-07 Thread Mina Almasry
Implement a memory provider that allocates dmabuf devmem page_pool_iovs. The provider receives a reference to the struct netdev_dmabuf_binding via the pool->mp_priv pointer. The driver needs to set this pointer for the provider in the page_pool_params. The provider obtains a reference on the

[net-next v1 07/16] netdev: netdevice devmem allocator

2023-12-07 Thread Mina Almasry
Implement netdev devmem allocator. The allocator takes a given struct netdev_dmabuf_binding as input and allocates page_pool_iov from that binding. The allocation simply delegates to the binding's genpool for the allocation logic and wraps the returned memory region in a page_pool_iov struct.

[net-next v1 06/16] netdev: support binding dma-buf to netdevice

2023-12-07 Thread Mina Almasry
Add a netdev_dmabuf_binding struct which represents the dma-buf-to-netdevice binding. The netlink API will bind the dma-buf to rx queues on the netdevice. On the binding, the dma_buf_attach & dma_buf_map_attachment will occur. The entries in the sg_table from mapping will be inserted into a

[net-next v1 05/16] net: netdev netlink api to bind dma-buf to a net device

2023-12-07 Thread Mina Almasry
API takes the dma-buf fd as input, and binds it to the netdevice. The user can specify the rx queues to bind the dma-buf to. Suggested-by: Stanislav Fomichev Signed-off-by: Mina Almasry --- Changes in v1: - Add rx-queue-type to distingish rx from tx (Jakub) - Return dma-buf ID from netlink

[net-next v1 04/16] gve: implement queue api

2023-12-07 Thread Mina Almasry
Define a struct that contains all of the memory needed for an RX queue to function. Implement the queue-api in GVE using this struct. Currently the only memory is allocated at the time of queue start are the RX pages in gve_rx_post_buffers_dqo(). That can be moved up to queue_mem_alloc() time in

[net-next v1 03/16] queue_api: define queue api

2023-12-07 Thread Mina Almasry
This API enables the net stack to reset the queues used for devmem. Signed-off-by: Mina Almasry --- include/linux/netdevice.h | 24 1 file changed, 24 insertions(+) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1b935ee341b4..316f7dee86ce

[net-next v1 02/16] net: page_pool: create hooks for custom page providers

2023-12-07 Thread Mina Almasry
From: Jakub Kicinski The page providers which try to reuse the same pages will need to hold onto the ref, even if page gets released from the pool - as in releasing the page from the pp just transfers the "ownership" reference from pp to the provider, and provider will wait for other references

[net-next v1 01/16] net: page_pool: factor out releasing DMA from releasing the page

2023-12-07 Thread Mina Almasry
From: Jakub Kicinski Releasing the DMA mapping will be useful for other types of pages, so factor it out. Make sure compiler inlines it, to avoid any regressions. Signed-off-by: Jakub Kicinski Signed-off-by: Mina Almasry --- This is implemented by Jakub in his RFC:

[net-next v1 00/16] Device Memory TCP

2023-12-07 Thread Mina Almasry
Major changes in v1: -- 1. Implemented MVP queue API ndos to remove the userspace-visible driver reset. 2. Fixed issues in the napi_pp_put_page() devmem frag unref path. 3. Removed RFC tag. Many smaller addressed comments across all the patches (patches have individual change

Re: [PATCH v8 5/6] selftests: cgroup: update per-memcg zswap writeback selftest

2023-12-07 Thread Chris Li
Hi Nhat, Thanks for the self test. Acked-by: Chris Li (Google) Chris On Thu, Nov 30, 2023 at 11:40 AM Nhat Pham wrote: > > From: Domenico Cerasuolo > > The memcg-zswap self test is updated to adjust to the behavior change > implemented by commit 87730b165089 ("zswap: make shrinking

Re: [PATCH v8 4/6] mm: memcg: add per-memcg zswap writeback stat (fix)

2023-12-07 Thread Chris Li
Acked-by: Chris Li (Google) Chris On Tue, Dec 5, 2023 at 11:33 AM Nhat Pham wrote: > > Rename ZSWP_WB to ZSWPWB to better match the existing counters naming > scheme. > > Suggested-by: Johannes Weiner > Signed-off-by: Nhat Pham > --- > include/linux/vm_event_item.h | 2 +- > mm/memcontrol.c

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Kyle Huey
On Thu, Dec 7, 2023 at 11:20 AM Marco Elver wrote: > > On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko > wrote: > > > > On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: > > > > > > The test sets a hardware breakpoint and uses a bpf program to suppress the > > > side effects of a perf event sample,

[PATCH v2 1/2] kunit: tool: fix parsing of test attributes

2023-12-07 Thread Rae Moar
Add parsing of attributes as diagnostic data. Fixes issue with test plan being parsed incorrectly as diagnostic data when located after suite-level attributes. Note that if there does not exist a test plan line, the diagnostic lines between the suite header and the first result will be saved in

[PATCH v2 2/2] kunit: tool: add test for parsing attributes

2023-12-07 Thread Rae Moar
Add test for parsing attributes to kunit_tool_test.py. Test checks attributes are parsed and saved in the test logs. This test also checks that the attributes have not interfered with the parsing of other test information, specifically the suite header as the test plan was being incorrectely

Re: [PATCH] maple_tree: Fix mas_prev() state separation code

2023-12-07 Thread Kees Cook
On Thu, Dec 07, 2023 at 02:33:19PM -0500, Liam R. Howlett wrote: > mas_prev() was setting the ma_underflow condition when the limit was > reached and not when the limit was attempting to go lower. This > resulted in the incorrect behaviour on subsequent actions. > > This commit fixes the status

Re: [PATCH v3 3/3] kselftest: Add new test for detecting unprobed Devicetree devices

2023-12-07 Thread Mark Brown
On Mon, Aug 28, 2023 at 05:13:12PM -0400, Nícolas F. R. A. Prado wrote: > Introduce a new kselftest to detect devices that were declared in the > Devicetree, and are expected to be probed by a driver, but weren't. I've been running this in my personal CI for a little while now and I'm finding

[PATCH] maple_tree: Fix mas_prev() state separation code

2023-12-07 Thread Liam R. Howlett
mas_prev() was setting the ma_underflow condition when the limit was reached and not when the limit was attempting to go lower. This resulted in the incorrect behaviour on subsequent actions. This commit fixes the status setting to only set ma_underflow when the lower limit is attempted to be

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Marco Elver
On Thu, 7 Dec 2023 at 20:12, Andrii Nakryiko wrote: > > On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: > > > > The test sets a hardware breakpoint and uses a bpf program to suppress the > > side effects of a perf event sample, including I/O availability signals, > > SIGTRAPs, and decrementing

Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2023-12-07 Thread mpdesouza
On Thu, 2023-12-07 at 10:20 -0500, Joe Lawrence wrote: > On 12/6/23 10:05, Miroslav Benes wrote: > > On Fri, 1 Dec 2023, Joe Lawrence wrote: > > > > > On Tue, Oct 31, 2023 at 06:10:52PM -0300, Marcos Paulo de Souza > > > wrote: > > > > The modules are being moved from lib/livepatch to > > > >

Re: [PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Andrii Nakryiko
On Thu, Dec 7, 2023 at 8:35 AM Kyle Huey wrote: > > The test sets a hardware breakpoint and uses a bpf program to suppress the > side effects of a perf event sample, including I/O availability signals, > SIGTRAPs, and decrementing the event counter limit, if the ip matches the > expected value.

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Reinette Chatre
On 12/7/2023 10:33 AM, Ilpo Järvinen wrote: > > I already spent some moments in converting all return error -> return -1, > since all such places do perror() calls anyway (which I also converted to > ksft_perror() or ksft_print_msg() where perror() didn't make any sense) > there's not much

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Ilpo Järvinen
On Thu, 7 Dec 2023, Reinette Chatre wrote: > On 12/7/2023 6:32 AM, Ilpo Järvinen wrote: > > On Tue, 28 Nov 2023, Reinette Chatre wrote: > >> On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > > ... > >>> - /* > >>> - * Measure llc occupancy from resctrl. > >>> - */ > >>> - if

[PATCH] selftests: timers: clocksource-switch: Adapt progress to kselftest framework

2023-12-07 Thread Geert Uytterhoeven
When adapting the test to the kselftest framework, a few printf() calls indicating test progress were not updated. Fix this by replacing these printf() calls by ksft_print_msg() calls. Fixes: ce7d101750ff8450 ("selftests: timers: clocksource-switch: adapt to kselftest framework") Signed-off-by:

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Reinette Chatre
Hi Ilpo, On 12/7/2023 6:32 AM, Ilpo Järvinen wrote: > On Tue, 28 Nov 2023, Reinette Chatre wrote: >> On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: ... >>> - /* >>> -* Measure llc occupancy from resctrl. >>> -*/ >>> - if (!strncmp(param->resctrl_val, CMT_STR, sizeof(CMT_STR))) { >>> -

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Jason Gunthorpe
On Thu, Dec 07, 2023 at 05:34:10PM +0100, Joel Granados wrote: > > @@ -58,6 +255,8 @@ static void hw_pagetable_fault_free(struct > > hw_pgtable_fault *fault) > > WARN_ON(!list_empty(>deliver)); > > WARN_ON(!list_empty(>response)); > > > > + fput(fault->fault_file); > > +

[PATCH v2 3/3] selftest/bpf: Test a perf bpf program that suppresses side effects.

2023-12-07 Thread Kyle Huey
The test sets a hardware breakpoint and uses a bpf program to suppress the side effects of a perf event sample, including I/O availability signals, SIGTRAPs, and decrementing the event counter limit, if the ip matches the expected value. Then the function with the breakpoint is executed multiple

Re: [PATCH v2 4/6] iommufd: Deliver fault messages to user space

2023-12-07 Thread Joel Granados
On Thu, Oct 26, 2023 at 10:49:28AM +0800, Lu Baolu wrote: > Add the file interface that provides a simple and efficient way for > userspace to handle page faults. The file interface allows userspace > to read fault messages sequentially, and to respond to the handling > result by writing to the

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Mark Brown
On Thu, Dec 07, 2023 at 02:06:34PM +, Marc Zyngier wrote: > Mark Brown wrote: > > > > @@ -517,7 +519,6 @@ struct kvm_vcpu_arch { > > > > enum fp_type fp_type; > > > > unsigned int sve_max_vl; > > > > u64 svcr; > > > > - u64 fpmr; > > > Why do this change here?

Re: [PATCH v3 11/25] arm64: enable ARCH_HAS_PKEYS on arm64

2023-12-07 Thread Joey Gouly
Hi, Thanks to you and Mark for the comments so far! On Thu, Dec 07, 2023 at 03:25:17PM +, Catalin Marinas wrote: > On Fri, Nov 24, 2023 at 04:34:56PM +, Joey Gouly wrote: > > diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h > > new file mode 100644 > > index

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-07 Thread David Ahern
On 12/7/23 3:34 AM, Petr Machata wrote: > But what I object against is that the library uses trap without having a > way for user scripts to schedule at-exit work, because that's used > literally everywhere in forwarding tests. +1

Re: [PATCH v3 11/25] arm64: enable ARCH_HAS_PKEYS on arm64

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:56PM +, Joey Gouly wrote: > diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h > new file mode 100644 > index ..5761fb48fd53 > --- /dev/null > +++ b/arch/arm64/include/asm/pkeys.h > @@ -0,0 +1,54 @@ > +/*

Re: [PATCH v3 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2023-12-07 Thread Joe Lawrence
On 12/6/23 10:05, Miroslav Benes wrote: > On Fri, 1 Dec 2023, Joe Lawrence wrote: > >> On Tue, Oct 31, 2023 at 06:10:52PM -0300, Marcos Paulo de Souza wrote: >>> The modules are being moved from lib/livepatch to >>> tools/testing/selftests/livepatch/test_modules. >>> >>> This code moving will

Re: [PATCH v2 19/26] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-12-07 Thread Ilpo Järvinen
On Tue, 28 Nov 2023, Reinette Chatre wrote: > On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > > CAT test spawns two processes into two different control groups with > > exclusive schemata. Both the processes alloc a buffer from memory > > matching their allocated LLC block size and flush the entire

Re: [PATCH v3 10/25] arm64: mask out POIndex when modifying a PTE

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:55PM +, Joey Gouly wrote: > When a PTE is modified, the POIndex must be masked off so that it can be > modified. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Reviewed-by: Catalin Marinas

Re: [PATCH v3 09/25] arm64: define VM_PKEY_BIT* for arm64

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:54PM +, Joey Gouly wrote: > arch/arm64/include/asm/mman.h | 8 +++- > arch/arm64/include/asm/page.h | 10 ++ > arch/arm64/mm/mmap.c| 9 + > arch/powerpc/include/asm/page.h | 11 +++ > arch/x86/include/asm/page.h |

Re: [PATCH v2 17/26] selftests/resctrl: Replace file write with volatile variable

2023-12-07 Thread Ilpo Järvinen
On Tue, 28 Nov 2023, Reinette Chatre wrote: > On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > > The fill_buf code prevents compiler optimizating the entire read loop > > away by writing the final value of the variable into a file. While it > > achieves the goal, writing into a file requires

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-07 Thread Jason Gunthorpe
On Thu, Dec 07, 2023 at 09:04:00AM +, Tian, Kevin wrote: > > From: Liu, Yi L > > Sent: Thursday, December 7, 2023 2:59 PM > > > > On 2023/11/17 21:07, Yi Liu wrote: > > > @@ -613,4 +614,38 @@ struct iommu_hwpt_get_dirty_bitmap { > > > #define IOMMU_HWPT_GET_DIRTY_BITMAP _IO(IOMMUFD_TYPE, \

Re: [PATCH v2 08/26] selftests/resctrl: Split measure_cache_vals()

2023-12-07 Thread Ilpo Järvinen
On Tue, 28 Nov 2023, Reinette Chatre wrote: > Hi Ilpo, > > On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > > measure_cache_vals() does a different thing depending on the test case > > that called it: > > - For CAT, it measures LLC misses through perf. > > - For CMT, it measures LLC occupancy

Re: [PATCH v3 05/25] arm64: context switch POR_EL0 register

2023-12-07 Thread Mark Brown
On Thu, Dec 07, 2023 at 01:55:31PM +, Catalin Marinas wrote: > On Sat, Nov 25, 2023 at 12:02:49PM +, Mark Brown wrote: > > On Fri, Nov 24, 2023 at 04:34:50PM +, Joey Gouly wrote: > > > +static void flush_poe(void) > > > +{ > > > + if (system_supports_poe()) > > > +

Re: [PATCH v3 07/25] arm64: enable the Permission Overlay Extension for EL0

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:52PM +, Joey Gouly wrote: > +#ifdef CONFIG_ARM64_POE > +static void cpu_enable_poe(const struct arm64_cpu_capabilities *__unused) > +{ > + sysreg_clear_set(REG_TCR2_EL1, 0, TCR2_EL1x_E0POE); > + sysreg_clear_set(CPACR_EL1, 0, CPACR_ELx_E0POE); > +} >

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Marc Zyngier
On Thu, 07 Dec 2023 12:30:45 +, Mark Brown wrote: > > On Thu, Dec 07, 2023 at 08:39:46AM +, Marc Zyngier wrote: > > Mark Brown wrote: > > > > #define HCRX_GUEST_FLAGS \ > > > - (HCRX_EL2_SMPME | HCRX_EL2_TCR2En | \ > > > + (HCRX_EL2_SMPME | HCRX_EL2_TCR2En | HCRX_EL2_EnFPM | \ > > >

Re: [PATCH v2 02/26] selftests/resctrl: Split fill_buf to allow tests finer-grained control

2023-12-07 Thread Ilpo Järvinen
On Tue, 28 Nov 2023, Reinette Chatre wrote: > On 11/20/2023 3:13 AM, Ilpo Järvinen wrote: > > MBM, MBA and CMT test cases call run_fill_buf() that in turn calls > > fill_cache() to alloc and loop indefinitely around the buffer. This > > binds buffer allocation and running the benchmark into a

Re: [PATCH v3 05/25] arm64: context switch POR_EL0 register

2023-12-07 Thread Catalin Marinas
On Sat, Nov 25, 2023 at 12:02:49PM +, Mark Brown wrote: > On Fri, Nov 24, 2023 at 04:34:50PM +, Joey Gouly wrote: > > > +static void flush_poe(void) > > +{ > > + if (system_supports_poe()) > > + write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0); > > +} > > Here we have no isb()...

Re: [PATCH] selftests/hid: fix failing tablet button tests

2023-12-07 Thread Benjamin Tissoires
On Thu, 07 Dec 2023 13:22:39 +0100, Benjamin Tissoires wrote: > An overlook from commit 74452d6329be ("selftests/hid: tablets: add > variants of states with buttons"), where I don't use the Enum... > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.8/selftests),

Re: [PATCH v3 05/25] arm64: context switch POR_EL0 register

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:50PM +, Joey Gouly wrote: > @@ -498,6 +508,17 @@ static void erratum_1418040_new_exec(void) > preempt_enable(); > } > > +static void permission_overlay_switch(struct task_struct *next) > +{ > + if (system_supports_poe()) { > +

Re: [PATCH v3 04/25] arm64: disable trapping of POR_EL0 to EL2

2023-12-07 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:49PM +, Joey Gouly wrote: > Allow EL0 or EL1 to access POR_EL0 without being trapped to EL2. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon Acked-by: Catalin Marinas

Re: [PATCH] selftests/hid: fix failing tablet button tests

2023-12-07 Thread Jiri Kosina
On Thu, 7 Dec 2023, Benjamin Tissoires wrote: > An overlook from commit 74452d6329be ("selftests/hid: tablets: add > variants of states with buttons"), where I don't use the Enum... > > Fixes: 74452d6329be ("selftests/hid: tablets: add variants of states with > buttons") > Signed-off-by:

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Mark Brown
On Thu, Dec 07, 2023 at 08:39:46AM +, Marc Zyngier wrote: > Mark Brown wrote: > > #define HCRX_GUEST_FLAGS \ > > - (HCRX_EL2_SMPME | HCRX_EL2_TCR2En | \ > > + (HCRX_EL2_SMPME | HCRX_EL2_TCR2En | HCRX_EL2_EnFPM | \ > We really should start making all of these things conditional. See >

[PATCH] selftests/hid: fix failing tablet button tests

2023-12-07 Thread Benjamin Tissoires
e None +button = BtnPressed(ev.code) if ev.value else None # the kernel tends to insert an EV_SYN once removing the tool, so # the button will be released after --- base-commit: f556aa957df8cb3e98af0f54bf1fa65f59ae47a3 change-id: 20231207-b4-wip-selftests-c1565d4d45

Re: [PATCHv3 net-next 01/14] selftests/net: add lib.sh

2023-12-07 Thread Petr Machata
Paolo Abeni writes: > On Wed, 2023-12-06 at 13:32 +0100, Petr Machata wrote: >> Paolo Abeni writes: >> >> > Side note for a possible follow-up: if you maintain $ns_list as global >> > variable, and remove from such list the ns deleted by cleanup_ns, you >> > could remove the cleanup trap

RE: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED

2023-12-07 Thread Li, Xin3
> >> > Exiting-event identification can also have bit 13 set, indicating a > >> > nested exception encountered and caused VM-exit. when reinjecting the > >> > exception to guests, kvm needs to set the "nested" bit, right? I > >> > suspect some changes to e.g., handle_exception_nmi() are needed. >

RE: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-07 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Thursday, December 7, 2023 2:59 PM > > On 2023/11/17 21:07, Yi Liu wrote: > > @@ -613,4 +614,38 @@ struct iommu_hwpt_get_dirty_bitmap { > > #define IOMMU_HWPT_GET_DIRTY_BITMAP _IO(IOMMUFD_TYPE, \ > > > IOMMUFD_CMD_HWPT_GET_DIRTY_BITMAP) > > > > +/** > > + *

Re: [PATCH v2 00/15] selftests/hid: tablets fixes

2023-12-07 Thread Benjamin Tissoires
On Thu, Dec 7, 2023 at 9:53 AM Benjamin Tissoires wrote: > > On Wed, 06 Dec 2023 11:45:51 +0100, Benjamin Tissoires wrote: > > the main trigger of this series was the XP-Pen issue[0]. > > Basically, the tablets tests were good-ish but couldn't > > handle that tablet both in terms of emulation or

Re: [PATCH v2 00/15] selftests/hid: tablets fixes

2023-12-07 Thread Benjamin Tissoires
On Wed, 06 Dec 2023 11:45:51 +0100, Benjamin Tissoires wrote: > the main trigger of this series was the XP-Pen issue[0]. > Basically, the tablets tests were good-ish but couldn't > handle that tablet both in terms of emulation or in terms > of detection of issues. > > So rework the tablets test a

RE: [PATCH 3/3] vfio: Report PASID capability via VFIO_DEVICE_FEATURE ioctl

2023-12-07 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Monday, November 27, 2023 2:39 PM > > +static int vfio_pci_core_feature_pasid(struct vfio_device *device, u32 flags, > +struct vfio_device_feature_pasid __user > *arg, > +size_t argsz) > +{ > +

Re: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED

2023-12-07 Thread Chao Gao
On Wed, Dec 06, 2023 at 04:37:39PM +0800, Li, Xin3 wrote: >> Subject: RE: [PATCH v1 13/23] KVM: VMX: Handle VMX nested exception for FRED >> >> > >+ if (idt_vectoring_info & >> VECTORING_INFO_DELIVER_CODE_MASK) >> > >+ kvm_requeue_exception_e(vcpu, vector, >> >

Re: [PATCH v3 15/21] KVM: arm64: Support FEAT_FPMR for guests

2023-12-07 Thread Marc Zyngier
On Tue, 05 Dec 2023 16:48:13 +, Mark Brown wrote: > > FEAT_FPMR introduces a new system register FPMR which allows configuration > of floating point behaviour, currently for FP8 specific features. Allow use > of this in guests, disabling the trap while guests are running and saving > and