* [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST
@ 2020-08-17 3:37 Keqian Zhu
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Keqian Zhu @ 2020-08-17 3:37 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, Steven Price, wanghaibin.wang, Keqian Zhu
During picking up pvtime LPT support for arm64, I do some trivial fixes for
pvtime ST.
Keqian Zhu (3):
KVM: arm64: Some fixes of PV-time interface document
KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
KVM: arm64: Use kvm_write_guest_lock when init stolen time
Documentation/virt/kvm/arm/pvtime.rst | 6 +++---
arch/arm64/kvm/pvtime.c | 6 +-----
include/uapi/linux/kvm.h | 2 --
tools/include/uapi/linux/kvm.h | 2 --
4 files changed, 4 insertions(+), 12 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document
2020-08-17 3:37 [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST Keqian Zhu
@ 2020-08-17 3:37 ` Keqian Zhu
2020-08-17 8:47 ` Andrew Jones
2020-08-17 9:39 ` Steven Price
2020-08-17 3:37 ` [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type Keqian Zhu
2020-08-17 3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
2 siblings, 2 replies; 13+ messages in thread
From: Keqian Zhu @ 2020-08-17 3:37 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, Steven Price, wanghaibin.wang, Keqian Zhu
Rename PV_FEATURES tp PV_TIME_FEATURES
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
Documentation/virt/kvm/arm/pvtime.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/virt/kvm/arm/pvtime.rst b/Documentation/virt/kvm/arm/pvtime.rst
index 687b60d..94bffe2 100644
--- a/Documentation/virt/kvm/arm/pvtime.rst
+++ b/Documentation/virt/kvm/arm/pvtime.rst
@@ -3,7 +3,7 @@
Paravirtualized time support for arm64
======================================
-Arm specification DEN0057/A defines a standard for paravirtualised time
+Arm specification DEN0057/A defines a standard for paravirtualized time
support for AArch64 guests:
https://developer.arm.com/docs/den0057/a
@@ -19,8 +19,8 @@ Two new SMCCC compatible hypercalls are defined:
These are only available in the SMC64/HVC64 calling convention as
paravirtualized time is not available to 32 bit Arm guests. The existence of
-the PV_FEATURES hypercall should be probed using the SMCCC 1.1 ARCH_FEATURES
-mechanism before calling it.
+the PV_TIME_FEATURES hypercall should be probed using the SMCCC 1.1
+ARCH_FEATURES mechanism before calling it.
PV_TIME_FEATURES
============= ======== ==========
--
1.8.3.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
2020-08-17 3:37 [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST Keqian Zhu
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
@ 2020-08-17 3:37 ` Keqian Zhu
2020-08-17 7:39 ` Marc Zyngier
2020-08-17 3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
2 siblings, 1 reply; 13+ messages in thread
From: Keqian Zhu @ 2020-08-17 3:37 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, Steven Price, wanghaibin.wang, Keqian Zhu
ARM64 PV-time ST is configured by userspace through vCPU attribute,
and KVM_DEV_TYPE_ARM_PV_TIME is unused.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
include/uapi/linux/kvm.h | 2 --
tools/include/uapi/linux/kvm.h | 2 --
2 files changed, 4 deletions(-)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 4fdf303..9a6b97e 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1258,8 +1258,6 @@ enum kvm_device_type {
#define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
KVM_DEV_TYPE_XIVE,
#define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
- KVM_DEV_TYPE_ARM_PV_TIME,
-#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
KVM_DEV_TYPE_MAX,
};
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 4fdf303..9a6b97e 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1258,8 +1258,6 @@ enum kvm_device_type {
#define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
KVM_DEV_TYPE_XIVE,
#define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
- KVM_DEV_TYPE_ARM_PV_TIME,
-#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
KVM_DEV_TYPE_MAX,
};
--
1.8.3.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time
2020-08-17 3:37 [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST Keqian Zhu
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
2020-08-17 3:37 ` [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type Keqian Zhu
@ 2020-08-17 3:37 ` Keqian Zhu
2020-08-17 8:52 ` Andrew Jones
2020-08-17 9:53 ` Steven Price
2 siblings, 2 replies; 13+ messages in thread
From: Keqian Zhu @ 2020-08-17 3:37 UTC (permalink / raw)
To: linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, Steven Price, wanghaibin.wang, Keqian Zhu
There is a lock version kvm_write_guest. Use it to simplify code.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
---
arch/arm64/kvm/pvtime.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c
index f7b52ce..2b24e7f 100644
--- a/arch/arm64/kvm/pvtime.c
+++ b/arch/arm64/kvm/pvtime.c
@@ -55,7 +55,6 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
struct pvclock_vcpu_stolen_time init_values = {};
struct kvm *kvm = vcpu->kvm;
u64 base = vcpu->arch.steal.base;
- int idx;
if (base == GPA_INVALID)
return base;
@@ -66,10 +65,7 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
*/
vcpu->arch.steal.steal = 0;
vcpu->arch.steal.last_steal = current->sched_info.run_delay;
-
- idx = srcu_read_lock(&kvm->srcu);
- kvm_write_guest(kvm, base, &init_values, sizeof(init_values));
- srcu_read_unlock(&kvm->srcu, idx);
+ kvm_write_guest_lock(kvm, base, &init_values, sizeof(init_values));
return base;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
2020-08-17 3:37 ` [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type Keqian Zhu
@ 2020-08-17 7:39 ` Marc Zyngier
2020-08-17 8:43 ` zhukeqian
0 siblings, 1 reply; 13+ messages in thread
From: Marc Zyngier @ 2020-08-17 7:39 UTC (permalink / raw)
To: Keqian Zhu
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Catalin Marinas,
Will Deacon, James Morse, Suzuki K Poulose, Steven Price,
wanghaibin.wang
On 2020-08-17 04:37, Keqian Zhu wrote:
> ARM64 PV-time ST is configured by userspace through vCPU attribute,
> and KVM_DEV_TYPE_ARM_PV_TIME is unused.
>
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
> ---
> include/uapi/linux/kvm.h | 2 --
> tools/include/uapi/linux/kvm.h | 2 --
> 2 files changed, 4 deletions(-)
>
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 4fdf303..9a6b97e 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
> KVM_DEV_TYPE_XIVE,
> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
> - KVM_DEV_TYPE_ARM_PV_TIME,
> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
> KVM_DEV_TYPE_MAX,
> };
>
> diff --git a/tools/include/uapi/linux/kvm.h
> b/tools/include/uapi/linux/kvm.h
> index 4fdf303..9a6b97e 100644
> --- a/tools/include/uapi/linux/kvm.h
> +++ b/tools/include/uapi/linux/kvm.h
> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
> KVM_DEV_TYPE_XIVE,
> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
> - KVM_DEV_TYPE_ARM_PV_TIME,
> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
> KVM_DEV_TYPE_MAX,
> };
No. You can't drop anything from UAPI, used or not. Doing so will
break the compilation of any userspace that, for any reason, references
this value. We cannot reuse this value in the future either, as it would
create a we wouldn't know which device to create.
It is pretty unfortunate that PV time has turned into such a train
wreck,
but that's what we have now, and it has to stay.
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
2020-08-17 7:39 ` Marc Zyngier
@ 2020-08-17 8:43 ` zhukeqian
2020-08-17 9:49 ` Steven Price
0 siblings, 1 reply; 13+ messages in thread
From: zhukeqian @ 2020-08-17 8:43 UTC (permalink / raw)
To: Marc Zyngier
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Catalin Marinas,
Will Deacon, James Morse, Suzuki K Poulose, Steven Price,
wanghaibin.wang
Hi Marc,
On 2020/8/17 15:39, Marc Zyngier wrote:
> On 2020-08-17 04:37, Keqian Zhu wrote:
>> ARM64 PV-time ST is configured by userspace through vCPU attribute,
>> and KVM_DEV_TYPE_ARM_PV_TIME is unused.
>>
>> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
>> ---
>> include/uapi/linux/kvm.h | 2 --
>> tools/include/uapi/linux/kvm.h | 2 --
>> 2 files changed, 4 deletions(-)
>>
>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>> index 4fdf303..9a6b97e 100644
>> --- a/include/uapi/linux/kvm.h
>> +++ b/include/uapi/linux/kvm.h
>> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
>> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
>> KVM_DEV_TYPE_XIVE,
>> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
>> - KVM_DEV_TYPE_ARM_PV_TIME,
>> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
>> KVM_DEV_TYPE_MAX,
>> };
>>
>> diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
>> index 4fdf303..9a6b97e 100644
>> --- a/tools/include/uapi/linux/kvm.h
>> +++ b/tools/include/uapi/linux/kvm.h
>> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
>> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
>> KVM_DEV_TYPE_XIVE,
>> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
>> - KVM_DEV_TYPE_ARM_PV_TIME,
>> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
>> KVM_DEV_TYPE_MAX,
>> };
>
> No. You can't drop anything from UAPI, used or not. Doing so will
> break the compilation of any userspace that, for any reason, references
> this value. We cannot reuse this value in the future either, as it would
> create a we wouldn't know which device to create.
>
> It is pretty unfortunate that PV time has turned into such a train wreck,
> but that's what we have now, and it has to stay.
Well, I see. It is a sad thing indeed.
Thanks,
Keqian
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
@ 2020-08-17 8:47 ` Andrew Jones
2020-08-17 9:02 ` zhukeqian
2020-08-17 9:39 ` Steven Price
1 sibling, 1 reply; 13+ messages in thread
From: Andrew Jones @ 2020-08-17 8:47 UTC (permalink / raw)
To: Keqian Zhu
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Marc Zyngier,
Catalin Marinas, Will Deacon, James Morse, Suzuki K Poulose,
Steven Price, wanghaibin.wang
On Mon, Aug 17, 2020 at 11:37:27AM +0800, Keqian Zhu wrote:
> Rename PV_FEATURES tp PV_TIME_FEATURES
>
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
> ---
> Documentation/virt/kvm/arm/pvtime.rst | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/virt/kvm/arm/pvtime.rst b/Documentation/virt/kvm/arm/pvtime.rst
> index 687b60d..94bffe2 100644
> --- a/Documentation/virt/kvm/arm/pvtime.rst
> +++ b/Documentation/virt/kvm/arm/pvtime.rst
> @@ -3,7 +3,7 @@
> Paravirtualized time support for arm64
> ======================================
>
> -Arm specification DEN0057/A defines a standard for paravirtualised time
> +Arm specification DEN0057/A defines a standard for paravirtualized time
> support for AArch64 guests:
>
> https://developer.arm.com/docs/den0057/a
> @@ -19,8 +19,8 @@ Two new SMCCC compatible hypercalls are defined:
>
> These are only available in the SMC64/HVC64 calling convention as
> paravirtualized time is not available to 32 bit Arm guests. The existence of
> -the PV_FEATURES hypercall should be probed using the SMCCC 1.1 ARCH_FEATURES
> -mechanism before calling it.
> +the PV_TIME_FEATURES hypercall should be probed using the SMCCC 1.1
> +ARCH_FEATURES mechanism before calling it.
>
> PV_TIME_FEATURES
> ============= ======== ==========
> --
> 1.8.3.1
>
Reviewed-by: Andrew Jones <drjones@redhat.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time
2020-08-17 3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
@ 2020-08-17 8:52 ` Andrew Jones
2020-08-17 9:53 ` Steven Price
1 sibling, 0 replies; 13+ messages in thread
From: Andrew Jones @ 2020-08-17 8:52 UTC (permalink / raw)
To: Keqian Zhu
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Marc Zyngier,
Catalin Marinas, Will Deacon, James Morse, Suzuki K Poulose,
Steven Price, wanghaibin.wang
On Mon, Aug 17, 2020 at 11:37:29AM +0800, Keqian Zhu wrote:
> There is a lock version kvm_write_guest. Use it to simplify code.
>
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
> ---
> arch/arm64/kvm/pvtime.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c
> index f7b52ce..2b24e7f 100644
> --- a/arch/arm64/kvm/pvtime.c
> +++ b/arch/arm64/kvm/pvtime.c
> @@ -55,7 +55,6 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
> struct pvclock_vcpu_stolen_time init_values = {};
> struct kvm *kvm = vcpu->kvm;
> u64 base = vcpu->arch.steal.base;
> - int idx;
>
> if (base == GPA_INVALID)
> return base;
> @@ -66,10 +65,7 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
> */
> vcpu->arch.steal.steal = 0;
> vcpu->arch.steal.last_steal = current->sched_info.run_delay;
> -
> - idx = srcu_read_lock(&kvm->srcu);
> - kvm_write_guest(kvm, base, &init_values, sizeof(init_values));
> - srcu_read_unlock(&kvm->srcu, idx);
> + kvm_write_guest_lock(kvm, base, &init_values, sizeof(init_values));
>
> return base;
> }
> --
> 1.8.3.1
>
Reviewed-by: Andrew Jones <drjones@redhat.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document
2020-08-17 8:47 ` Andrew Jones
@ 2020-08-17 9:02 ` zhukeqian
0 siblings, 0 replies; 13+ messages in thread
From: zhukeqian @ 2020-08-17 9:02 UTC (permalink / raw)
To: Andrew Jones
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Marc Zyngier,
Catalin Marinas, Will Deacon, James Morse, Suzuki K Poulose,
Steven Price, wanghaibin.wang
Hi Andrew,
On 2020/8/17 16:47, Andrew Jones wrote:
> On Mon, Aug 17, 2020 at 11:37:27AM +0800, Keqian Zhu wrote:
>> Rename PV_FEATURES tp PV_TIME_FEATURES
>>
>> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
>> ---
>> Documentation/virt/kvm/arm/pvtime.rst | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/Documentation/virt/kvm/arm/pvtime.rst b/Documentation/virt/kvm/arm/pvtime.rst
>> index 687b60d..94bffe2 100644
>> --- a/Documentation/virt/kvm/arm/pvtime.rst
>> +++ b/Documentation/virt/kvm/arm/pvtime.rst
>> @@ -3,7 +3,7 @@
>> Paravirtualized time support for arm64
>> ======================================
>>
>> -Arm specification DEN0057/A defines a standard for paravirtualised time
>> +Arm specification DEN0057/A defines a standard for paravirtualized time
>> support for AArch64 guests:
>>
>> https://developer.arm.com/docs/den0057/a
>> @@ -19,8 +19,8 @@ Two new SMCCC compatible hypercalls are defined:
>>
>> These are only available in the SMC64/HVC64 calling convention as
>> paravirtualized time is not available to 32 bit Arm guests. The existence of
>> -the PV_FEATURES hypercall should be probed using the SMCCC 1.1 ARCH_FEATURES
>> -mechanism before calling it.
>> +the PV_TIME_FEATURES hypercall should be probed using the SMCCC 1.1
>> +ARCH_FEATURES mechanism before calling it.
>>
>> PV_TIME_FEATURES
>> ============= ======== ==========
>> --
>> 1.8.3.1
>>
>
> Reviewed-by: Andrew Jones <drjones@redhat.com>
Thanks for your review.
Also It will be very nice if you have time to review the patch series
supporting pvtime LPT.
Thanks,
Keqian
>
> .
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
2020-08-17 8:47 ` Andrew Jones
@ 2020-08-17 9:39 ` Steven Price
1 sibling, 0 replies; 13+ messages in thread
From: Steven Price @ 2020-08-17 9:39 UTC (permalink / raw)
To: Keqian Zhu, linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, wanghaibin.wang
On 17/08/2020 04:37, Keqian Zhu wrote:
> Rename PV_FEATURES tp PV_TIME_FEATURES
^^
Typos are sadly far too easy in documentation...
>
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> Documentation/virt/kvm/arm/pvtime.rst | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/virt/kvm/arm/pvtime.rst b/Documentation/virt/kvm/arm/pvtime.rst
> index 687b60d..94bffe2 100644
> --- a/Documentation/virt/kvm/arm/pvtime.rst
> +++ b/Documentation/virt/kvm/arm/pvtime.rst
> @@ -3,7 +3,7 @@
> Paravirtualized time support for arm64
> ======================================
>
> -Arm specification DEN0057/A defines a standard for paravirtualised time
> +Arm specification DEN0057/A defines a standard for paravirtualized time
> support for AArch64 guests:
>
> https://developer.arm.com/docs/den0057/a
> @@ -19,8 +19,8 @@ Two new SMCCC compatible hypercalls are defined:
>
> These are only available in the SMC64/HVC64 calling convention as
> paravirtualized time is not available to 32 bit Arm guests. The existence of
> -the PV_FEATURES hypercall should be probed using the SMCCC 1.1 ARCH_FEATURES
> -mechanism before calling it.
> +the PV_TIME_FEATURES hypercall should be probed using the SMCCC 1.1
> +ARCH_FEATURES mechanism before calling it.
>
> PV_TIME_FEATURES
> ============= ======== ==========
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
2020-08-17 8:43 ` zhukeqian
@ 2020-08-17 9:49 ` Steven Price
2020-08-17 10:56 ` zhukeqian
0 siblings, 1 reply; 13+ messages in thread
From: Steven Price @ 2020-08-17 9:49 UTC (permalink / raw)
To: zhukeqian, Marc Zyngier
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Catalin Marinas,
Will Deacon, James Morse, Suzuki K Poulose, wanghaibin.wang
On 17/08/2020 09:43, zhukeqian wrote:
> Hi Marc,
>
> On 2020/8/17 15:39, Marc Zyngier wrote:
>> On 2020-08-17 04:37, Keqian Zhu wrote:
>>> ARM64 PV-time ST is configured by userspace through vCPU attribute,
>>> and KVM_DEV_TYPE_ARM_PV_TIME is unused.
>>>
>>> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
>>> ---
>>> include/uapi/linux/kvm.h | 2 --
>>> tools/include/uapi/linux/kvm.h | 2 --
>>> 2 files changed, 4 deletions(-)
>>>
>>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>>> index 4fdf303..9a6b97e 100644
>>> --- a/include/uapi/linux/kvm.h
>>> +++ b/include/uapi/linux/kvm.h
>>> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
>>> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
>>> KVM_DEV_TYPE_XIVE,
>>> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
>>> - KVM_DEV_TYPE_ARM_PV_TIME,
>>> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
>>> KVM_DEV_TYPE_MAX,
>>> };
>>>
>>> diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
>>> index 4fdf303..9a6b97e 100644
>>> --- a/tools/include/uapi/linux/kvm.h
>>> +++ b/tools/include/uapi/linux/kvm.h
>>> @@ -1258,8 +1258,6 @@ enum kvm_device_type {
>>> #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS
>>> KVM_DEV_TYPE_XIVE,
>>> #define KVM_DEV_TYPE_XIVE KVM_DEV_TYPE_XIVE
>>> - KVM_DEV_TYPE_ARM_PV_TIME,
>>> -#define KVM_DEV_TYPE_ARM_PV_TIME KVM_DEV_TYPE_ARM_PV_TIME
>>> KVM_DEV_TYPE_MAX,
>>> };
>>
>> No. You can't drop anything from UAPI, used or not. Doing so will
>> break the compilation of any userspace that, for any reason, references
>> this value. We cannot reuse this value in the future either, as it would
>> create a we wouldn't know which device to create.
>>
>> It is pretty unfortunate that PV time has turned into such a train wreck,
>> but that's what we have now, and it has to stay.
> Well, I see. It is a sad thing indeed.
Sorry about that, this got refactored so many times I guess I lost track
of what was actually needed and this hunk remained when it should have
been removed.
I would hope that I'm the only one who has any userspace code which uses
this, but I guess we should still be cautious since this has been in
several releases now.
Steve
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time
2020-08-17 3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
2020-08-17 8:52 ` Andrew Jones
@ 2020-08-17 9:53 ` Steven Price
1 sibling, 0 replies; 13+ messages in thread
From: Steven Price @ 2020-08-17 9:53 UTC (permalink / raw)
To: Keqian Zhu, linux-kernel, linux-arm-kernel, kvmarm, kvm
Cc: Marc Zyngier, Catalin Marinas, Will Deacon, James Morse,
Suzuki K Poulose, wanghaibin.wang
On 17/08/2020 04:37, Keqian Zhu wrote:
> There is a lock version kvm_write_guest. Use it to simplify code.
>
> Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> arch/arm64/kvm/pvtime.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/arm64/kvm/pvtime.c b/arch/arm64/kvm/pvtime.c
> index f7b52ce..2b24e7f 100644
> --- a/arch/arm64/kvm/pvtime.c
> +++ b/arch/arm64/kvm/pvtime.c
> @@ -55,7 +55,6 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
> struct pvclock_vcpu_stolen_time init_values = {};
> struct kvm *kvm = vcpu->kvm;
> u64 base = vcpu->arch.steal.base;
> - int idx;
>
> if (base == GPA_INVALID)
> return base;
> @@ -66,10 +65,7 @@ gpa_t kvm_init_stolen_time(struct kvm_vcpu *vcpu)
> */
> vcpu->arch.steal.steal = 0;
> vcpu->arch.steal.last_steal = current->sched_info.run_delay;
> -
> - idx = srcu_read_lock(&kvm->srcu);
> - kvm_write_guest(kvm, base, &init_values, sizeof(init_values));
> - srcu_read_unlock(&kvm->srcu, idx);
> + kvm_write_guest_lock(kvm, base, &init_values, sizeof(init_values));
>
> return base;
> }
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type
2020-08-17 9:49 ` Steven Price
@ 2020-08-17 10:56 ` zhukeqian
0 siblings, 0 replies; 13+ messages in thread
From: zhukeqian @ 2020-08-17 10:56 UTC (permalink / raw)
To: Steven Price, Marc Zyngier
Cc: linux-kernel, linux-arm-kernel, kvmarm, kvm, Catalin Marinas,
Will Deacon, James Morse, Suzuki K Poulose, wanghaibin.wang
Hi Steven,
On 2020/8/17 17:49, Steven Price wrote:
> On 17/08/2020 09:43, zhukeqian wrote:
>> Hi Marc,
>>
[...]
>>>
>>> It is pretty unfortunate that PV time has turned into such a train wreck,
>>> but that's what we have now, and it has to stay.
>> Well, I see. It is a sad thing indeed.
>
> Sorry about that, this got refactored so many times I guess I lost track of what was actually needed and this hunk remained when it should have been removed.
>
It's fine :-) , not a serious problem.
> I would hope that I'm the only one who has any userspace code which uses this, but I guess we should still be cautious since this has been in several releases now.
>
OK. For insurance purposes, we ought to ignore this patch to avoid breaking any user-space program.
> Steve
> .
Thanks,
Keqian
>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2020-08-17 10:57 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 3:37 [PATCH 0/3] KVM: arm64: Some fixes and code adjustments for pvtime ST Keqian Zhu
2020-08-17 3:37 ` [PATCH 1/3] KVM: arm64: Some fixes of PV-time interface document Keqian Zhu
2020-08-17 8:47 ` Andrew Jones
2020-08-17 9:02 ` zhukeqian
2020-08-17 9:39 ` Steven Price
2020-08-17 3:37 ` [PATCH 2/3] KVM: uapi: Remove KVM_DEV_TYPE_ARM_PV_TIME in kvm_device_type Keqian Zhu
2020-08-17 7:39 ` Marc Zyngier
2020-08-17 8:43 ` zhukeqian
2020-08-17 9:49 ` Steven Price
2020-08-17 10:56 ` zhukeqian
2020-08-17 3:37 ` [PATCH 3/3] KVM: arm64: Use kvm_write_guest_lock when init stolen time Keqian Zhu
2020-08-17 8:52 ` Andrew Jones
2020-08-17 9:53 ` Steven Price
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).