[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v8 06/11] viridian: add missing context save helpers into synic and time modules


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Paul Durrant <paul.durrant@xxxxxxxxxx>
  • Date: Mon, 18 Mar 2019 11:20:54 +0000
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul.durrant@xxxxxxxxxx>, Wei Liu <wei.liu2@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 18 Mar 2019 11:21:15 +0000
  • Ironport-data: A9a23:bdVh7K0B8Y9KcpNqHPbDix16xV27qk9dZSB6A8VEDSB0RE9Odbcrpx KurzSVy6cG28CNQrZC0tmqA8YeK8IiABxOslxLRWRNh/vHDTueqv/g41JfkmkfiBsCCVYHMj gImn77Bkrrn1tqiru17ky6EVmIAahhn7ZDQhRn6wj7gOODiG4YS0DtmKCnIF3+scsfB4YwmB ECB+wlGLUClFrn9oeIHacOuWSkrY7F/3+2f+3kd7dYe6vrWwmytHZbHvozBhaor+O0Ads5U6 NG8oAobf+NGhg04FgSQURqu3MgAFRKRyXeo1ZcpzpEc+qdXKsOnr8n0qmT1I/JsXBwM1ylRv r6lMqYZ9MNqyXc+wz/7O+pNWJeWN5nKqDAGaB/3HQo6zx32Onh0oGapltnUAL8ymzmfcNpM1 OwmrNNO9GlscUVc5vQCQOiDtNhAdmdC3iT5Z955+SsSum+0LaEBOfj6FBIJCnY0oJ/uY+aII y6hgwKtmLT5qC4h56SReF4oF6v9IZCZMTA/BrYJGO2Ktkmhu/NC/54qld2cg7Nc1WnnSuXqd RfyiyX3MszFdPyiXR5Mo8hIAchdeFKIZi3r4O62XT2HtwsU8tsJBuQIyJNuKTVfBX9NLjhwo ZMCKMuQ5FoX6/G/vRs7fiTK1DH8Nt5YAhGkBhTt7dW8w3CBxM+gvABpKy1QWp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WOO8pQfWhZH2CkOdreE 357wQxh0QEIONaBSGm5+UNbKvNHHb6hHuRKaMKcINJ4w5SGGJ6YYvODQI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Currently the time module lacks vcpu context save helpers and the synic
module lacks domain context save helpers. These helpers are not yet
required but subsequent patches will require at least some of them so this
patch completes the set to avoid introducing them in an ad-hoc way.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
Reviewed-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>

v3:
 - Add missing callers so that they are not added in an ad-hoc way
---
 xen/arch/x86/hvm/viridian/private.h  | 10 ++++++++++
 xen/arch/x86/hvm/viridian/synic.c    | 10 ++++++++++
 xen/arch/x86/hvm/viridian/time.c     | 10 ++++++++++
 xen/arch/x86/hvm/viridian/viridian.c |  4 ++++
 4 files changed, 34 insertions(+)

diff --git a/xen/arch/x86/hvm/viridian/private.h 
b/xen/arch/x86/hvm/viridian/private.h
index 8c029f62c6..5078b2d2ab 100644
--- a/xen/arch/x86/hvm/viridian/private.h
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -85,6 +85,11 @@ void viridian_synic_save_vcpu_ctxt(const struct vcpu *v,
 void viridian_synic_load_vcpu_ctxt(
     struct vcpu *v, const struct hvm_viridian_vcpu_context *ctxt);
 
+void viridian_synic_save_domain_ctxt(
+    const struct domain *d, struct hvm_viridian_domain_context *ctxt);
+void viridian_synic_load_domain_ctxt(
+    struct domain *d, const struct hvm_viridian_domain_context *ctxt);
+
 int viridian_time_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val);
 int viridian_time_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val);
 
@@ -94,6 +99,11 @@ int viridian_time_domain_init(const struct domain *d);
 void viridian_time_vcpu_deinit(const struct vcpu *v);
 void viridian_time_domain_deinit(const struct domain *d);
 
+void viridian_time_save_vcpu_ctxt(
+    const struct vcpu *v, struct hvm_viridian_vcpu_context *ctxt);
+void viridian_time_load_vcpu_ctxt(
+    struct vcpu *v, const struct hvm_viridian_vcpu_context *ctxt);
+
 void viridian_time_save_domain_ctxt(
     const struct domain *d, struct hvm_viridian_domain_context *ctxt);
 void viridian_time_load_domain_ctxt(
diff --git a/xen/arch/x86/hvm/viridian/synic.c 
b/xen/arch/x86/hvm/viridian/synic.c
index 4b00dbe1b3..b8dab4b246 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -186,6 +186,16 @@ void viridian_synic_load_vcpu_ctxt(
     vv->apic_assist_pending = ctxt->apic_assist_pending;
 }
 
+void viridian_synic_save_domain_ctxt(
+    const struct domain *d, struct hvm_viridian_domain_context *ctxt)
+{
+}
+
+void viridian_synic_load_domain_ctxt(
+    struct domain *d, const struct hvm_viridian_domain_context *ctxt)
+{
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
index 48aca7e0ab..4399e62f54 100644
--- a/xen/arch/x86/hvm/viridian/time.c
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -233,6 +233,16 @@ void viridian_time_domain_deinit(const struct domain *d)
 {
 }
 
+void viridian_time_save_vcpu_ctxt(
+    const struct vcpu *v, struct hvm_viridian_vcpu_context *ctxt)
+{
+}
+
+void viridian_time_load_vcpu_ctxt(
+    struct vcpu *v, const struct hvm_viridian_vcpu_context *ctxt)
+{
+}
+
 void viridian_time_save_domain_ctxt(
     const struct domain *d, struct hvm_viridian_domain_context *ctxt)
 {
diff --git a/xen/arch/x86/hvm/viridian/viridian.c 
b/xen/arch/x86/hvm/viridian/viridian.c
index f9a509d918..742a988252 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -707,6 +707,7 @@ static int viridian_save_domain_ctxt(struct vcpu *v,
         return 0;
 
     viridian_time_save_domain_ctxt(d, &ctxt);
+    viridian_synic_save_domain_ctxt(d, &ctxt);
 
     return (hvm_save_entry(VIRIDIAN_DOMAIN, 0, h, &ctxt) != 0);
 }
@@ -723,6 +724,7 @@ static int viridian_load_domain_ctxt(struct domain *d,
     vd->hypercall_gpa.raw = ctxt.hypercall_gpa;
     vd->guest_os_id.raw = ctxt.guest_os_id;
 
+    viridian_synic_load_domain_ctxt(d, &ctxt);
     viridian_time_load_domain_ctxt(d, &ctxt);
 
     return 0;
@@ -738,6 +740,7 @@ static int viridian_save_vcpu_ctxt(struct vcpu *v, 
hvm_domain_context_t *h)
     if ( !is_viridian_vcpu(v) )
         return 0;
 
+    viridian_time_save_vcpu_ctxt(v, &ctxt);
     viridian_synic_save_vcpu_ctxt(v, &ctxt);
 
     return hvm_save_entry(VIRIDIAN_VCPU, v->vcpu_id, h, &ctxt);
@@ -764,6 +767,7 @@ static int viridian_load_vcpu_ctxt(struct domain *d,
         return -EINVAL;
 
     viridian_synic_load_vcpu_ctxt(v, &ctxt);
+    viridian_time_load_vcpu_ctxt(v, &ctxt);
 
     return 0;
 }
-- 
2.20.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.