aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ene <sebastianene@google.com>2022-03-24 15:43:05 +0000
committerWill Deacon <will@kernel.org>2022-04-04 11:18:02 +0100
commitffa8654620b70053657adf472d505deae2adb2a5 (patch)
treea4b77cf2a48f6c3f16cc6b59f703ebec9d7401a3
parentfaae833a746f1c59f64fb05e9c08e62b5b0002eb (diff)
downloadkvmtool-ffa8654620b70053657adf472d505deae2adb2a5.tar.gz
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 <sebastianene@google.com> Link: https://lore.kernel.org/r/20220324154304.2572891-1-sebastianene@google.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--arm/aarch64/include/kvm/kvm-config-arch.h5
-rw-r--r--arm/aarch64/pvtime.c4
-rw-r--r--arm/include/arm-common/kvm-config-arch.h1
-rw-r--r--builtin-run.c2
-rw-r--r--include/kvm/kvm-config.h1
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 04be43df..a9b05766 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 2f5774e9..a49cf3ed 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 5734c46a..9f97778d 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 7c8be9d8..9a1a0c1f 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 48adf274..6a5720c4 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