@@ -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 */
@@ -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;
@@ -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);
@@ -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", \
@@ -62,7 +62,6 @@ struct kvm_config {
bool no_dhcp;
bool ioport_debug;
bool mmio_debug;
- bool no_pvtime;
};
#endif
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@google.com> --- 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(-)