linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
@ 2025-06-23 13:22 David Woodhouse
  2025-06-24  7:25 ` Eric Auger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Woodhouse @ 2025-06-23 13:22 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, Joey Gouly, Suzuki K Poulose,
	Zenghui Yu, Catalin Marinas, Will Deacon, Jing Zhang,
	Kunkun Jiang, Paolo Bonzini, Sebastian Ott, Maxim Levitsky,
	Keisuke Nishimura, linux-arm-kernel, kvmarm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

From: David Woodhouse <dwmw@amazon.co.uk>

A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
didn't work very well. We eventually determined this was because we were
invoking it on the wrong file descriptor, but not getting an error.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 arch/arm64/kvm/vgic/vgic-its.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
index 534049c7c94b..b34f8976c9cc 100644
--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -2694,6 +2694,9 @@ static int vgic_its_ctrl(struct kvm *kvm, struct vgic_its *its, u64 attr)
 	case KVM_DEV_ARM_ITS_RESTORE_TABLES:
 		ret = abi->restore_tables(its);
 		break;
+	default:
+		ret = -ENXIO;
+		break;
 	}
 
 	mutex_unlock(&its->its_lock);
-- 
2.43.0



[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
  2025-06-23 13:22 KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs David Woodhouse
@ 2025-06-24  7:25 ` Eric Auger
  2025-06-24  9:01   ` David Woodhouse
  2025-07-22 10:33 ` David Woodhouse
  2025-07-24  6:49 ` Oliver Upton
  2 siblings, 1 reply; 6+ messages in thread
From: Eric Auger @ 2025-06-24  7:25 UTC (permalink / raw)
  To: David Woodhouse, Marc Zyngier, Oliver Upton, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	Jing Zhang, Kunkun Jiang, Paolo Bonzini, Sebastian Ott,
	Maxim Levitsky, Keisuke Nishimura, linux-arm-kernel, kvmarm,
	linux-kernel

Hi David,

On 6/23/25 3:22 PM, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
> didn't work very well. We eventually determined this was because we were
> invoking it on the wrong file descriptor, but not getting an error.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
In the corresponding doc (virt/kvm/devices/arm-vgic-its.rst)
it is said about possible returned values:
     -ENXIO  ITS not properly configured as required prior to setting
             this attribute
which does not exactly match your situation. Shouldn't we also update
the doc or change the returned value?

Thanks

Eric

> ---
>  arch/arm64/kvm/vgic/vgic-its.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
> index 534049c7c94b..b34f8976c9cc 100644
> --- a/arch/arm64/kvm/vgic/vgic-its.c
> +++ b/arch/arm64/kvm/vgic/vgic-its.c
> @@ -2694,6 +2694,9 @@ static int vgic_its_ctrl(struct kvm *kvm, struct vgic_its *its, u64 attr)
>  	case KVM_DEV_ARM_ITS_RESTORE_TABLES:
>  		ret = abi->restore_tables(its);
>  		break;
> +	default:
> +		ret = -ENXIO;
> +		break;
>  	}
>  
>  	mutex_unlock(&its->its_lock);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
  2025-06-24  7:25 ` Eric Auger
@ 2025-06-24  9:01   ` David Woodhouse
  2025-06-24  9:20     ` Eric Auger
  0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2025-06-24  9:01 UTC (permalink / raw)
  To: Eric Auger, Marc Zyngier, Oliver Upton, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	Jing Zhang, Kunkun Jiang, Paolo Bonzini, Sebastian Ott,
	Maxim Levitsky, Keisuke Nishimura, linux-arm-kernel, kvmarm,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

On Tue, 2025-06-24 at 09:25 +0200, Eric Auger wrote:
> Hi David,
> 
> On 6/23/25 3:22 PM, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> > 
> > A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
> > didn't work very well. We eventually determined this was because we were
> > invoking it on the wrong file descriptor, but not getting an error.
> > 
> > Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
>
> In the corresponding doc (virt/kvm/devices/arm-vgic-its.rst)
> it is said about possible returned values:
>      -ENXIO  ITS not properly configured as required prior to setting
>              this attribute
> which does not exactly match your situation. Shouldn't we also update
> the doc or change the returned value?

Hi Eric, thanks for looking at this.

I think this is OK because the -ENXIO return is covered by the high-
level description of KVM_[GS]ET_DEVICE_ATTR in virt/kvm/api.rst:

