Re: [PATCH v2 00/11] perf/uprobe: Optimize uprobes

2024-07-26 Thread Andrii Nakryiko
On Fri, Jul 19, 2024 at 11:42 AM Andrii Nakryiko wrote: > > On Mon, Jul 15, 2024 at 11:10 AM Andrii Nakryiko > wrote: > > > > On Mon, Jul 15, 2024 at 10:10 AM Andrii Nakryiko > > wrote: > > > > > > On Mon, Jul 15, 2024 at 7:45 AM Peter Zijlstra > > > wrote: > > > > > > > > On Thu, Jul 11, 2024

Re: [PATCH 00/15] Implement MODVERSIONS for Rust

2024-07-26 Thread Sami Tolvanen
Hi Petr, On Mon, Jul 22, 2024 at 8:20 AM Petr Pavlu wrote: > > From my perspective, I'm okay if gendwarfksyms doesn't provide > functionality to compare a new object file with its reference symtypes > file. > > As mentioned, genksyms has this functionality but I actually think the > way it works

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Steven Rostedt
On Fri, 26 Jul 2024 21:58:30 +0200 Mathias Krause wrote: > >> > >> IMHO, this needs at least the following additional fixes tags to ensure > >> all stable kernels get covered: > >> > >> Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use > >> eventfs_inode") > >> Fixes: 27152bceea1d ("

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Mathias Krause
On 26.07.24 16:52, Steven Rostedt wrote: > On Fri, 26 Jul 2024 12:16:16 +0200 > Mathias Krause wrote: > >>> >>> With KASAN memory checking, it would trigger a use-after-free bug. This was >>> >> >> The UAF bug is there even without KASAN. It's just that KASAN makes it >> much easier to detect

[PATCH v2 2/2] x86/vmware: VMware support for TDX userspace hypercalls

2024-07-26 Thread Tim Merrifield
This change adds a handler for tdx_hcall in the x86_hyper_runtime type for VMware hypervisors which will ultimately invoke __tdx_hypercall. The handler (vmware_tdx_user_hcall) does not reuse the existing vmware_tdx_hypercall for a couple of reasons. First, while the few hypercalls that are invoked

[PATCH v2 1/2] Add prctl to allow userlevel TDX hypercalls

2024-07-26 Thread Tim Merrifield
Add a new process-level prctl option to enable/disable user-level hypercalls when running in a confidential VM. Add support for checking this flag on VMCALL #VE for TDX and transfer control to a hypervisor vendor-specific handler. Signed-off-by: Tim Merrifield --- arch/x86/coco/tdx/tdx.c

[PATCH v2 0/2] Support userspace hypercalls for TDX

2024-07-26 Thread Tim Merrifield
Hypercall instructions like VMCALL and VMMCALL are not restricted to CPL 0. This allows userspace software like open-vm-tools to communicate directly with the VMM. For TDX VMs, this communication may violate the security model. Today, VMCALLs are not forwarded to the host VMM, which breaks open-vm

[PATCH] tracing: Use refcount for trace_event_file reference counter

2024-07-26 Thread Steven Rostedt
From: Steven Rostedt Instead of using an atomic counter for the trace_event_file reference counter, use the refcount interface. It has various checks to make sure the reference counting is correct, and will warn if it detects an error (like refcount_inc() on '0'). Signed-off-by: Steven Rostedt (

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On 26 July 2024 17:49:58 BST, Jonathan Cameron wrote: >On Thu, 25 Jul 2024 14:50:50 +0100 >David Woodhouse wrote: > >> On Thu, 2024-07-25 at 08:33 -0400, Michael S. Tsirkin wrote: >> > On Thu, Jul 25, 2024 at 01:31:19PM +0100, David Woodhouse wrote: >> > > On Thu, 2024-07-25 at 08:29 -0400, Mi

[PATCH v2] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Steven Rostedt
From: Steven Rostedt When eventfs was introduced, special care had to be done to coordinate the freeing of the file meta data with the files that are exposed to user space. The file meta data would have a ref count that is set when the file is created and would be decremented and freed after the

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Jonathan Cameron
On Thu, 25 Jul 2024 14:50:50 +0100 David Woodhouse wrote: > On Thu, 2024-07-25 at 08:33 -0400, Michael S. Tsirkin wrote: > > On Thu, Jul 25, 2024 at 01:31:19PM +0100, David Woodhouse wrote: > > > On Thu, 2024-07-25 at 08:29 -0400, Michael S. Tsirkin wrote: > > > > On Thu, Jul 25, 2024 at 01:2

Re: [PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On 26 July 2024 15:57:34 BST, Jakub Kicinski wrote: >On Fri, 26 Jul 2024 13:28:17 +0100 David Woodhouse wrote: >> +` status = acpi_walk_resources(adev->handle, METHOD_NAME__CRS, > > ^ watch out for ticks! Oops, that last minute space->tab fix after I'd already left home for the weekend w

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Steven Rostedt
On Fri, 26 Jul 2024 18:00:18 +0530 Ajay Kaher wrote: > Some doubt: > Because of the same race condition, it may happen that kmem_cache_free(file) > was executed while f_start() is waiting to get event_mutex. Once > f_start() acquires > event_mutex, it will access the *file which points to the fre

Re: [PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Jakub Kicinski
On Fri, 26 Jul 2024 13:28:17 +0100 David Woodhouse wrote: > +` status = acpi_walk_resources(adev->handle, METHOD_NAME__CRS, ^ watch out for ticks!

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Steven Rostedt
On Fri, 26 Jul 2024 12:16:16 +0200 Mathias Krause wrote: > > > > With KASAN memory checking, it would trigger a use-after-free bug. This was > > > > The UAF bug is there even without KASAN. It's just that KASAN makes it > much easier to detect and catch early. Well the bug happens without K

Re: [PATCH v2 1/2] nvdimm: Fix devs leaks in scan_labels()

2024-07-26 Thread Ira Weiny
Li Zhijian wrote: > The leakage would happend when create_namespace_pmem() meets an invalid > label which gets failure in validating isetcookie. > > Try to resuse the devs that may have already been allocated with size > (2 * sizeof(dev)) previously. > > A kmemleak reports: > unreferenced object

Re: [PATH v6 3/3] vdpa/mlx5: Add the support of set mac address

2024-07-26 Thread Cindy Lu
On Fri, 26 Jul 2024 at 01:32, Joe Damato wrote: > > On Thu, Jul 25, 2024 at 09:31:04AM +0800, Cindy Lu wrote: > > Add the function to support setting the MAC address. > > For vdpa/mlx5, the function will use mlx5_mpfs_add_mac > > to set the mac address > > > > Tested in ConnectX-6 Dx device > > >

Re: [PATH v6 1/3] vdpa: support set mac address from vdpa tool

2024-07-26 Thread Cindy Lu
On Fri, 26 Jul 2024 at 01:29, Joe Damato wrote: > > On Thu, Jul 25, 2024 at 09:31:02AM +0800, Cindy Lu wrote: > [...] > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > > index 8d391947eb8d..532cf3b52b26 100644 > > --- a/drivers/vdpa/vdpa.c > > +++ b/drivers/vdpa/vdpa.c > > @@ -1361,6 +1

Re: [PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 09:14 -0400, Michael S. Tsirkin wrote: > For purposes of virtio, should we label all the fields here > __le? Yes. Peter and I discussed that, and it's mostly just a cosmetic change at this point. The simple ACPI thing only exists on LE platforms for *now* anyway. We also had

Re: [PATH v6 1/3] vdpa: support set mac address from vdpa tool

2024-07-26 Thread Cindy Lu
On Fri, 26 Jul 2024 at 01:29, Joe Damato wrote: > > On Thu, Jul 25, 2024 at 09:31:02AM +0800, Cindy Lu wrote: > [...] > > diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c > > index 8d391947eb8d..532cf3b52b26 100644 > > --- a/drivers/vdpa/vdpa.c > > +++ b/drivers/vdpa/vdpa.c > > @@ -1361,6 +1

Re: [PATH v6 0/3] vdpa: support set mac address from vdpa tool

2024-07-26 Thread Cindy Lu
On Fri, 26 Jul 2024 at 01:25, Joe Damato wrote: > > On Thu, Jul 25, 2024 at 09:31:01AM +0800, Cindy Lu wrote: > > Add support for setting the MAC address using the VDPA tool. > > This feature will allow setting the MAC address using the VDPA tool. > > For example, in vdpa_sim_net, the implementati

Re: [PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Michael S. Tsirkin
On Fri, Jul 26, 2024 at 01:28:17PM +0100, David Woodhouse wrote: > diff --git a/include/uapi/linux/vmclock-abi.h > b/include/uapi/linux/vmclock-abi.h > new file mode 100644 > index ..7b1b4759363c > --- /dev/null > +++ b/include/uapi/linux/vmclock-abi.h > @@ -0,0 +1,187 @@ > +/* SPDX-Li

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 09:04 -0400, Michael S. Tsirkin wrote: > On Fri, Jul 26, 2024 at 02:00:25PM +0100, David Woodhouse wrote: > > On Fri, 2024-07-26 at 08:52 -0400, Michael S. Tsirkin wrote: > > > On Fri, Jul 26, 2024 at 09:35:51AM +0100, David Woodhouse wrote: > > > > But for this use case, we o

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Michael S. Tsirkin
On Fri, Jul 26, 2024 at 02:00:25PM +0100, David Woodhouse wrote: > On Fri, 2024-07-26 at 08:52 -0400, Michael S. Tsirkin wrote: > > On Fri, Jul 26, 2024 at 09:35:51AM +0100, David Woodhouse wrote: > > > But for this use case, we only need a memory region that the hypervisor > > > can update. We don

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 08:52 -0400, Michael S. Tsirkin wrote: > On Fri, Jul 26, 2024 at 09:35:51AM +0100, David Woodhouse wrote: > > But for this use case, we only need a memory region that the hypervisor > > can update. We don't need any of that complexity of gratuitously > > interrupting all the v

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Michael S. Tsirkin
On Fri, Jul 26, 2024 at 09:35:51AM +0100, David Woodhouse wrote: > But for this use case, we only need a memory region that the hypervisor > can update. We don't need any of that complexity of gratuitously > interrupting all the vCPUs just to ensure that none of them can be > running userspace whil

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 08:47 -0400, Michael S. Tsirkin wrote: > On Fri, Jul 26, 2024 at 09:06:29AM +0100, David Woodhouse wrote: > > That's great. You don't even need it to be per-vCPU if you let the > > hypervisor write directly to the single physical location that's mapped > > to userspace. It can

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread Michael S. Tsirkin
On Fri, Jul 26, 2024 at 09:06:29AM +0100, David Woodhouse wrote: > That's great. You don't even need it to be per-vCPU if you let the > hypervisor write directly to the single physical location that's mapped > to userspace. It can do that before it even starts *running* the vCPUs > after migration.

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Ajay Kaher
On Fri, Jul 26, 2024 at 5:45 AM Steven Rostedt wrote: > > From: Steven Rostedt > > When eventfs was introduced, special care had to be done to coordinate the > freeing of the file meta data with the files that are exposed to user > space. The file meta data would have a ref count that is set when

[PATCH v2] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
From: David Woodhouse The vmclock "device" provides a shared memory region with precision clock information. By using shared memory, it is safe across Live Migration. Like the KVM PTP clock, this can convert TSC-based cross timestamps into KVM clock values. Unlike the KVM PTP clock, it does so o

Re: [PATCH] tracing: Have format file honor EVENT_FILE_FL_FREED

2024-07-26 Thread Mathias Krause
On 26.07.24 02:15, Steven Rostedt wrote: > From: Steven Rostedt > > When eventfs was introduced, special care had to be done to coordinate the > freeing of the file meta data with the files that are exposed to user > space. The file meta data would have a ref count that is set when the file > is

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 02:06 -0400, Michael S. Tsirkin wrote: > On Thu, Jul 25, 2024 at 11:20:56PM +0100, David Woodhouse wrote: > > We're rolling out the AMZNVCLK device for internal use cases, and plan > > to add it in public instances some time later. > > Let's be real. If amazon does something

Re: tracing: user events UAF crash report

2024-07-26 Thread Mathias Krause
On 26.07.24 01:06, Steven Rostedt wrote: > On Thu, 25 Jul 2024 23:32:30 +0200 > Mathias Krause wrote: > >> That was for a single run of >> tools/testing/selftests/user_events/ftrace_test with the read loop of >> /sys/kernel/tracing/events/user_events/__test_event/format in a >> different shell. >

Re: [PATCH] ptp: Add vDSO-style vmclock support

2024-07-26 Thread David Woodhouse
On Fri, 2024-07-26 at 01:55 -0400, Michael S. Tsirkin wrote: > On Fri, Jul 26, 2024 at 01:09:24AM -0400, Michael S. Tsirkin wrote: > > On Thu, Jul 25, 2024 at 10:29:18PM +0100, David Woodhouse wrote: > > > > > > Then can't we fix it by interrupting all CPUs right after LM? > > > > > > > > > > > >

Re: [PATCH net-next v3 3/3] virtio-net: synchronize operstate with admin state on up/down

2024-07-26 Thread Michael S. Tsirkin
On Wed, Jul 10, 2024 at 11:03:42AM +0800, Jason Wang wrote: > On Tue, Jul 9, 2024 at 9:28 PM Michael S. Tsirkin wrote: > > > > On Tue, Jul 09, 2024 at 04:02:14PM +0800, Jason Wang wrote: > > > This patch synchronize operstate with admin state per RFC2863. > > > > > > This is done by trying to togg