Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-09 Thread Jason Gunthorpe
On Fri, Feb 07, 2025 at 10:59:48AM -0800, Nicolin Chen wrote: > On Fri, Feb 07, 2025 at 11:28:01AM -0400, Jason Gunthorpe wrote: > > On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > > > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > > > Yea, I found iopt_reserve

[PATCH v1 10/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-08 Thread Nicolin Chen
For systems that require MSI pages to be mapped into the IOMMU translation the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default recommended IOVA window to place these mappings. However, there is nothing special about this address. And to support the RMR trick in VMM for nested

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Nicolin Chen
On Fri, Feb 07, 2025 at 11:28:01AM -0400, Jason Gunthorpe wrote: > On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > > Yea, I found iopt_reserve_iova() is actually missed entirely... > > > > > > While fixing this,

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Jason Gunthorpe
On Fri, Feb 07, 2025 at 10:30:20AM -0400, Jason Gunthorpe wrote: > On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > > Yea, I found iopt_reserve_iova() is actually missed entirely... > > > > While fixing this, I see a way to turn the OPTIONs back to per- > > idev, if you still prefer

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-07 Thread Jason Gunthorpe
On Thu, Feb 06, 2025 at 08:26:05PM -0800, Nicolin Chen wrote: > Yea, I found iopt_reserve_iova() is actually missed entirely... > > While fixing this, I see a way to turn the OPTIONs back to per- > idev, if you still prefer them to be per-idev(?). Then, we can > check a given input in the set_opti

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-06 Thread Nicolin Chen
On Wed, Jan 29, 2025 at 10:58:00AM -0400, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: > > On 1/11/25 4:32 AM, Nicolin Chen wrote: > > > For systems that require MSI pages to be mapped into the IOMMU translation > > > the IOMMU driver provides an IOMMU_RESV_S

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-02-03 Thread Nicolin Chen
On Thu, Jan 23, 2025 at 10:07:13AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, January 11, 2025 11:32 AM > > > > @@ -294,7 +294,9 @@ struct iommu_ioas_unmap { > > > > /** > > * enum iommufd_option - ioctl(IOMMU_OPTION_RLIMIT_MODE) and > > - * ioc

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 06:49:22PM +0100, Eric Auger wrote: > > If it was overriden inside iommufd then the user told the kernel what > > range to use to override it. I don't need to go back and report back > > to userspace information that it already gave to the kernel.. > > Looks strange to me b

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
On 1/29/25 6:39 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 06:23:33PM +0100, Eric Auger wrote: IIUC the MSI window will then be different when using legacy VFIO assignment and iommufd backend. >>> ? They use the same, iommufd can have userspace override it. Then it >>> will

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 06:23:33PM +0100, Eric Auger wrote: > >> IIUC the MSI window will then be different when using legacy VFIO > >> assignment and iommufd backend. > > ? They use the same, iommufd can have userspace override it. Then it > > will ignore the reserved region. > In current arm-smmu

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
On 1/29/25 3:58 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: >> Hi, >> >> >> On 1/11/25 4:32 AM, Nicolin Chen wrote: >>> For systems that require MSI pages to be mapped into the IOMMU translation >>> the IOMMU driver provides an IOMMU_RESV_SW_MSI rang

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 02:44:12PM +0100, Eric Auger wrote: > Hi, > > > On 1/11/25 4:32 AM, Nicolin Chen wrote: > > For systems that require MSI pages to be mapped into the IOMMU translation > > the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default > > recommended IOVA window

Re: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-29 Thread Eric Auger
Hi, On 1/11/25 4:32 AM, Nicolin Chen wrote: > For systems that require MSI pages to be mapped into the IOMMU translation > the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default > recommended IOVA window to place these mappings. However, there is nothing > special about this a

RE: [PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-23 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, January 11, 2025 11:32 AM > > @@ -294,7 +294,9 @@ struct iommu_ioas_unmap { > > /** > * enum iommufd_option - ioctl(IOMMU_OPTION_RLIMIT_MODE) and > - * ioctl(IOMMU_OPTION_HUGE_PAGES) > + * ioctl(IOMMU_OPTION_HU

[PATCH RFCv2 09/13] iommufd: Add IOMMU_OPTION_SW_MSI_START/SIZE ioctls

2025-01-10 Thread Nicolin Chen
For systems that require MSI pages to be mapped into the IOMMU translation the IOMMU driver provides an IOMMU_RESV_SW_MSI range, which is the default recommended IOVA window to place these mappings. However, there is nothing special about this address. And to support the RMR trick in VMM for nested

Re: [PATCH v3 1/9] KVM: selftests: Decouple SEV ioctls from asserts

2024-10-21 Thread Pratik R. Sampat
Hi Sean, On 10/14/2024 5:18 PM, Sean Christopherson wrote: > On Thu, Sep 05, 2024, Pratik R. Sampat wrote: >> +static inline int __sev_launch_update_data(struct kvm_vm *vm, vm_paddr_t >> gpa, >> + uint64_t hva, uint64_t size) >> { >> struct kvm_sev_laun

Re: [PATCH v3 1/9] KVM: selftests: Decouple SEV ioctls from asserts

2024-10-14 Thread Sean Christopherson
On Thu, Sep 05, 2024, Pratik R. Sampat wrote: > +static inline int __sev_launch_update_data(struct kvm_vm *vm, vm_paddr_t gpa, > +uint64_t hva, uint64_t size) > { > struct kvm_sev_launch_update_data update_data = { > - .uaddr = (unsigned lo

[PATCH v3 1/9] KVM: selftests: Decouple SEV ioctls from asserts

2024-09-05 Thread Pratik R. Sampat
Add variants of sev, sev-es launch path that return the status of the ioctl call instead of asserting for success. This enables both positive and negative testing of the path. No functional impact intended. Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal ---

Re: [PATCH] KVM: x86: document behavior of measurement ioctls with len==0

2021-04-20 Thread Brijesh Singh
On 4/20/21 4:34 AM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini Reviewed-by: Brijesh Singh Thanks > --- > Documentation/virt/kvm/amd-memory-encryption.rst | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/virt/kvm/amd-memory-encryption.rst > b/Documentat

[PATCH] KVM: x86: document behavior of measurement ioctls with len==0

2021-04-20 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- Documentation/virt/kvm/amd-memory-encryption.rst | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/virt/kvm/amd-memory-encryption.rst b/Documentation/virt/kvm/amd-memory-encryption.rst index 469a6308765b..34ce2d1fcb89 100644 --- a/Documentat

[PATCH 19/24] USB: serial: fix return value for unsupported ioctls

2021-04-07 Thread Johan Hovold
Drivers should return -ENOTTY ("Inappropriate I/O control operation") when an ioctl isn't supported, while -EINVAL is used for invalid arguments. Fix up the TIOCMGET, TIOCMSET and TIOCGICOUNT helpers which returned -EINVAL when a USB serial driver did not implement the corresponding methods. Note

[PATCH 2/8] tty: fix return value for unsupported ioctls

2021-04-07 Thread Johan Hovold
Drivers should return -ENOTTY ("Inappropriate I/O control operation") when an ioctl isn't supported, while -EINVAL is used for invalid arguments. Fix up the TIOCMGET, TIOCMSET and TIOCGICOUNT helpers which returned -EINVAL when a tty driver did not implement the corresponding operations. Note tha

[PATCH 8/8] serial: core: return early on unsupported ioctls

2021-04-07 Thread Johan Hovold
Drivers can return -ENOIOCTLCMD when an ioctl is not recognised to tell the upper layers to continue looking for a handler. This is not the case for the RS485 and ISO7816 ioctls whose handlers should return -ENOTTY directly in case a serial driver does not implement the corresponding methods

[PATCH 3/8] tty: fix return value for unsupported termiox ioctls

2021-04-07 Thread Johan Hovold
as recently ripped out by commit e0efb3168d34 ("tty: Remove dead termiox code"). Fix the return value for the unsupported termiox ioctls, which have always returned -EINVAL, by explicitly returning -ENOTTY rather than removing them completely and falling back to the default u

[PATCH v17 05/17] RISC-V: KVM: Implement KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls

2021-04-01 Thread Anup Patel
For KVM RISC-V, we use KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls to access VCPU config and registers from user-space. We have three types of VCPU registers: 1. CONFIG - these are VCPU config and capabilities 2. CORE - these are VCPU general purpose registers 3. CSR- these are VCPU control and

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-28 Thread Miquel Raynal
s write-once. > > MEMSETBADBLOCK modifies the bad block table. > > Fixes: f7e6b19bc764 ("mtd: properly check all write ioctls for permissions") > Signed-off-by: Michael Walle > Reviewed-by: Greg Kroah-Hartman > Acked-by: Rafał Miłecki > Acked-by: Richard Weinberg

Re: [PATCH 1/2] media: v4l2-core: ignore native time32 ioctls on 64-bit

2021-03-25 Thread Hans Verkuil
On 21/03/2021 09:50, Hans Verkuil wrote: > Hi Arnd, >> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c >> b/drivers/media/v4l2-core/v4l2-subdev.c >> index 336133dbc759..9f5573d3b857 100644 >> --- a/drivers/media/v4l2-core/v4l2-subdev.c >> +++ b/drivers/media/v4l2-core/v4l2-subdev.c >> @@ -42

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-22 Thread Richard Weinberger
ot; > Gesendet: Montag, 22. März 2021 17:39:41 > Betreff: Re: [PATCH] mtd: require write permissions for locking and badblock > ioctls > On 03.03.2021 16:57, Michael Walle wrote: >> MEMLOCK, MEMUNLOCK and OTPLOCK modify protection bits. Thus require >> write permission

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-22 Thread Rafał Miłecki
the bad block table. Fixes: f7e6b19bc764 ("mtd: properly check all write ioctls for permissions") Signed-off-by: Michael Walle Should be fine for OpenWrt tools to my best knowledge (and quick testing). Acked-by: Rafał Miłecki

Re: [PATCH 1/2] media: v4l2-core: ignore native time32 ioctls on 64-bit

2021-03-21 Thread Hans Verkuil
Hi Arnd, On 18/03/2021 14:43, Arnd Bergmann wrote: > From: Arnd Bergmann > > Syzbot found that passing ioctl command 0xc0505609 into a 64-bit > kernel from a 32-bit process causes uninitialized kernel memory to > get passed to drivers instead of the user space data: > > BUG: KMSAN: uninit-value

Re: [PATCH 1/2] media: v4l2-core: ignore native time32 ioctls on 64-bit

2021-03-18 Thread Arnd Bergmann
On Thu, Mar 18, 2021 at 4:00 PM Laurent Pinchart wrote: > On Thu, Mar 18, 2021 at 02:43:18PM +0100, Arnd Bergmann wrote: > > v4l2_event vs. v4l2_event32 vs. v4l2_event_time32 vs. > v4l2_event32_time32 is a bit confusing. Do I understand correctly that > the code below runs for the non-compat path,

Re: [PATCH 1/2] media: v4l2-core: ignore native time32 ioctls on 64-bit

2021-03-18 Thread Laurent Pinchart
Hi Arnd, Thank you for the patch. On Thu, Mar 18, 2021 at 02:43:18PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Syzbot found that passing ioctl command 0xc0505609 into a 64-bit > kernel from a 32-bit process causes uninitialized kernel memory to > get passed to drivers instead of the

[PATCH 1/2] media: v4l2-core: ignore native time32 ioctls on 64-bit

2021-03-18 Thread Arnd Bergmann
From: Arnd Bergmann Syzbot found that passing ioctl command 0xc0505609 into a 64-bit kernel from a 32-bit process causes uninitialized kernel memory to get passed to drivers instead of the user space data: BUG: KMSAN: uninit-value in check_array_args drivers/media/v4l2-core/v4l2-ioctl.c:3041 [i

Re: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls

2021-03-11 Thread Nuno Das Neves
...@linux.microsoft.com; Sunil Muthuswamy >> ; nunodasne...@linux.microsoft.com; >> wei@kernel.org; >> Lillian Grassin-Drake ; KY Srinivasan >> >> Subject: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls >> >> Introduce ioctls for getting and setting

Re: [RFC PATCH 10/18] virt/mshv: get and set vcpu registers ioctls

2021-03-08 Thread Nuno Das Neves
On 2/8/2021 11:47 AM, Michael Kelley wrote: > From: Nuno Das Neves Sent: Friday, > November 20, 2020 4:30 PM >> >> Add ioctls for getting and setting virtual processor registers. >> >> Co-developed-by: Lillian Grassin-Drake >> Signed-off-by: Lillian Grass

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-03 Thread Richard Weinberger
- Ursprüngliche Mail - >>> Thanks for auditing the rest of these from my original patch. If this >>> is ok with userspace tools, it's fine with me, but I don't even have >>> this hardware to test with :) >> >> That's my fear. Michael, did you verify? > > I don't know any tools except the

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-03 Thread Michael Walle
; Gesendet: Mittwoch, 3. März 2021 17:08:56 Betreff: Re: [PATCH] mtd: require write permissions for locking and badblock ioctls On Wed, Mar 03, 2021 at 04:57:35PM +0100, Michael Walle wrote: MEMLOCK, MEMUNLOCK and OTPLOCK modify protection bits. Thus require write permission. Depending on t

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-03 Thread Richard Weinberger
: Mittwoch, 3. März 2021 17:08:56 > Betreff: Re: [PATCH] mtd: require write permissions for locking and badblock > ioctls > On Wed, Mar 03, 2021 at 04:57:35PM +0100, Michael Walle wrote: >> MEMLOCK, MEMUNLOCK and OTPLOCK modify protection bits. Thus require >> write permission. De

Re: [PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-03 Thread Greg Kroah-Hartman
s write-once. > > MEMSETBADBLOCK modifies the bad block table. > > Fixes: f7e6b19bc764 ("mtd: properly check all write ioctls for permissions") > Signed-off-by: Michael Walle > --- > drivers/mtd/mtdchar.c | 8 > 1 file changed, 4 insertions(+), 4 delet

[PATCH] mtd: require write permissions for locking and badblock ioctls

2021-03-03 Thread Michael Walle
("mtd: properly check all write ioctls for permissions") Signed-off-by: Michael Walle --- drivers/mtd/mtdchar.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 57c4a2f0b703..30c8273c1eff 100644 --- a/d

RE: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls

2021-02-08 Thread Michael Kelley
oft.com; > wei@kernel.org; > Lillian Grassin-Drake ; KY Srinivasan > > Subject: [RFC PATCH 15/18] virt/mshv: get and set vp state ioctls > > Introduce ioctls for getting and setting guest vcpu emulated LAPIC > state, and xsave data. > > Signed-off-by: Nuno Das Neves

RE: [RFC PATCH 10/18] virt/mshv: get and set vcpu registers ioctls

2021-02-08 Thread Michael Kelley
From: Nuno Das Neves Sent: Friday, November 20, 2020 4:30 PM > > Add ioctls for getting and setting virtual processor registers. > > Co-developed-by: Lillian Grassin-Drake > Signed-off-by: Lillian Grassin-Drake > Signed-off-by: Nuno Das Neves > --- > Documen

[PATCH RFC 4/7] kvm: x86: Add new ioctls for XSAVE extension

2021-02-06 Thread Jing Liu
define KVM_CAP_X86_XSAVE_EXTENSION 191 #ifdef KVM_CAP_IRQ_ROUTING @@ -1462,6 +1463,13 @@ struct kvm_s390_ucas_mapping { /* Available with KVM_CAP_XSAVE */ #define KVM_GET_XSAVE_IOR(KVMIO, 0xa4, struct kvm_xsave) #define KVM_SET_XSAVE _IOW(KVMIO, 0xa5, struct kvm_xsave

Re: [RFC PATCH v6 00/11] media: v4l2: Add extended fmt and buffer ioctls

2021-02-05 Thread Helen Koike
Hello, On 1/14/21 3:07 PM, Helen Koike wrote: > Hello, > > This is v6 of the Extended API for formats and buffers (see below the new > API). > > The new API comes for free for old drivers through the conversion layer, which > is independent of vb2. > > I completly refactored several patches. I

RE: [PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-27 Thread Chen, Mike Ximing
ioctl layer and first three > ioctls > > On Wed, Jan 27, 2021 at 01:59:50PM +, Chen, Mike Ximing wrote: > > > > > -Original Message- > > > From: Greg KH > > > Sent: Wednesday, January 27, 2021 7:29 AM > > > To: Chen, Mike Ximing

[PATCH v10 09/20] dlb: add queue create, reset, get-depth ioctls

2021-01-27 Thread Mike Ximing Chen
Add ioctl commands to create DLB queues and query their depth, and the corresponding scheduling domain reset code to drain the queues when they are no longer in use. When a CPU enqueues a queue entry (QE) to DLB, the QE entry is sent to a DLB queue. These queues hold queue entries (QEs) that have

[PATCH v10 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-27 Thread Mike Ximing Chen
Introduce the dlb device ioctl layer and the first three ioctls: query device version, query available resources, and create a scheduling domain. Also introduce the user-space interface file dlb_user.h. The device version query is designed to allow each DLB device version/type to have its own

Re: [PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-27 Thread Greg KH
ms, Dan J > > ; pierre-louis.boss...@linux.intel.com; Gage Eads > > > > Subject: Re: [PATCH v9 04/20] dlb: add device ioctl layer and first three > > ioctls > > > > On Fri, Jan 22, 2021 at 01:01:22PM -0600, Mike Ximing Chen wrote: > > > --- /dev/null >

RE: [PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-27 Thread Chen, Mike Ximing
: add device ioctl layer and first three > ioctls > > On Fri, Jan 22, 2021 at 01:01:22PM -0600, Mike Ximing Chen wrote: > > --- /dev/null > > +++ b/include/uapi/linux/dlb.h > > @@ -0,0 +1,167 @@ > > +/* SPDX-License-Identifier: GPL-2.0-only */ > > As the b

Re: [PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-27 Thread Greg KH
On Fri, Jan 22, 2021 at 01:01:22PM -0600, Mike Ximing Chen wrote: > --- /dev/null > +++ b/include/uapi/linux/dlb.h > @@ -0,0 +1,167 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ As the bot points out, this is an "odd" license for a uapi .h file, are you SURE about this? If so, I need an Intel

Re: [PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-26 Thread kernel test robot
Hi Mike, I love your patch! Yet something to improve: [auto build test ERROR on soc/arm/dt] [also build test ERROR on linus/master char-misc/char-misc-testing linux/master soc/for-next v5.11-rc5 next-20210125] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submi

[PATCH v9 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-22 Thread Mike Ximing Chen
Introduce the dlb device ioctl layer and the first three ioctls: query device version, query available resources, and create a scheduling domain. Also introduce the user-space interface file dlb_user.h. The device version query is designed to allow each DLB device version/type to have its own

[PATCH v9 09/20] dlb: add queue create, reset, get-depth ioctls

2021-01-22 Thread Mike Ximing Chen
Add ioctl commands to create DLB queues and query their depth, and the corresponding scheduling domain reset code to drain the queues when they are no longer in use. When a CPU enqueues a queue entry (QE) to DLB, the QE entry is sent to a DLB queue. These queues hold queue entries (QEs) that have

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-21 Thread Dan Williams
On Wed, Jan 13, 2021 at 1:56 AM Greg KH wrote: [..] > > That's not my concern though. The open race that cdev_del() does not > > address is ioctl() called after device-unbind. The open fd is never > > revoked and can live past device_unregister() in which case the ioctl > > needs to revalidate the

[PATCH v16 05/17] RISC-V: KVM: Implement KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls

2021-01-15 Thread Anup Patel
For KVM RISC-V, we use KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls to access VCPU config and registers from user-space. We have three types of VCPU registers: 1. CONFIG - these are VCPU config and capabilities 2. CORE - these are VCPU general purpose registers 3. CSR- these are VCPU control and

[RFC PATCH v6 00/11] media: v4l2: Add extended fmt and buffer ioctls

2021-01-14 Thread Helen Koike
Hello, This is v6 of the Extended API for formats and buffers (see below the new API). The new API comes for free for old drivers through the conversion layer, which is independent of vb2. I completly refactored several patches. I would like to request comments not only in the uAPI, but also the

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-13 Thread Greg KH
t; feedback on the lifetime handling was properly addressed, it wasn't, > > > but lets deal with this on the list now. > > > > > > The race to handle is the one identified by cdev_del(): > > > > > > * NOTE: This guarantees that cdev device will no longer be ab

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-12 Thread Dan Williams
gt; > The race to handle is the one identified by cdev_del(): > > > > * NOTE: This guarantees that cdev device will no longer be able to be > > * opened, however any cdevs already open will remain and their fops will > > * still be callable even after cdev_del return

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ezequiel Garcia
On Mon, 2021-01-11 at 13:22 +0100, Ricardo Ribalda wrote: > Hi Ezequiel > > On Mon, Jan 11, 2021 at 12:55 PM Ricardo Ribalda wrote: > > > > Hi Ezequiel > > > > On Mon, Jan 11, 2021 at 12:48 PM Ezequiel Garcia > > wrote: > > > > > > Hi Ricardo, > > > > > > On Mon, 2021-01-11 at 12:35 +0100,

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Hi Ezequiel On Mon, Jan 11, 2021 at 12:55 PM Ricardo Ribalda wrote: > > Hi Ezequiel > > On Mon, Jan 11, 2021 at 12:48 PM Ezequiel Garcia > wrote: > > > > Hi Ricardo, > > > > On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > > > Clear the reserved fields. > > > > > > Fixes: > > > fai

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Hi Ezequiel On Mon, Jan 11, 2021 at 12:48 PM Ezequiel Garcia wrote: > > Hi Ricardo, > > On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > > Clear the reserved fields. > > > > Fixes: > > fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed > > test VIDIOC_TRY_FMT:

Re: [PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ezequiel Garcia
Hi Ricardo, On Mon, 2021-01-11 at 12:35 +0100, Ricardo Ribalda wrote: > Clear the reserved fields. > > Fixes: >   fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed > test VIDIOC_TRY_FMT: FAIL >   fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed > t

[PATCH] hantro: Format IOCTLs compliance fixes

2021-01-11 Thread Ricardo Ribalda
Clear the reserved fields. Fixes: fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed test VIDIOC_TRY_FMT: FAIL fail: v4l2-test-formats.cpp(482): pix_mp.plane_fmt[0].reserved not zeroed test VIDIOC_S_FMT: FAIL Signed-off-by: Ricardo Ribalda --- drivers/staging/media/ha

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-10 Thread Greg KH
ULL. Without revalidating to the dlb pointer under a > lock, or some other coordinated reference cout, it can transition > states underneath the running ioctl. But, that's only the case if this is the last cdev reference held here, right? How can a close be called if a filehandle is

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-09 Thread Chen, Mike Ximing
ioctl layer and first three > ioctls > > On Sat, Jan 09, 2021 at 07:49:24AM +, Chen, Mike Ximing wrote: > > > > +static int dlb_ioctl_arg_size[NUM_DLB_CMD] = { > > > > + sizeof(struct dlb_get_device_version_args), > > > > + sizeof(s

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-09 Thread Dan Williams
ever any cdevs already open will remain and their fops will * still be callable even after cdev_del returns. This means that the dlb->private_data is pointing to a live device, a dying device, or NULL. Without revalidating to the dlb pointer under a lock, or some other coordinated reference cout,

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-09 Thread Greg KH
On Sat, Jan 09, 2021 at 07:49:24AM +, Chen, Mike Ximing wrote: > > > +static int dlb_ioctl_arg_size[NUM_DLB_CMD] = { > > > + sizeof(struct dlb_get_device_version_args), > > > + sizeof(struct dlb_create_sched_domain_args), > > > + sizeof(struct dlb_get_num_resources_args) > > > > That list. > >

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
: add device ioctl layer and first three > ioctls > > > +/* [7:0]: device revision, [15:8]: device version */ > > +#define DLB_SET_DEVICE_VERSION(ver, rev) (((ver) << 8) | (rev)) > > + > > +static int > > +dlb_ioctl_get_device_version(struct dlb *dlb __at

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
: add device ioctl layer and first three > ioctls > > On Mon, Jan 04, 2021 at 08:58:23PM -0600, Mike Ximing Chen wrote: > > Introduce the dlb device ioctl layer and the first three ioctls: query > > device version, query available resources, and create a scheduling domain. >

RE: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-08 Thread Chen, Mike Ximing
d device ioctl layer and first three > ioctls > > > diff --git a/Documentation/userspace-api/ioctl/ioctl-number.rst > b/Documentation/userspace-api/ioctl/ioctl-number.rst > > index 55a2d9b2ce33..afca043d59f8 100644 > > --- a/Documentation/userspace-api/ioctl/ioctl-num

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-07 Thread Greg KH
On Mon, Jan 04, 2021 at 08:58:23PM -0600, Mike Ximing Chen wrote: > Introduce the dlb device ioctl layer and the first three ioctls: query > device version, query available resources, and create a scheduling domain. > Also introduce the user-space interface file dlb_user.h. > > The

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-07 Thread Greg KH
On Mon, Jan 04, 2021 at 08:58:23PM -0600, Mike Ximing Chen wrote: > Introduce the dlb device ioctl layer and the first three ioctls: query > device version, query available resources, and create a scheduling domain. > Also introduce the user-space interface file dlb_user.h. > > The

Re: [PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-07 Thread Greg KH
On Mon, Jan 04, 2021 at 08:58:23PM -0600, Mike Ximing Chen wrote: > Introduce the dlb device ioctl layer and the first three ioctls: query > device version, query available resources, and create a scheduling domain. > Also introduce the user-space interface file dlb_user.h. > > The

[PATCH 08/12] vt: drop old FONT ioctls

2021-01-05 Thread Jiri Slaby
Drop support for these ioctls: * PIO_FONT, PIO_FONTX * GIO_FONT, GIO_FONTX * PIO_FONTRESET As was demonstrated by commit 90bfdeef83f1 (tty: make FONTX ioctl use the tty pointer they were actually passed), these ioctls are not used from userspace, as: 1) they used to be broken (set up font on

[PATCH v8 09/20] dlb: add queue create, reset, get-depth ioctls

2021-01-04 Thread Mike Ximing Chen
Add ioctl commands to create DLB queues and query their depth, and the corresponding scheduling domain reset code to drain the queues when they are no longer in use. When a CPU enqueues a queue entry (QE) to DLB, the QE entry is sent to a DLB queue. These queues hold queue entries (QEs) that have

[PATCH v8 04/20] dlb: add device ioctl layer and first three ioctls

2021-01-04 Thread Mike Ximing Chen
Introduce the dlb device ioctl layer and the first three ioctls: query device version, query available resources, and create a scheduling domain. Also introduce the user-space interface file dlb_user.h. The device version query is designed to allow each DLB device version/type to have its own

Re: [PATCH] mmc: block: Let CMD13 polling only for MMC IOCTLS with the R1B response

2020-12-04 Thread Bean Huo
On Fri, 2020-12-04 at 15:38 +0100, Ulf Hansson wrote: > > There is no need to poll device status through CMD13. > > > > Meanwhile, based on the original change commit (mmc: block: Add > > CMD13 polling > > for MMC IOCTLS with R1B response), and comment in > >

Re: [PATCH] mmc: block: Let CMD13 polling only for MMC IOCTLS with the R1B response

2020-12-04 Thread Ulf Hansson
d command. > There is no need to poll device status through CMD13. > > Meanwhile, based on the original change commit (mmc: block: Add CMD13 polling > for MMC IOCTLS with R1B response), and comment in __mmc_blk_ioctl_cmd(), > current code is not in line with its original purpose. So fix

[PATCH] mmc: block: Let CMD13 polling only for MMC IOCTLS with the R1B response

2020-12-02 Thread Bean Huo
, based on the original change commit (mmc: block: Add CMD13 polling for MMC IOCTLS with R1B response), and comment in __mmc_blk_ioctl_cmd(), current code is not in line with its original purpose. So fix it with this patch. Fixes: a0d4c7eb71dd ("mmc: block: Add CMD13 polling for MMC IOCTLS wit

Re: [PATCH v5 0/7] media: v4l2: Add extended fmt and buffer ioctls

2020-11-27 Thread Helen Koike
Hello, On 8/4/20 4:29 PM, Helen Koike wrote: > Hello, > > This is v5 of the Extended API for formats and buffers, which introduces > the following new ioctls: > > int ioctl(int fd, VIDIOC_G_EXT_PIX_FMT, struct v4l2_ext_pix_format *argp) > int ioctl(int fd, VIDIOC_

[RFC PATCH 17/18] virt/mshv: get and set partition property ioctls

2020-11-20 Thread Nuno Das Neves
Introduce ioctls for getting and setting properties of guest partitions. Signed-off-by: Nuno Das Neves --- Documentation/virt/mshv/api.rst| 8 +++ include/asm-generic/hyperv-tlfs.h | 17 ++ include/uapi/asm-generic/hyperv-tlfs.h | 59 include/uapi/linux

[RFC PATCH 15/18] virt/mshv: get and set vp state ioctls

2020-11-20 Thread Nuno Das Neves
Introduce ioctls for getting and setting guest vcpu emulated LAPIC state, and xsave data. Signed-off-by: Nuno Das Neves --- Documentation/virt/mshv/api.rst | 8 + arch/x86/include/uapi/asm/hyperv-tlfs.h | 59 ++ include/asm-generic/hyperv-tlfs.h | 41 include/uapi/asm

[RFC PATCH 10/18] virt/mshv: get and set vcpu registers ioctls

2020-11-20 Thread Nuno Das Neves
Add ioctls for getting and setting virtual processor registers. Co-developed-by: Lillian Grassin-Drake Signed-off-by: Lillian Grassin-Drake Signed-off-by: Nuno Das Neves --- Documentation/virt/mshv/api.rst | 11 + arch/x86/include/uapi/asm/hyperv-tlfs.h | 601

[RFC PATCH 17/67] KVM: x86: Introduce "protected guest" concept and block disallowed ioctls

2020-11-16 Thread isaku . yamahata
From: Sean Christopherson Add 'guest_state_protected' to mark a VM's state as being protected by hardware/firmware, e.g. SEV-ES or TDX-SEAM. Use the flag to disallow ioctls() and/or flows that attempt to access protected state. Return an error if userspace attempts to get/set

[PATCH 5.4 83/85] xfs: flush for older, xfs specific ioctls

2020-11-09 Thread Greg Kroah-Hartman
From: Andy Strohman 837a6e7f5cdb ("fs: add generic UNRESVSP and ZERO_RANGE ioctl handlers") changed ioctls XFS_IOC_UNRESVSP XFS_IOC_UNRESVSP64 and XFS_IOC_ZERO_RANGE to be generic instead of xfs specific. Because of this change, 36f11775da75 ("xfs: properly serialise fallocate

[PATCH v15 05/17] RISC-V: KVM: Implement KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls

2020-11-09 Thread Anup Patel
For KVM RISC-V, we use KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls to access VCPU config and registers from user-space. We have three types of VCPU registers: 1. CONFIG - these are VCPU config and capabilities 2. CORE - these are VCPU general purpose registers 3. CSR- these are VCPU control and

[RFC net-next 05/28] wireless: remove old ioctls

2020-11-06 Thread Arnd Bergmann
deauth_all_stas(local->dev, local->ap, 0); - break; - default: - ret = -EOPNOTSUPP; - break; - } - - return ret; -} -#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ - - #ifdef PRISM2_DOWNLOAD_SUPPORT static int prism2_ioctl_priv_do

[PATCH net-next v3 2/4] net: socket: rework SIOC?IFMAP ioctls

2020-11-06 Thread Arnd Bergmann
|= put_user(ifr.ifr_map.irq, &uifmap32->irq); - err |= put_user(ifr.ifr_map.dma, &uifmap32->dma); - err |= put_user(ifr.ifr_map.port, &uifmap32->port); - if (err) - err = -EFAULT; - } - return err; -} -

[PATCH v2 6/8] media: v4l2: convert v4l2_format compat ioctls

2020-10-30 Thread Arnd Bergmann
From: Arnd Bergmann Now that the 'clips' array is accessed by common code in the native ioctl handler, the same can be done for the compat version, greatly simplifying the compat code for these four ioctl commands. Signed-off-by: Arnd Bergmann --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c

[PATCH v2 17/22] mpool: add mpool lifecycle management ioctls

2020-10-12 Thread Nabeel M Mohamed
This adds the open, release and mpool management ioctls for the mpool driver. The create, destroy, activate, deactivate and rename ioctls are issued to the mpool control device (/dev/mpoolctl), and the rest are issued to the mpool device (/dev/mpool/). The mpool control device is owned by (root

[PATCH v2 18/22] mpool: add object lifecycle management ioctls

2020-10-12 Thread Nabeel M Mohamed
This adds the mblock and mlog management ioctls: alloc, commit, abort, destroy, read, write, fetch properties etc. The mblock and mlog management ioctl handlers are thin wrappers around the core mblock/mlog lifecycle management and IO routines introduced in an earlier patch. The object read

Re: [RFC PATCH 1/1] overlayfs: add ioctls that allows to get fhandle for layers dentries

2020-10-04 Thread Randy Dunlap
On 10/4/20 12:24 PM, Alexander Mikhalitsyn wrote: > +#define OVL_IOC_GETLWRFHNDLSNUM _IO('o', 1) > +// DISCUSS: what if MAX_HANDLE_SZ will change? > +#define OVL_IOC_GETLWRFHNDL _IOR('o', 2, struct > ovl_mnt_opt_fh) > +#define OVL_IOC_GETUPPRFHNDL

[RFC PATCH 1/1] overlayfs: add ioctls that allows to get fhandle for layers dentries

2020-10-04 Thread Alexander Mikhalitsyn
Add several ioctls to ovl_dir_operations that allows to get file handles for upperdir, workdir, lowerdir dentries. Special {s_dev; fhandle} format used. (Ideally should be {mnt_id; fhandle} but this impossible because overlayfs not keeps mounts refcnt for layers.) Added ioctls list

Re: media/master bisection: v4l2-compliance-vivid.Format-ioctls-Input-3.VIDIOC_TRY_FMT on qemu_arm-virt-gicv3

2020-10-02 Thread Hans Verkuil
; * * >>> * If you do send a fix, please include this trailer:* >>> * Reported-by: "kernelci.org bot" * >>> * * >>> * Hope this helps!

Re: media/master bisection: v4l2-compliance-vivid.Format-ioctls-Input-3.VIDIOC_TRY_FMT on qemu_arm-virt-gicv3

2020-10-02 Thread Guillaume Tucker
eported-by: "kernelci.org bot" * >> * * >> * Hope this helps! * >> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * >> >> media/master bisection: >> v4l2-compliance-vivid.Format-ioctls-Input-3.VIDIOC_TRY_

Re: [PATCH 2/2] dev_ioctl: split out SIOC?IFMAP ioctls

2020-10-01 Thread Arnd Bergmann
On Tue, Sep 29, 2020 at 7:53 PM Christoph Hellwig wrote: > On Fri, Sep 25, 2020 at 02:28:29PM +0200, Arnd Bergmann wrote: > > Do you mean we should check that the (larger) user space size > > remains what it is for future changes, or that the (smaller) > > kernel size remains the same on all kern

RE: [EXT] Re: [PATCH 17/22] mpool: add mpool lifecycle management ioctls

2020-09-30 Thread Nabeel Meeramohideen Mohamed (nmeeramohide)
Hi Randy, On Tuesday, September 29, 2020 6:13 PM, Randy Dunlap wrote: > On 9/28/20 9:45 AM, nmeeramoh...@micron.com wrote: > > + if (_IOC_TYPE(cmd) != MPIOC_MAGIC) > Hi, > > MPIOC_MAGIC is defined in patch 01/22. > It should also be added to Documentation/userspace-api/ioctl/ioctl-number.rst.

Re: media/master bisection: v4l2-compliance-vivid.Format-ioctls-Input-3.VIDIOC_TRY_FMT on qemu_arm-virt-gicv3

2020-09-30 Thread Guillaume Tucker
* > * Hope this helps! * > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > media/master bisection: > v4l2-compliance-vivid.Format-ioctls-Input-3.VIDIOC_TRY_FMT on > qemu_arm-virt-gicv3 > > Summary: &g

Re: [PATCH 17/22] mpool: add mpool lifecycle management ioctls

2020-09-29 Thread Randy Dunlap
On 9/28/20 9:45 AM, nmeeramoh...@micron.com wrote: > + if (_IOC_TYPE(cmd) != MPIOC_MAGIC) Hi, MPIOC_MAGIC is defined in patch 01/22. It should also be added to Documentation/userspace-api/ioctl/ioctl-number.rst. thanks. -- ~Randy

Re: [PATCH 2/2] dev_ioctl: split out SIOC?IFMAP ioctls

2020-09-29 Thread Christoph Hellwig
On Fri, Sep 25, 2020 at 02:28:29PM +0200, Arnd Bergmann wrote: > > > +++ b/include/uapi/linux/if.h > > > @@ -247,7 +247,13 @@ struct ifreq { > > > short ifru_flags; > > > int ifru_ivalue; > > > int ifru_mtu; > > > +#ifndef __KERNEL__ > > > +

  1   2   3   4   5   6   7   8   9   10   >