Errors:

  =====   =============================================================
  ENXIO   The group or attribute is unknown/unsupported for this device
          or hardware support is missing.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
  2025-06-24  9:01   ` David Woodhouse
@ 2025-06-24  9:20     ` Eric Auger
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Auger @ 2025-06-24  9:20 UTC (permalink / raw)
  To: David Woodhouse, Marc Zyngier, Oliver Upton, Joey Gouly,
	Suzuki K Poulose, Zenghui Yu, Catalin Marinas, Will Deacon,
	Jing Zhang, Kunkun Jiang, Paolo Bonzini, Sebastian Ott,
	Maxim Levitsky, Keisuke Nishimura, linux-arm-kernel, kvmarm,
	linux-kernel

Hi David,

On 6/24/25 11:01 AM, David Woodhouse wrote:
> On Tue, 2025-06-24 at 09:25 +0200, Eric Auger wrote:
>> Hi David,
>>
>> On 6/23/25 3:22 PM, David Woodhouse wrote:
>>> From: David Woodhouse <dwmw@amazon.co.uk>
>>>
>>> A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
>>> didn't work very well. We eventually determined this was because we were
>>> invoking it on the wrong file descriptor, but not getting an error.
>>>
>>> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
>>
>> In the corresponding doc (virt/kvm/devices/arm-vgic-its.rst)
>> it is said about possible returned values:
>>      -ENXIO  ITS not properly configured as required prior to setting
>>              this attribute
>> which does not exactly match your situation. Shouldn't we also update
>> the doc or change the returned value?
> 
> Hi Eric, thanks for looking at this.
> 
> I think this is OK because the -ENXIO return is covered by the high-
> level description of KVM_[GS]ET_DEVICE_ATTR in virt/kvm/api.rst:
> 
> Errors:
> 
>   =====   =============================================================
>   ENXIO   The group or attribute is unknown/unsupported for this device
>           or hardware support is missing.
> 

Ah OK I missed that. Anyway that's not a big deal I think.

Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
  2025-06-23 13:22 KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs David Woodhouse
  2025-06-24  7:25 ` Eric Auger
@ 2025-07-22 10:33 ` David Woodhouse
  2025-07-24  6:49 ` Oliver Upton
  2 siblings, 0 replies; 6+ messages in thread
From: David Woodhouse @ 2025-07-22 10:33 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, Joey Gouly, Suzuki K Poulose,
	Zenghui Yu, Catalin Marinas, Will Deacon, Jing Zhang,
	Kunkun Jiang, Paolo Bonzini, Sebastian Ott, Maxim Levitsky,
	Keisuke Nishimura, linux-arm-kernel, kvmarm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Mon, 2025-06-23 at 15:22 +0200, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
> didn't work very well. We eventually determined this was because we were
> invoking it on the wrong file descriptor, but not getting an error.
> 
> Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>

Ping?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
  2025-06-23 13:22 KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs David Woodhouse
  2025-06-24  7:25 ` Eric Auger
  2025-07-22 10:33 ` David Woodhouse
@ 2025-07-24  6:49 ` Oliver Upton
  2 siblings, 0 replies; 6+ messages in thread
From: Oliver Upton @ 2025-07-24  6:49 UTC (permalink / raw)
  To: Marc Zyngier, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
	Catalin Marinas, Will Deacon, Jing Zhang, Kunkun Jiang,
	Paolo Bonzini, Sebastian Ott, Maxim Levitsky, Keisuke Nishimura,
	linux-arm-kernel, kvmarm, linux-kernel, David Woodhouse
  Cc: Oliver Upton

On Mon, 23 Jun 2025 15:22:52 +0200, David Woodhouse wrote:
> A preliminary version of a hack to invoke unmap_all_vpes() from an ioctl
> didn't work very well. We eventually determined this was because we were
> invoking it on the wrong file descriptor, but not getting an error.
> 
> 

Applied to next, thanks!

[1/1] KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs
      https://git.kernel.org/kvmarm/kvmarm/c/4530256f3699

--
Best,
Oliver

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-24  6:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23 13:22 KVM: arm64: vgic-its: Return -ENXIO to invalid KVM_DEV_ARM_VGIC_GRP_CTRL attrs David Woodhouse
2025-06-24  7:25 ` Eric Auger
2025-06-24  9:01   ` David Woodhouse
2025-06-24  9:20     ` Eric Auger
2025-07-22 10:33 ` David Woodhouse
2025-07-24  6:49 ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).