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 <sebastianene@xxxxxxxxxx> --- 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(-) diff --git a/arm/aarch64/include/kvm/kvm-config-arch.h b/arm/aarch64/include/kvm/kvm-config-arch.h index 04be43d..a9b0576 100644 --- a/arm/aarch64/include/kvm/kvm-config-arch.h +++ b/arm/aarch64/include/kvm/kvm-config-arch.h @@ -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 */ diff --git a/arm/aarch64/pvtime.c b/arm/aarch64/pvtime.c index 2f5774e..a49cf3e 100644 --- a/arm/aarch64/pvtime.c +++ b/arm/aarch64/pvtime.c @@ -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; diff --git a/arm/include/arm-common/kvm-config-arch.h b/arm/include/arm-common/kvm-config-arch.h index 5734c46..9f97778 100644 --- a/arm/include/arm-common/kvm-config-arch.h +++ b/arm/include/arm-common/kvm-config-arch.h @@ -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); diff --git a/builtin-run.c b/builtin-run.c index 7c8be9d..9a1a0c1 100644 --- a/builtin-run.c +++ b/builtin-run.c @@ -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", \ diff --git a/include/kvm/kvm-config.h b/include/kvm/kvm-config.h index 48adf27..6a5720c 100644 --- a/include/kvm/kvm-config.h +++ b/include/kvm/kvm-config.h @@ -62,7 +62,6 @@ struct kvm_config { bool no_dhcp; bool ioport_debug; bool mmio_debug; - bool no_pvtime; }; #endif -- 2.35.1.894.gb6a874cedc-goog