From: Oliver Upton <oupton@google.com>
To: kvmarm@lists.cs.columbia.edu
Cc: kvm@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
Peter Shier <pshier@google.com>,
Ricardo Koller <ricarkol@google.com>,
Reiji Watanabe <reijiw@google.com>, Will Deacon <will@kernel.org>,
Julien Thierry <julien.thierry.kdev@gmail.com>,
Oliver Upton <oupton@google.com>
Subject: [RFC PATCH kvmtool 3/5] ARM: Stash vcpu_init in the vCPU structure
Date: Fri, 11 Mar 2022 17:57:15 +0000 [thread overview]
Message-ID: <20220311175717.616958-4-oupton@google.com> (raw)
In-Reply-To: <20220311175717.616958-1-oupton@google.com>
A subsequent change to kvmtool will require that a vCPU be reset more
than once. Derive a valid target/feature set exactly once and stash that
for later use.
Signed-off-by: Oliver Upton <oupton@google.com>
---
arm/include/arm-common/kvm-cpu-arch.h | 18 +++++++++---------
arm/kvm-cpu.c | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/arm/include/arm-common/kvm-cpu-arch.h b/arm/include/arm-common/kvm-cpu-arch.h
index 923d2c4..4027afe 100644
--- a/arm/include/arm-common/kvm-cpu-arch.h
+++ b/arm/include/arm-common/kvm-cpu-arch.h
@@ -10,18 +10,18 @@ struct kvm;
struct kvm_cpu {
pthread_t thread;
- unsigned long cpu_id;
- unsigned long cpu_type;
- const char *cpu_compatible;
+ unsigned long cpu_id;
+ struct kvm_vcpu_init init;
+ const char *cpu_compatible;
- struct kvm *kvm;
- int vcpu_fd;
- struct kvm_run *kvm_run;
+ struct kvm *kvm;
+ int vcpu_fd;
+ struct kvm_run *kvm_run;
struct kvm_cpu_task *task;
- u8 is_running;
- u8 paused;
- u8 needs_nmi;
+ u8 is_running;
+ u8 paused;
+ u8 needs_nmi;
struct kvm_coalesced_mmio_ring *ring;
diff --git a/arm/kvm-cpu.c b/arm/kvm-cpu.c
index 6a2408c..1ea56bb 100644
--- a/arm/kvm-cpu.c
+++ b/arm/kvm-cpu.c
@@ -128,7 +128,7 @@ struct kvm_cpu *kvm_cpu__arch_init(struct kvm *kvm, unsigned long cpu_id)
/* Populate the vcpu structure. */
vcpu->kvm = kvm;
vcpu->cpu_id = cpu_id;
- vcpu->cpu_type = vcpu_init.target;
+ vcpu->init = vcpu_init;
vcpu->cpu_compatible = target->compatible;
vcpu->is_running = true;
--
2.35.1.723.g4982287a31-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-03-11 17:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220311174001.605719-1-oupton@google.com>
2022-03-11 17:57 ` [RFC PATCH kvmtool 0/5] ARM: Implement PSCI SYSTEM_SUSPEND Oliver Upton
2022-03-11 17:57 ` [RFC PATCH kvmtool 1/5] TESTONLY: Sync KVM headers with pending changes Oliver Upton
2022-03-11 17:57 ` [RFC PATCH kvmtool 2/5] Allow architectures to hook KVM_EXIT_SYSTEM_EVENT Oliver Upton
2022-03-11 17:57 ` Oliver Upton [this message]
2022-03-11 17:57 ` [RFC PATCH kvmtool 4/5] ARM: Add a helper to re-init a vCPU Oliver Upton
2022-03-11 17:57 ` [RFC PATCH kvmtool 5/5] ARM: Implement PSCI SYSTEM_SUSPEND Oliver Upton
2022-05-06 13:01 ` [RFC PATCH kvmtool 0/5] " Will Deacon
2022-05-06 19:18 ` Oliver Upton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220311175717.616958-4-oupton@google.com \
--to=oupton@google.com \
--cc=alexandru.elisei@arm.com \
--cc=james.morse@arm.com \
--cc=julien.thierry.kdev@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=pshier@google.com \
--cc=reijiw@google.com \
--cc=ricarkol@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox