diff mbox series

[2/2] KVM: arm64: Match PMU error code descriptions with error conditions

Message ID 20200921130838.37296-3-alexandru.elisei@arm.com (mailing list archive)
State New, archived
Headers show
Series KVM: arm64: Documentation updates | expand

Commit Message

Alexandru Elisei Sept. 21, 2020, 1:08 p.m. UTC
Update the description of the PMU KVM_{GET, SET}_DEVICE_ATTR error codes
to be a better match for the code that returns them.

Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
---
 Documentation/virt/kvm/devices/vcpu.rst | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Andrew Jones Sept. 21, 2020, 2:17 p.m. UTC | #1
On Mon, Sep 21, 2020 at 02:08:38PM +0100, Alexandru Elisei wrote:
> Update the description of the PMU KVM_{GET, SET}_DEVICE_ATTR error codes
> to be a better match for the code that returns them.
> 
> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> ---
>  Documentation/virt/kvm/devices/vcpu.rst | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
> index 96d6cf77cb1e..5b8db30c61db 100644
> --- a/Documentation/virt/kvm/devices/vcpu.rst
> +++ b/Documentation/virt/kvm/devices/vcpu.rst
> @@ -26,8 +26,8 @@ Returns:
>  	 =======  ========================================================
>  	 -EBUSY   The PMU overflow interrupt is already set
>  	 -EFAULT  Error reading interrupt number
> -	 -ENXIO   The overflow interrupt not set when attempting to get it
> -	 -ENODEV  PMUv3 not supported
> +	 -ENXIO   PMUv3 not supported

I think -ENXIO matched the code better before the change.

> +	 -ENODEV  KVM_ARM_VCPU_PMU_V3 feature missing from VCPU
>  	 -EINVAL  Invalid PMU overflow interrupt number supplied or
>  		  trying to set the IRQ number without using an in-kernel
>  		  irqchip.
> @@ -48,8 +48,8 @@ Returns:
>  	 =======  ======================================================
>  	 -EEXIST  Interrupt number already used
>  	 -ENODEV  PMUv3 not supported or GIC not initialized
> -	 -ENXIO   PMUv3 not properly configured or in-kernel irqchip not
> -		  configured as required prior to calling this attribute
> +	 -ENXIO   PMUv3 not supported, missing VCPU feature or interrupt
> +                  number not set
>  	 -EBUSY   PMUv3 already initialized
>  	 =======  ======================================================
>

Thanks,
drew
Alexandru Elisei Sept. 21, 2020, 2:30 p.m. UTC | #2
Hi Andrew,

Thank you for having a look at this.

On 9/21/20 3:17 PM, Andrew Jones wrote:

> On Mon, Sep 21, 2020 at 02:08:38PM +0100, Alexandru Elisei wrote:
>> Update the description of the PMU KVM_{GET, SET}_DEVICE_ATTR error codes
>> to be a better match for the code that returns them.
>>
>> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
>> ---
>>  Documentation/virt/kvm/devices/vcpu.rst | 8 ++++----
>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
>> index 96d6cf77cb1e..5b8db30c61db 100644
>> --- a/Documentation/virt/kvm/devices/vcpu.rst
>> +++ b/Documentation/virt/kvm/devices/vcpu.rst
>> @@ -26,8 +26,8 @@ Returns:
>>  	 =======  ========================================================
>>  	 -EBUSY   The PMU overflow interrupt is already set
>>  	 -EFAULT  Error reading interrupt number
>> -	 -ENXIO   The overflow interrupt not set when attempting to get it
>> -	 -ENODEV  PMUv3 not supported
>> +	 -ENXIO   PMUv3 not supported
> I think -ENXIO matched the code better before the change.

KVM_SET_DEVICE_ATTR for KVM_ARM_VCPU_PMU_V3_IRQ returns -ENXIO if
CONFIG_KVM_ARM_PMU is not set (in include/kvm/arm_pmu.h).

But I think I understand what you mean, you're referring to
kvm_arm_pmu_v3_get_attr(), which returns -ENXIO if the irq number was not set. I
can change the description to "PMUv3 not supported or the overflow interrupt not
set when attempting to get it", what do you think?

Thanks,
Alex
Andrew Jones Sept. 21, 2020, 2:49 p.m. UTC | #3
On Mon, Sep 21, 2020 at 03:30:24PM +0100, Alexandru Elisei wrote:
> Hi Andrew,
> 
> Thank you for having a look at this.
> 
> On 9/21/20 3:17 PM, Andrew Jones wrote:
> 
> > On Mon, Sep 21, 2020 at 02:08:38PM +0100, Alexandru Elisei wrote:
> >> Update the description of the PMU KVM_{GET, SET}_DEVICE_ATTR error codes
> >> to be a better match for the code that returns them.
> >>
> >> Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com>
> >> ---
> >>  Documentation/virt/kvm/devices/vcpu.rst | 8 ++++----
> >>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
> >> index 96d6cf77cb1e..5b8db30c61db 100644
> >> --- a/Documentation/virt/kvm/devices/vcpu.rst
> >> +++ b/Documentation/virt/kvm/devices/vcpu.rst
> >> @@ -26,8 +26,8 @@ Returns:
> >>  	 =======  ========================================================
> >>  	 -EBUSY   The PMU overflow interrupt is already set
> >>  	 -EFAULT  Error reading interrupt number
> >> -	 -ENXIO   The overflow interrupt not set when attempting to get it
> >> -	 -ENODEV  PMUv3 not supported
> >> +	 -ENXIO   PMUv3 not supported
> > I think -ENXIO matched the code better before the change.
> 
> KVM_SET_DEVICE_ATTR for KVM_ARM_VCPU_PMU_V3_IRQ returns -ENXIO if
> CONFIG_KVM_ARM_PMU is not set (in include/kvm/arm_pmu.h).
> 
> But I think I understand what you mean, you're referring to
> kvm_arm_pmu_v3_get_attr(), which returns -ENXIO if the irq number was not set. I
> can change the description to "PMUv3 not supported or the overflow interrupt not
> set when attempting to get it", what do you think?
>

Works for me.

Thanks,
drew
diff mbox series

Patch

diff --git a/Documentation/virt/kvm/devices/vcpu.rst b/Documentation/virt/kvm/devices/vcpu.rst
index 96d6cf77cb1e..5b8db30c61db 100644
--- a/Documentation/virt/kvm/devices/vcpu.rst
+++ b/Documentation/virt/kvm/devices/vcpu.rst
@@ -26,8 +26,8 @@  Returns:
 	 =======  ========================================================
 	 -EBUSY   The PMU overflow interrupt is already set
 	 -EFAULT  Error reading interrupt number
-	 -ENXIO   The overflow interrupt not set when attempting to get it
-	 -ENODEV  PMUv3 not supported
+	 -ENXIO   PMUv3 not supported
+	 -ENODEV  KVM_ARM_VCPU_PMU_V3 feature missing from VCPU
 	 -EINVAL  Invalid PMU overflow interrupt number supplied or
 		  trying to set the IRQ number without using an in-kernel
 		  irqchip.
@@ -48,8 +48,8 @@  Returns:
 	 =======  ======================================================
 	 -EEXIST  Interrupt number already used
 	 -ENODEV  PMUv3 not supported or GIC not initialized
-	 -ENXIO   PMUv3 not properly configured or in-kernel irqchip not
-		  configured as required prior to calling this attribute
+	 -ENXIO   PMUv3 not supported, missing VCPU feature or interrupt
+                  number not set
 	 -EBUSY   PMUv3 already initialized
 	 =======  ======================================================