Make --no-pvtime command argument arm specific
PATCH 1/1 Make --no-pvtime command argument arm specific
The stolen time option is available only for aarch64 and is enabled by default. Move the option that disables stolen time functionality in the arch specific path.
Signed-off-by Sebastian Ene <[email protected]>
--- arm/aarch64/include/kvm/kvm-config-arch.h | 5 +++-- arm/aarch64/pvtime.c | 4 ++-- arm/include/arm-common/kvm-config-arch.h | 1 + builtin-run.c | 2 -- include/kvm/kvm-config.h | 1 - 5 files changed, 6 insertions(+), 7 deletions(-)
arm/aarch64/include/kvm/kvm-config-arch.h +3 -2
@@ -8,8 +8,9 @@ "Create PMUv3 device"), \OPT_U64 ('\0' ,"kaslr-seed" , &(cfg)->kaslr_seed, \"Specify random seed for Kernel Address Space " \ -"Layout Randomization (KASLR)" ), - +"Layout Randomization (KASLR)" ), \ +OPT_BOOLEAN ('\0' ,"no-pvtime" , &(cfg)->no_pvtime,"Disable" \ +" stolen time" ), #include "arm-common/kvm-config-arch.h"#endif /* KVM__KVM_CONFIG_ARCH_H */
arm/aarch64/pvtime.c +2 -2
@@ -48,13 +48,13 @@ int kvm_cpu__setup_pvtime(struct kvm_cpu *vcpu)bool has_stolen_time;u64 pvtime_guest_addr =ARM_PVTIME_BASE + vcpu->cpu_id *ARM_PVTIME_STRUCT_SIZE ; -struct kvm_config *kvm_cfg =NULL ; +struct kvm_config_arch *kvm_cfg =NULL ;struct kvm_device_attr pvtime_attr = (struct kvm_device_attr ) { .group =KVM_ARM_VCPU_PVTIME_CTRL , .attr =KVM_ARM_VCPU_PVTIME_IPA }; - kvm_cfg = &vcpu->kvm->cfg; + kvm_cfg = &vcpu->kvm->cfg.arch;if (kvm_cfg->no_pvtime)return 0 ;
arm/include/arm-common/kvm-config-arch.h +1 -0
@@ -12,6 +12,7 @@ struct kvm_config_arch {u64 kaslr_seed;enum irqchip_type irqchip;u64 fw_addr; +bool no_pvtime; };int irqchip_parser (const struct option *opt,const char *arg,int unset);
builtin-run.c +0 -2
@@ -128,8 +128,6 @@ void kvm_run_set_wrapper_sandbox(void) " rootfs"), \OPT_STRING ('\0' ,"hugetlbfs" , &(cfg)->hugetlbfs_path,"path" , \"Hugetlbfs path" ), \ -OPT_BOOLEAN ('\0' ,"no-pvtime" , &(cfg)->no_pvtime,"Disable" \ -" stolen time" ), \ \OPT_GROUP ("Kernel options:" ), \ OPT_STRING('k', "kernel", &(cfg)->kernel_filename, "kernel", \
include/kvm/kvm-config.h +0 -1
@@ -62,7 +62,6 @@ struct kvm_config {bool no_dhcp;bool ioport_debug; bool mmio_debug; - bool no_pvtime; };#endif
Signature · 1 line
2.35.1.894.gb6a874cedc-goog
Will Deacon
AppliedQuoted 5 lines · Sebastian Ene
The stolen time option is available only for aarch64 and is enabled by default. Move the option that disables stolen time functionality in the arch specific path.
Applied to kvmtool (master), thanks!
[1/1] Make --no-pvtime command argument arm specific
https://git.kernel.org/will/kvmtool/c/ffa8654620b7
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev