All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] (remainder of) viridian cleanup
@ 2018-11-07 10:52 Paul Durrant
  2018-11-07 10:52 ` [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations Paul Durrant
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Paul Durrant

I plan to add implementations for more viridian enlightenments in the near
future. This series is the remainder, since v2, of the cleanup I've been
doing in preparation.

Paul Durrant (5):
  viridian: separate interrupt related enlightenment implementations...
  viridian: separate time related enlightenment implementations...
  viridian: define type for the 'virtual VP assist page'
  tools/misc: fix hard tabs in xen-hvmctx.c
  viridian: introduce struct viridian_page

 tools/misc/xen-hvmctx.c                |  18 +-
 xen/arch/x86/hvm/viridian/Makefile     |   2 +
 xen/arch/x86/hvm/viridian/private.h    | 105 ++++++++
 xen/arch/x86/hvm/viridian/synic.c      | 176 +++++++++++++
 xen/arch/x86/hvm/viridian/time.c       | 244 +++++++++++++++++
 xen/arch/x86/hvm/viridian/viridian.c   | 460 ++++++---------------------------
 xen/include/asm-x86/hvm/viridian.h     |  22 +-
 xen/include/public/arch-x86/hvm/save.h |   2 +-
 8 files changed, 625 insertions(+), 404 deletions(-)
 create mode 100644 xen/arch/x86/hvm/viridian/private.h
 create mode 100644 xen/arch/x86/hvm/viridian/synic.c
 create mode 100644 xen/arch/x86/hvm/viridian/time.c

-- 
2.11.0


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations...
  2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
@ 2018-11-07 10:52 ` Paul Durrant
  2018-11-07 11:36   ` Roger Pau Monné
  2018-11-07 10:52 ` [PATCH v3 2/5] viridian: separate time " Paul Durrant
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Jan Beulich

...into new 'synic' module.

The SynIC (synthetic interrupt controller) is specified [1] to be a super-
set of a virtualized LAPIC, and its definition encompasses all
enlightenments related to virtual interrupt control.

This patch reduces the size of the main viridian source module by giving
these enlightenments their own module. This is done in anticipation of
implementation of more such enlightenments and a desire not to further
lengthen then main source module when this work is done.

Whilst moving the code:

- Fix various style issues.
- Move the MSR definitions into the header (since they are now needed in
  more than one source module).

[1] https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v5.0C.pdf

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

v3:
 - Add new private header file to host MSR definitions and local function
   prototypes
 - Adding Wei's R-b since the changes from v2 are just further code
   movement

v2:
 - Sort headers alphabetically and separate asm/ amd xen/ sections
 - Constify vcpu context during load
---
 xen/arch/x86/hvm/viridian/Makefile   |   1 +
 xen/arch/x86/hvm/viridian/private.h  |  92 ++++++++++++++
 xen/arch/x86/hvm/viridian/synic.c    | 224 ++++++++++++++++++++++++++++++++++
 xen/arch/x86/hvm/viridian/viridian.c | 229 ++---------------------------------
 4 files changed, 328 insertions(+), 218 deletions(-)
 create mode 100644 xen/arch/x86/hvm/viridian/private.h
 create mode 100644 xen/arch/x86/hvm/viridian/synic.c

diff --git a/xen/arch/x86/hvm/viridian/Makefile b/xen/arch/x86/hvm/viridian/Makefile
index 09fd0a5f3c..fca8e16e20 100644
--- a/xen/arch/x86/hvm/viridian/Makefile
+++ b/xen/arch/x86/hvm/viridian/Makefile
@@ -1 +1,2 @@
+obj-y += synic.o
 obj-y += viridian.o
diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h
new file mode 100644
index 0000000000..5b4992d118
--- /dev/null
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -0,0 +1,92 @@
+/* Copyright (c) 2018 Citrix Systems Inc. */
+
+#ifndef X86_HVM_VIRIDIAN_PRIVATE_H
+#define X86_HVM_VIRIDIAN_PRIVATE_H
+
+#include <asm/hvm/save.h>
+
+/* Viridian MSR numbers. */
+#define HV_X64_MSR_GUEST_OS_ID                   0x40000000
+#define HV_X64_MSR_HYPERCALL                     0x40000001
+#define HV_X64_MSR_VP_INDEX                      0x40000002
+#define HV_X64_MSR_RESET                         0x40000003
+#define HV_X64_MSR_VP_RUNTIME                    0x40000010
+#define HV_X64_MSR_TIME_REF_COUNT                0x40000020
+#define HV_X64_MSR_REFERENCE_TSC                 0x40000021
+#define HV_X64_MSR_TSC_FREQUENCY                 0x40000022
+#define HV_X64_MSR_APIC_FREQUENCY                0x40000023
+#define HV_X64_MSR_EOI                           0x40000070
+#define HV_X64_MSR_ICR                           0x40000071
+#define HV_X64_MSR_TPR                           0x40000072
+#define HV_X64_MSR_VP_ASSIST_PAGE                0x40000073
+#define HV_X64_MSR_SCONTROL                      0x40000080
+#define HV_X64_MSR_SVERSION                      0x40000081
+#define HV_X64_MSR_SIEFP                         0x40000082
+#define HV_X64_MSR_SIMP                          0x40000083
+#define HV_X64_MSR_EOM                           0x40000084
+#define HV_X64_MSR_SINT0                         0x40000090
+#define HV_X64_MSR_SINT1                         0x40000091
+#define HV_X64_MSR_SINT2                         0x40000092
+#define HV_X64_MSR_SINT3                         0x40000093
+#define HV_X64_MSR_SINT4                         0x40000094
+#define HV_X64_MSR_SINT5                         0x40000095
+#define HV_X64_MSR_SINT6                         0x40000096
+#define HV_X64_MSR_SINT7                         0x40000097
+#define HV_X64_MSR_SINT8                         0x40000098
+#define HV_X64_MSR_SINT9                         0x40000099
+#define HV_X64_MSR_SINT10                        0x4000009A
+#define HV_X64_MSR_SINT11                        0x4000009B
+#define HV_X64_MSR_SINT12                        0x4000009C
+#define HV_X64_MSR_SINT13                        0x4000009D
+#define HV_X64_MSR_SINT14                        0x4000009E
+#define HV_X64_MSR_SINT15                        0x4000009F
+#define HV_X64_MSR_STIMER0_CONFIG                0x400000B0
+#define HV_X64_MSR_STIMER0_COUNT                 0x400000B1
+#define HV_X64_MSR_STIMER1_CONFIG                0x400000B2
+#define HV_X64_MSR_STIMER1_COUNT                 0x400000B3
+#define HV_X64_MSR_STIMER2_CONFIG                0x400000B4
+#define HV_X64_MSR_STIMER2_COUNT                 0x400000B5
+#define HV_X64_MSR_STIMER3_CONFIG                0x400000B6
+#define HV_X64_MSR_STIMER3_COUNT                 0x400000B7
+#define HV_X64_MSR_POWER_STATE_TRIGGER_C1        0x400000C1
+#define HV_X64_MSR_POWER_STATE_TRIGGER_C2        0x400000C2
+#define HV_X64_MSR_POWER_STATE_TRIGGER_C3        0x400000C3
+#define HV_X64_MSR_POWER_STATE_CONFIG_C1         0x400000D1
+#define HV_X64_MSR_POWER_STATE_CONFIG_C2         0x400000D2
+#define HV_X64_MSR_POWER_STATE_CONFIG_C3         0x400000D3
+#define HV_X64_MSR_STATS_PARTITION_RETAIL_PAGE   0x400000E0
+#define HV_X64_MSR_STATS_PARTITION_INTERNAL_PAGE 0x400000E1
+#define HV_X64_MSR_STATS_VP_RETAIL_PAGE          0x400000E2
+#define HV_X64_MSR_STATS_VP_INTERNAL_PAGE        0x400000E3
+#define HV_X64_MSR_GUEST_IDLE                    0x400000F0
+#define HV_X64_MSR_SYNTH_DEBUG_CONTROL           0x400000F1
+#define HV_X64_MSR_SYNTH_DEBUG_STATUS            0x400000F2
+#define HV_X64_MSR_SYNTH_DEBUG_SEND_BUFFER       0x400000F3
+#define HV_X64_MSR_SYNTH_DEBUG_RECEIVE_BUFFER    0x400000F4
+#define HV_X64_MSR_SYNTH_DEBUG_PENDING_BUFFER    0x400000F5
+#define HV_X64_MSR_CRASH_P0                      0x40000100
+#define HV_X64_MSR_CRASH_P1                      0x40000101
+#define HV_X64_MSR_CRASH_P2                      0x40000102
+#define HV_X64_MSR_CRASH_P3                      0x40000103
+#define HV_X64_MSR_CRASH_P4                      0x40000104
+#define HV_X64_MSR_CRASH_CTL                     0x40000105
+
+int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val);
+int viridian_synic_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val);
+
+void viridian_synic_save_vcpu_ctxt(const struct vcpu *v,
+                                   struct hvm_viridian_vcpu_context *ctxt);
+void viridian_synic_load_vcpu_ctxt(
+    struct vcpu *v, const struct hvm_viridian_vcpu_context *ctxt);
+
+#endif /* X86_HVM_VIRIDIAN_PRIVATE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
new file mode 100644
index 0000000000..366608208f
--- /dev/null
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -0,0 +1,224 @@
+/***************************************************************************
+ * synic.c
+ *
+ * An implementation of some interrupt related Viridian enlightenments.
+ * See Microsoft's Hypervisor Top Level Functional Specification.
+ * for more information.
+ */
+
+#include <xen/domain_page.h>
+#include <xen/hypercall.h>
+#include <xen/sched.h>
+#include <xen/version.h>
+
+#include <asm/apic.h>
+#include <asm/hvm/support.h>
+
+#include "private.h"
+
+static void dump_vp_assist(const struct vcpu *v)
+{
+    const union viridian_page_msr *va = &v->arch.hvm.viridian.vp_assist.msr;
+
+    if ( !va->fields.enabled )
+        return;
+
+    printk(XENLOG_G_INFO "%pv: VIRIDIAN VP_ASSIST_PAGE: pfn: %lx\n",
+           v, (unsigned long)va->fields.pfn);
+}
+
+static void initialize_vp_assist(struct vcpu *v)
+{
+    struct domain *d = v->domain;
+    unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
+    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+    void *va;
+
+    ASSERT(!v->arch.hvm.viridian.vp_assist.va);
+
+    if ( !page )
+        goto fail;
+
+    if ( !get_page_type(page, PGT_writable_page) )
+    {
+        put_page(page);
+        goto fail;
+    }
+
+    va = __map_domain_page_global(page);
+    if ( !va )
+    {
+        put_page_and_type(page);
+        goto fail;
+    }
+
+    clear_page(va);
+
+    v->arch.hvm.viridian.vp_assist.va = va;
+    return;
+
+ fail:
+    gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
+             gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
+}
+
+static void teardown_vp_assist(struct vcpu *v)
+{
+    void *va = v->arch.hvm.viridian.vp_assist.va;
+    struct page_info *page;
+
+    if ( !va )
+        return;
+
+    v->arch.hvm.viridian.vp_assist.va = NULL;
+
+    page = mfn_to_page(domain_page_map_to_mfn(va));
+
+    unmap_domain_page_global(va);
+    put_page_and_type(page);
+}
+
+void viridian_apic_assist_set(struct vcpu *v)
+{
+    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+
+    if ( !va )
+        return;
+
+    /*
+     * If there is already an assist pending then something has gone
+     * wrong and the VM will most likely hang so force a crash now
+     * to make the problem clear.
+     */
+    if ( v->arch.hvm.viridian.vp_assist.pending )
+        domain_crash(v->domain);
+
+    v->arch.hvm.viridian.vp_assist.pending = true;
+    *va |= 1u;
+}
+
+bool viridian_apic_assist_completed(struct vcpu *v)
+{
+    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+
+    if ( !va )
+        return false;
+
+    if ( v->arch.hvm.viridian.vp_assist.pending &&
+         !(*va & 1u) )
+    {
+        /* An EOI has been avoided */
+        v->arch.hvm.viridian.vp_assist.pending = false;
+        return true;
+    }
+
+    return false;
+}
+
+void viridian_apic_assist_clear(struct vcpu *v)
+{
+    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+
+    if ( !va )
+        return;
+
+    *va &= ~1u;
+    v->arch.hvm.viridian.vp_assist.pending = false;
+}
+
+int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
+{
+    switch ( idx )
+    {
+    case HV_X64_MSR_EOI:
+        vlapic_EOI_set(vcpu_vlapic(v));
+        break;
+
+    case HV_X64_MSR_ICR: {
+        u32 eax = (u32)val, edx = (u32)(val >> 32);
+        struct vlapic *vlapic = vcpu_vlapic(v);
+        eax &= ~(1 << 12);
+        edx &= 0xff000000;
+        vlapic_set_reg(vlapic, APIC_ICR2, edx);
+        vlapic_ipi(vlapic, eax, edx);
+        vlapic_set_reg(vlapic, APIC_ICR, eax);
+        break;
+    }
+    case HV_X64_MSR_TPR:
+        vlapic_set_reg(vcpu_vlapic(v), APIC_TASKPRI, (uint8_t)val);
+        break;
+
+    case HV_X64_MSR_VP_ASSIST_PAGE:
+        teardown_vp_assist(v); /* release any previous mapping */
+        v->arch.hvm.viridian.vp_assist.msr.raw = val;
+        dump_vp_assist(v);
+        if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
+            initialize_vp_assist(v);
+        break;
+
+    default:
+        gdprintk(XENLOG_INFO, "%s: unimplemented MSR %#x (%016"PRIx64")\n",
+                 __func__, idx, val);
+        return X86EMUL_EXCEPTION;
+    }
+
+    return X86EMUL_OKAY;
+}
+
+int viridian_synic_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val)
+{
+    switch ( idx )
+    {
+    case HV_X64_MSR_EOI:
+        return X86EMUL_EXCEPTION;
+
+    case HV_X64_MSR_ICR:
+    {
+        uint32_t icr2 = vlapic_get_reg(vcpu_vlapic(v), APIC_ICR2);
+        uint32_t icr = vlapic_get_reg(vcpu_vlapic(v), APIC_ICR);
+
+        *val = ((uint64_t)icr2 << 32) | icr;
+        break;
+    }
+    case HV_X64_MSR_TPR:
+        *val = vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI);
+        break;
+
+    case HV_X64_MSR_VP_ASSIST_PAGE:
+        *val = v->arch.hvm.viridian.vp_assist.msr.raw;
+        break;
+
+    default:
+        gdprintk(XENLOG_INFO, "%s: unimplemented MSR %#x\n", __func__, idx);
+        return X86EMUL_EXCEPTION;
+    }
+
+    return X86EMUL_OKAY;
+}
+
+void viridian_synic_save_vcpu_ctxt(const struct vcpu *v,
+                                   struct hvm_viridian_vcpu_context *ctxt)
+{
+    ctxt->vp_assist_pending = v->arch.hvm.viridian.vp_assist.pending;
+    ctxt->vp_assist_msr = v->arch.hvm.viridian.vp_assist.msr.raw;
+}
+
+void viridian_synic_load_vcpu_ctxt(
+    struct vcpu *v, const struct hvm_viridian_vcpu_context *ctxt)
+{
+    v->arch.hvm.viridian.vp_assist.msr.raw = ctxt->vp_assist_msr;
+    if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
+        initialize_vp_assist(v);
+
+    v->arch.hvm.viridian.vp_assist.pending = !!ctxt->vp_assist_pending;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 2dc86dd0f3..68a79298aa 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -17,71 +17,7 @@
 #include <public/sched.h>
 #include <public/hvm/hvm_op.h>
 
-/* Viridian MSR numbers. */
-#define HV_X64_MSR_GUEST_OS_ID                   0x40000000
-#define HV_X64_MSR_HYPERCALL                     0x40000001
-#define HV_X64_MSR_VP_INDEX                      0x40000002
-#define HV_X64_MSR_RESET                         0x40000003
-#define HV_X64_MSR_VP_RUNTIME                    0x40000010
-#define HV_X64_MSR_TIME_REF_COUNT                0x40000020
-#define HV_X64_MSR_REFERENCE_TSC                 0x40000021
-#define HV_X64_MSR_TSC_FREQUENCY                 0x40000022
-#define HV_X64_MSR_APIC_FREQUENCY                0x40000023
-#define HV_X64_MSR_EOI                           0x40000070
-#define HV_X64_MSR_ICR                           0x40000071
-#define HV_X64_MSR_TPR                           0x40000072
-#define HV_X64_MSR_VP_ASSIST_PAGE                0x40000073
-#define HV_X64_MSR_SCONTROL                      0x40000080
-#define HV_X64_MSR_SVERSION                      0x40000081
-#define HV_X64_MSR_SIEFP                         0x40000082
-#define HV_X64_MSR_SIMP                          0x40000083
-#define HV_X64_MSR_EOM                           0x40000084
-#define HV_X64_MSR_SINT0                         0x40000090
-#define HV_X64_MSR_SINT1                         0x40000091
-#define HV_X64_MSR_SINT2                         0x40000092
-#define HV_X64_MSR_SINT3                         0x40000093
-#define HV_X64_MSR_SINT4                         0x40000094
-#define HV_X64_MSR_SINT5                         0x40000095
-#define HV_X64_MSR_SINT6                         0x40000096
-#define HV_X64_MSR_SINT7                         0x40000097
-#define HV_X64_MSR_SINT8                         0x40000098
-#define HV_X64_MSR_SINT9                         0x40000099
-#define HV_X64_MSR_SINT10                        0x4000009A
-#define HV_X64_MSR_SINT11                        0x4000009B
-#define HV_X64_MSR_SINT12                        0x4000009C
-#define HV_X64_MSR_SINT13                        0x4000009D
-#define HV_X64_MSR_SINT14                        0x4000009E
-#define HV_X64_MSR_SINT15                        0x4000009F
-#define HV_X64_MSR_STIMER0_CONFIG                0x400000B0
-#define HV_X64_MSR_STIMER0_COUNT                 0x400000B1
-#define HV_X64_MSR_STIMER1_CONFIG                0x400000B2
-#define HV_X64_MSR_STIMER1_COUNT                 0x400000B3
-#define HV_X64_MSR_STIMER2_CONFIG                0x400000B4
-#define HV_X64_MSR_STIMER2_COUNT                 0x400000B5
-#define HV_X64_MSR_STIMER3_CONFIG                0x400000B6
-#define HV_X64_MSR_STIMER3_COUNT                 0x400000B7
-#define HV_X64_MSR_POWER_STATE_TRIGGER_C1        0x400000C1
-#define HV_X64_MSR_POWER_STATE_TRIGGER_C2        0x400000C2
-#define HV_X64_MSR_POWER_STATE_TRIGGER_C3        0x400000C3
-#define HV_X64_MSR_POWER_STATE_CONFIG_C1         0x400000D1
-#define HV_X64_MSR_POWER_STATE_CONFIG_C2         0x400000D2
-#define HV_X64_MSR_POWER_STATE_CONFIG_C3         0x400000D3
-#define HV_X64_MSR_STATS_PARTITION_RETAIL_PAGE   0x400000E0
-#define HV_X64_MSR_STATS_PARTITION_INTERNAL_PAGE 0x400000E1
-#define HV_X64_MSR_STATS_VP_RETAIL_PAGE          0x400000E2
-#define HV_X64_MSR_STATS_VP_INTERNAL_PAGE        0x400000E3
-#define HV_X64_MSR_GUEST_IDLE                    0x400000F0
-#define HV_X64_MSR_SYNTH_DEBUG_CONTROL           0x400000F1
-#define HV_X64_MSR_SYNTH_DEBUG_STATUS            0x400000F2
-#define HV_X64_MSR_SYNTH_DEBUG_SEND_BUFFER       0x400000F3
-#define HV_X64_MSR_SYNTH_DEBUG_RECEIVE_BUFFER    0x400000F4
-#define HV_X64_MSR_SYNTH_DEBUG_PENDING_BUFFER    0x400000F5
-#define HV_X64_MSR_CRASH_P0                      0x40000100
-#define HV_X64_MSR_CRASH_P1                      0x40000101
-#define HV_X64_MSR_CRASH_P2                      0x40000102
-#define HV_X64_MSR_CRASH_P3                      0x40000103
-#define HV_X64_MSR_CRASH_P4                      0x40000104
-#define HV_X64_MSR_CRASH_CTL                     0x40000105
+#include "private.h"
 
 /* Viridian Hypercall Status Codes. */
 #define HV_STATUS_SUCCESS                       0x0000
@@ -309,16 +245,6 @@ static void dump_hypercall(const struct domain *d)
            hg->fields.enabled, (unsigned long)hg->fields.pfn);
 }
 
-static void dump_vp_assist(const struct vcpu *v)
-{
-    const union viridian_page_msr *va;
-
-    va = &v->arch.hvm.viridian.vp_assist.msr;
-
-    printk(XENLOG_G_INFO "%pv: VIRIDIAN VP_ASSIST_PAGE: enabled: %x pfn: %lx\n",
-           v, va->fields.enabled, (unsigned long)va->fields.pfn);
-}
-
 static void dump_reference_tsc(const struct domain *d)
 {
     const union viridian_page_msr *rt;
@@ -364,105 +290,6 @@ static void enable_hypercall_page(struct domain *d)
     put_page_and_type(page);
 }
 
-static void initialize_vp_assist(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
-    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
-    void *va;
-
-    ASSERT(!v->arch.hvm.viridian.vp_assist.va);
-
-    if ( !page )
-        goto fail;
-
-    if ( !get_page_type(page, PGT_writable_page) )
-    {
-        put_page(page);
-        goto fail;
-    }
-
-    va = __map_domain_page_global(page);
-    if ( !va )
-    {
-        put_page_and_type(page);
-        goto fail;
-    }
-
-    clear_page(va);
-
-    v->arch.hvm.viridian.vp_assist.va = va;
-    return;
-
- fail:
-    gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
-             gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
-}
-
-static void teardown_vp_assist(struct vcpu *v)
-{
-    void *va = v->arch.hvm.viridian.vp_assist.va;
-    struct page_info *page;
-
-    if ( !va )
-        return;
-
-    v->arch.hvm.viridian.vp_assist.va = NULL;
-
-    page = mfn_to_page(domain_page_map_to_mfn(va));
-
-    unmap_domain_page_global(va);
-    put_page_and_type(page);
-}
-
-void viridian_apic_assist_set(struct vcpu *v)
-{
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
-
-    if ( !va )
-        return;
-
-    /*
-     * If there is already an assist pending then something has gone
-     * wrong and the VM will most likely hang so force a crash now
-     * to make the problem clear.
-     */
-    if ( v->arch.hvm.viridian.vp_assist.pending )
-        domain_crash(v->domain);
-
-    v->arch.hvm.viridian.vp_assist.pending = true;
-    *va |= 1u;
-}
-
-bool viridian_apic_assist_completed(struct vcpu *v)
-{
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
-
-    if ( !va )
-        return false;
-
-    if ( v->arch.hvm.viridian.vp_assist.pending &&
-         !(*va & 1u) )
-    {
-        /* An EOI has been avoided */
-        v->arch.hvm.viridian.vp_assist.pending = false;
-        return true;
-    }
-
-    return false;
-}
-
-void viridian_apic_assist_clear(struct vcpu *v)
-{
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
-
-    if ( !va )
-        return;
-
-    *va &= ~1u;
-    v->arch.hvm.viridian.vp_assist.pending = false;
-}
-
 static void update_reference_tsc(struct domain *d, bool_t initialize)
 {
     unsigned long gmfn = d->arch.hvm.viridian.reference_tsc.fields.pfn;
@@ -561,31 +388,10 @@ int guest_wrmsr_viridian(struct vcpu *v, uint32_t idx, uint64_t val)
         break;
 
     case HV_X64_MSR_EOI:
-        vlapic_EOI_set(vcpu_vlapic(v));
-        break;
-
-    case HV_X64_MSR_ICR: {
-        u32 eax = (u32)val, edx = (u32)(val >> 32);
-        struct vlapic *vlapic = vcpu_vlapic(v);
-        eax &= ~(1 << 12);
-        edx &= 0xff000000;
-        vlapic_set_reg(vlapic, APIC_ICR2, edx);
-        vlapic_ipi(vlapic, eax, edx);
-        vlapic_set_reg(vlapic, APIC_ICR, eax);
-        break;
-    }
-
+    case HV_X64_MSR_ICR:
     case HV_X64_MSR_TPR:
-        vlapic_set_reg(vcpu_vlapic(v), APIC_TASKPRI, (uint8_t)val);
-        break;
-
     case HV_X64_MSR_VP_ASSIST_PAGE:
-        teardown_vp_assist(v); /* release any previous mapping */
-        v->arch.hvm.viridian.vp_assist.msr.raw = val;
-        dump_vp_assist(v);
-        if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
-            initialize_vp_assist(v);
-        break;
+        return viridian_synic_wrmsr(v, idx, val);
 
     case HV_X64_MSR_REFERENCE_TSC:
         if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
@@ -708,18 +514,11 @@ int guest_rdmsr_viridian(const struct vcpu *v, uint32_t idx, uint64_t *val)
         *val = 1000000000ull / APIC_BUS_CYCLE_NS;
         break;
 
+    case HV_X64_MSR_EOI:
     case HV_X64_MSR_ICR:
-        *val = (((uint64_t)vlapic_get_reg(vcpu_vlapic(v), APIC_ICR2) << 32) |
-                vlapic_get_reg(vcpu_vlapic(v), APIC_ICR));
-        break;
-
     case HV_X64_MSR_TPR:
-        *val = vlapic_get_reg(vcpu_vlapic(v), APIC_TASKPRI);
-        break;
-
     case HV_X64_MSR_VP_ASSIST_PAGE:
-        *val = v->arch.hvm.viridian.vp_assist.msr.raw;
-        break;
+        return viridian_synic_rdmsr(v, idx, val);
 
     case HV_X64_MSR_REFERENCE_TSC:
         if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
@@ -777,7 +576,7 @@ int guest_rdmsr_viridian(const struct vcpu *v, uint32_t idx, uint64_t *val)
 
 void viridian_vcpu_deinit(struct vcpu *v)
 {
-    teardown_vp_assist(v);
+    viridian_synic_wrmsr(v, HV_X64_MSR_VP_ASSIST_PAGE, 0);
 }
 
 void viridian_domain_deinit(struct domain *d)
@@ -785,7 +584,7 @@ void viridian_domain_deinit(struct domain *d)
     struct vcpu *v;
 
     for_each_vcpu ( d, v )
-        teardown_vp_assist(v);
+        viridian_vcpu_deinit(v);
 }
 
 static DEFINE_PER_CPU(cpumask_t, ipi_cpumask);
@@ -987,14 +786,13 @@ HVM_REGISTER_SAVE_RESTORE(VIRIDIAN_DOMAIN, viridian_save_domain_ctxt,
 
 static int viridian_save_vcpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
 {
-    struct hvm_viridian_vcpu_context ctxt = {
-        .vp_assist_msr = v->arch.hvm.viridian.vp_assist.msr.raw,
-        .vp_assist_pending = v->arch.hvm.viridian.vp_assist.pending,
-    };
+    struct hvm_viridian_vcpu_context ctxt = {};
 
     if ( !is_viridian_domain(v->domain) )
         return 0;
 
+    viridian_synic_save_vcpu_ctxt(v, &ctxt);
+
     return hvm_save_entry(VIRIDIAN_VCPU, v->vcpu_id, h, &ctxt);
 }
 
@@ -1018,12 +816,7 @@ static int viridian_load_vcpu_ctxt(struct domain *d,
     if ( memcmp(&ctxt._pad, zero_page, sizeof(ctxt._pad)) )
         return -EINVAL;
 
-    v->arch.hvm.viridian.vp_assist.msr.raw = ctxt.vp_assist_msr;
-    if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled &&
-         !v->arch.hvm.viridian.vp_assist.va )
-        initialize_vp_assist(v);
-
-    v->arch.hvm.viridian.vp_assist.pending = !!ctxt.vp_assist_pending;
+    viridian_synic_load_vcpu_ctxt(v, &ctxt);
 
     return 0;
 }
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 2/5] viridian: separate time related enlightenment implementations...
  2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
  2018-11-07 10:52 ` [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations Paul Durrant
@ 2018-11-07 10:52 ` Paul Durrant
  2018-11-07 11:43   ` Roger Pau Monné
  2018-11-07 10:52 ` [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page' Paul Durrant
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Jan Beulich

...into new 'time' module.

This patch reduces the size of the main viridian source module by
moving time related enlightenments into their own source module. This is
done in anticipation of implementation of more such enightenments and
a desire to not further lengthen the main source module when this work
is done.

While moving the code:

- Move the declaration of HV_REFERENCE_TSC_PAGE from the header file into
  the new source module, since it is only used there.
- Clean up a bool_t.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

v3:
 - Use new private header to host function prototypes

v2:
 - Sort headers alphabetically and separate asm/ amd xen/ sections
 - Constify domain context during load
---
 xen/arch/x86/hvm/viridian/Makefile   |   1 +
 xen/arch/x86/hvm/viridian/private.h  |   8 ++
 xen/arch/x86/hvm/viridian/time.c     | 244 +++++++++++++++++++++++++++++++++++
 xen/arch/x86/hvm/viridian/viridian.c | 174 +------------------------
 xen/include/asm-x86/hvm/viridian.h   |   9 --
 5 files changed, 260 insertions(+), 176 deletions(-)
 create mode 100644 xen/arch/x86/hvm/viridian/time.c

diff --git a/xen/arch/x86/hvm/viridian/Makefile b/xen/arch/x86/hvm/viridian/Makefile
index fca8e16e20..3ecdffe2f6 100644
--- a/xen/arch/x86/hvm/viridian/Makefile
+++ b/xen/arch/x86/hvm/viridian/Makefile
@@ -1,2 +1,3 @@
 obj-y += synic.o
+obj-y += time.o
 obj-y += viridian.o
diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h
index 5b4992d118..a5e06f9866 100644
--- a/xen/arch/x86/hvm/viridian/private.h
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -79,6 +79,14 @@ 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);
 
+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);
+
+void viridian_time_save_domain_ctxt(
+    const struct domain *d, struct hvm_viridian_domain_context *ctxt);
+void viridian_time_load_domain_ctxt(
+    struct domain *d, const struct hvm_viridian_domain_context *ctxt);
+
 #endif /* X86_HVM_VIRIDIAN_PRIVATE_H */
 
 /*
diff --git a/xen/arch/x86/hvm/viridian/time.c b/xen/arch/x86/hvm/viridian/time.c
new file mode 100644
index 0000000000..840a82b457
--- /dev/null
+++ b/xen/arch/x86/hvm/viridian/time.c
@@ -0,0 +1,244 @@
+/***************************************************************************
+ * time.c
+ *
+ * An implementation of some time related Viridian enlightenments.
+ * See Microsoft's Hypervisor Top Level Functional Specification.
+ * for more information.
+ */
+
+#include <xen/domain_page.h>
+#include <xen/hypercall.h>
+#include <xen/sched.h>
+#include <xen/version.h>
+
+#include <asm/apic.h>
+#include <asm/hvm/support.h>
+
+#include "private.h"
+
+typedef struct _HV_REFERENCE_TSC_PAGE
+{
+    uint32_t TscSequence;
+    uint32_t Reserved1;
+    uint64_t TscScale;
+    int64_t  TscOffset;
+    uint64_t Reserved2[509];
+} HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE;
+
+static void dump_reference_tsc(const struct domain *d)
+{
+    const union viridian_page_msr *rt = &d->arch.hvm.viridian.reference_tsc;
+
+    if ( !rt->fields.enabled )
+        return;
+
+    printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: pfn: %lx\n",
+           d->domain_id, (unsigned long)rt->fields.pfn);
+}
+
+static void update_reference_tsc(struct domain *d, bool initialize)
+{
+    unsigned long gmfn = d->arch.hvm.viridian.reference_tsc.fields.pfn;
+    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+    HV_REFERENCE_TSC_PAGE *p;
+
+    if ( !page || !get_page_type(page, PGT_writable_page) )
+    {
+        if ( page )
+            put_page(page);
+        gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
+                 gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
+        return;
+    }
+
+    p = __map_domain_page(page);
+
+    if ( initialize )
+        clear_page(p);
+
+    /*
+     * This enlightenment must be disabled is the host TSC is not invariant.
+     * However it is also disabled if vtsc is true (which means rdtsc is
+     * being emulated). This generally happens when guest TSC freq and host
+     * TSC freq don't match. The TscScale value could be adjusted to cope
+     * with this, allowing vtsc to be turned off, but support for this is
+     * not yet present in the hypervisor. Thus is it is possible that
+     * migrating a Windows VM between hosts of differing TSC frequencies
+     * may result in large differences in guest performance.
+     */
+    if ( !host_tsc_is_safe() || d->arch.vtsc )
+    {
+        /*
+         * The specification states that valid values of TscSequence range
+         * from 0 to 0xFFFFFFFE. The value 0xFFFFFFFF is used to indicate
+         * this mechanism is no longer a reliable source of time and that
+         * the VM should fall back to a different source.
+         *
+         * Server 2012 (6.2 kernel) and 2012 R2 (6.3 kernel) actually
+         * violate the spec. and rely on a value of 0 to indicate that this
+         * enlightenment should no longer be used.
+         */
+        p->TscSequence = 0;
+
+        printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: invalidated\n",
+               d->domain_id);
+        goto out;
+    }
+
+    /*
+     * The guest will calculate reference time according to the following
+     * formula:
+     *
+     * ReferenceTime = ((RDTSC() * TscScale) >> 64) + TscOffset
+     *
+     * Windows uses a 100ns tick, so we need a scale which is cpu
+     * ticks per 100ns shifted left by 64.
+     */
+    p->TscScale = ((10000ul << 32) / d->arch.tsc_khz) << 32;
+
+    p->TscSequence++;
+    if ( p->TscSequence == 0xFFFFFFFF ||
+         p->TscSequence == 0 ) /* Avoid both 'invalid' values */
+        p->TscSequence = 1;
+
+ out:
+    unmap_domain_page(p);
+
+    put_page_and_type(page);
+}
+
+static int64_t raw_trc_val(struct domain *d)
+{
+    uint64_t tsc;
+    struct time_scale tsc_to_ns;
+
+    tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
+
+    /* convert tsc to count of 100ns periods */
+    set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
+    return scale_delta(tsc, &tsc_to_ns) / 100ul;
+}
+
+void viridian_time_ref_count_freeze(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm.viridian.time_ref_count;
+
+    if ( test_and_clear_bit(_TRC_running, &trc->flags) )
+        trc->val = raw_trc_val(d) + trc->off;
+}
+
+void viridian_time_ref_count_thaw(struct domain *d)
+{
+    struct viridian_time_ref_count *trc;
+
+    trc = &d->arch.hvm.viridian.time_ref_count;
+
+    if ( !d->is_shutting_down &&
+         !test_and_set_bit(_TRC_running, &trc->flags) )
+        trc->off = (int64_t)trc->val - raw_trc_val(d);
+}
+
+int viridian_time_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
+{
+    struct domain *d = v->domain;
+
+    switch ( idx )
+    {
+    case HV_X64_MSR_REFERENCE_TSC:
+        if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
+            return X86EMUL_EXCEPTION;
+
+        d->arch.hvm.viridian.reference_tsc.raw = val;
+        dump_reference_tsc(d);
+        if ( d->arch.hvm.viridian.reference_tsc.fields.enabled )
+            update_reference_tsc(d, true);
+        break;
+
+    default:
+        gdprintk(XENLOG_INFO, "%s: unimplemented MSR %#x (%016"PRIx64")\n",
+                 __func__, idx, val);
+        return X86EMUL_EXCEPTION;
+    }
+
+    return X86EMUL_OKAY;
+}
+
+int viridian_time_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val)
+{
+    struct domain *d = v->domain;
+
+    switch ( idx )
+    {
+    case HV_X64_MSR_TSC_FREQUENCY:
+        if ( viridian_feature_mask(d) & HVMPV_no_freq )
+            return X86EMUL_EXCEPTION;
+
+        *val = (uint64_t)d->arch.tsc_khz * 1000ull;
+        break;
+
+    case HV_X64_MSR_APIC_FREQUENCY:
+        if ( viridian_feature_mask(d) & HVMPV_no_freq )
+            return X86EMUL_EXCEPTION;
+
+        *val = 1000000000ull / APIC_BUS_CYCLE_NS;
+        break;
+
+    case HV_X64_MSR_REFERENCE_TSC:
+        if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
+            return X86EMUL_EXCEPTION;
+
+        *val = d->arch.hvm.viridian.reference_tsc.raw;
+        break;
+
+    case HV_X64_MSR_TIME_REF_COUNT:
+    {
+        struct viridian_time_ref_count *trc =
+            &d->arch.hvm.viridian.time_ref_count;
+
+        if ( !(viridian_feature_mask(d) & HVMPV_time_ref_count) )
+            return X86EMUL_EXCEPTION;
+
+        if ( !test_and_set_bit(_TRC_accessed, &trc->flags) )
+            printk(XENLOG_G_INFO "d%d: VIRIDIAN MSR_TIME_REF_COUNT: accessed\n",
+                   d->domain_id);
+
+        *val = raw_trc_val(d) + trc->off;
+        break;
+    }
+
+    default:
+        gdprintk(XENLOG_INFO, "%s: unimplemented MSR %#x\n", __func__, idx);
+        return X86EMUL_EXCEPTION;
+    }
+
+    return X86EMUL_OKAY;
+}
+
+void viridian_time_save_domain_ctxt(
+    const struct domain *d, struct hvm_viridian_domain_context *ctxt)
+{
+    ctxt->time_ref_count = d->arch.hvm.viridian.time_ref_count.val;
+    ctxt->reference_tsc = d->arch.hvm.viridian.reference_tsc.raw;
+}
+
+void viridian_time_load_domain_ctxt(
+    struct domain *d, const struct hvm_viridian_domain_context *ctxt)
+{
+    d->arch.hvm.viridian.time_ref_count.val = ctxt->time_ref_count;
+    d->arch.hvm.viridian.reference_tsc.raw = ctxt->reference_tsc;
+
+    if ( d->arch.hvm.viridian.reference_tsc.fields.enabled )
+        update_reference_tsc(d, false);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 68a79298aa..8630bc7bb6 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -245,17 +245,6 @@ static void dump_hypercall(const struct domain *d)
            hg->fields.enabled, (unsigned long)hg->fields.pfn);
 }
 
-static void dump_reference_tsc(const struct domain *d)
-{
-    const union viridian_page_msr *rt;
-
-    rt = &d->arch.hvm.viridian.reference_tsc;
-
-    printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: enabled: %x pfn: %lx\n",
-           d->domain_id,
-           rt->fields.enabled, (unsigned long)rt->fields.pfn);
-}
-
 static void enable_hypercall_page(struct domain *d)
 {
     unsigned long gmfn = d->arch.hvm.viridian.hypercall_gpa.fields.pfn;
@@ -290,80 +279,6 @@ static void enable_hypercall_page(struct domain *d)
     put_page_and_type(page);
 }
 
-static void update_reference_tsc(struct domain *d, bool_t initialize)
-{
-    unsigned long gmfn = d->arch.hvm.viridian.reference_tsc.fields.pfn;
-    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
-    HV_REFERENCE_TSC_PAGE *p;
-
-    if ( !page || !get_page_type(page, PGT_writable_page) )
-    {
-        if ( page )
-            put_page(page);
-        gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
-                 gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
-        return;
-    }
-
-    p = __map_domain_page(page);
-
-    if ( initialize )
-        clear_page(p);
-
-    /*
-     * This enlightenment must be disabled is the host TSC is not
-     * invariant. However it is also disabled if vtsc is true (which
-     * means rdtsc is being emulated). This generally happens when guest
-     * TSC freq and host TSC freq don't match. The TscScale value could be
-     * adjusted to cope with this, allowing vtsc to be turned off, but
-     * support for this is not yet present in the hypervisor. Thus is it
-     * is possible that migrating a Windows VM between hosts of differing
-     * TSC frequencies may result in large differences in guest
-     * performance.
-     */
-    if ( !host_tsc_is_safe() || d->arch.vtsc )
-    {
-        /*
-         * The specification states that valid values of TscSequence range
-         * from 0 to 0xFFFFFFFE. The value 0xFFFFFFFF is used to indicate
-         * this mechanism is no longer a reliable source of time and that
-         * the VM should fall back to a different source.
-         *
-         * Server 2012 (6.2 kernel) and 2012 R2 (6.3 kernel) actually
-         * violate the specification and rely on a value of 0 to indicate
-         * that this enlightenment should no longer be used. These two
-         * kernel versions are currently the only ones to make use of this
-         * enlightenment, so just use 0 here.
-         */
-        p->TscSequence = 0;
-
-        printk(XENLOG_G_INFO "d%d: VIRIDIAN REFERENCE_TSC: invalidated\n",
-               d->domain_id);
-        goto out;
-    }
-
-    /*
-     * The guest will calculate reference time according to the following
-     * formula:
-     *
-     * ReferenceTime = ((RDTSC() * TscScale) >> 64) + TscOffset
-     *
-     * Windows uses a 100ns tick, so we need a scale which is cpu
-     * ticks per 100ns shifted left by 64.
-     */
-    p->TscScale = ((10000ul << 32) / d->arch.tsc_khz) << 32;
-
-    p->TscSequence++;
-    if ( p->TscSequence == 0xFFFFFFFF ||
-         p->TscSequence == 0 ) /* Avoid both 'invalid' values */
-        p->TscSequence = 1;
-
- out:
-    unmap_domain_page(p);
-
-    put_page_and_type(page);
-}
-
 int guest_wrmsr_viridian(struct vcpu *v, uint32_t idx, uint64_t val)
 {
     struct domain *d = v->domain;
@@ -394,14 +309,7 @@ int guest_wrmsr_viridian(struct vcpu *v, uint32_t idx, uint64_t val)
         return viridian_synic_wrmsr(v, idx, val);
 
     case HV_X64_MSR_REFERENCE_TSC:
-        if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
-            return X86EMUL_EXCEPTION;
-
-        d->arch.hvm.viridian.reference_tsc.raw = val;
-        dump_reference_tsc(d);
-        if ( d->arch.hvm.viridian.reference_tsc.fields.enabled )
-            update_reference_tsc(d, 1);
-        break;
+        return viridian_time_wrmsr(v, idx, val);
 
     case HV_X64_MSR_CRASH_P0:
     case HV_X64_MSR_CRASH_P1:
@@ -447,39 +355,6 @@ int guest_wrmsr_viridian(struct vcpu *v, uint32_t idx, uint64_t val)
     return X86EMUL_OKAY;
 }
 
-static int64_t raw_trc_val(struct domain *d)
-{
-    uint64_t tsc;
-    struct time_scale tsc_to_ns;
-
-    tsc = hvm_get_guest_tsc(pt_global_vcpu_target(d));
-
-    /* convert tsc to count of 100ns periods */
-    set_time_scale(&tsc_to_ns, d->arch.tsc_khz * 1000ul);
-    return scale_delta(tsc, &tsc_to_ns) / 100ul;
-}
-
-void viridian_time_ref_count_freeze(struct domain *d)
-{
-    struct viridian_time_ref_count *trc;
-
-    trc = &d->arch.hvm.viridian.time_ref_count;
-
-    if ( test_and_clear_bit(_TRC_running, &trc->flags) )
-        trc->val = raw_trc_val(d) + trc->off;
-}
-
-void viridian_time_ref_count_thaw(struct domain *d)
-{
-    struct viridian_time_ref_count *trc;
-
-    trc = &d->arch.hvm.viridian.time_ref_count;
-
-    if ( !d->is_shutting_down &&
-         !test_and_set_bit(_TRC_running, &trc->flags) )
-        trc->off = (int64_t)trc->val - raw_trc_val(d);
-}
-
 int guest_rdmsr_viridian(const struct vcpu *v, uint32_t idx, uint64_t *val)
 {
     struct domain *d = v->domain;
@@ -500,49 +375,17 @@ int guest_rdmsr_viridian(const struct vcpu *v, uint32_t idx, uint64_t *val)
         *val = v->vcpu_id;
         break;
 
-    case HV_X64_MSR_TSC_FREQUENCY:
-        if ( viridian_feature_mask(d) & HVMPV_no_freq )
-            return X86EMUL_EXCEPTION;
-
-        *val = (uint64_t)d->arch.tsc_khz * 1000ull;
-        break;
-
-    case HV_X64_MSR_APIC_FREQUENCY:
-        if ( viridian_feature_mask(d) & HVMPV_no_freq )
-            return X86EMUL_EXCEPTION;
-
-        *val = 1000000000ull / APIC_BUS_CYCLE_NS;
-        break;
-
     case HV_X64_MSR_EOI:
     case HV_X64_MSR_ICR:
     case HV_X64_MSR_TPR:
     case HV_X64_MSR_VP_ASSIST_PAGE:
         return viridian_synic_rdmsr(v, idx, val);
 
+    case HV_X64_MSR_TSC_FREQUENCY:
+    case HV_X64_MSR_APIC_FREQUENCY:
     case HV_X64_MSR_REFERENCE_TSC:
-        if ( !(viridian_feature_mask(d) & HVMPV_reference_tsc) )
-            return X86EMUL_EXCEPTION;
-
-        *val = d->arch.hvm.viridian.reference_tsc.raw;
-        break;
-
     case HV_X64_MSR_TIME_REF_COUNT:
-    {
-        struct viridian_time_ref_count *trc;
-
-        trc = &d->arch.hvm.viridian.time_ref_count;
-
-        if ( !(viridian_feature_mask(d) & HVMPV_time_ref_count) )
-            return X86EMUL_EXCEPTION;
-
-        if ( !test_and_set_bit(_TRC_accessed, &trc->flags) )
-            printk(XENLOG_G_INFO "d%d: VIRIDIAN MSR_TIME_REF_COUNT: accessed\n",
-                   d->domain_id);
-
-        *val = raw_trc_val(d) + trc->off;
-        break;
-    }
+        return viridian_time_rdmsr(v, idx, val);
 
     case HV_X64_MSR_CRASH_P0:
     case HV_X64_MSR_CRASH_P1:
@@ -750,15 +593,15 @@ static int viridian_save_domain_ctxt(struct vcpu *v,
 {
     const struct domain *d = v->domain;
     struct hvm_viridian_domain_context ctxt = {
-        .time_ref_count = d->arch.hvm.viridian.time_ref_count.val,
         .hypercall_gpa  = d->arch.hvm.viridian.hypercall_gpa.raw,
         .guest_os_id    = d->arch.hvm.viridian.guest_os_id.raw,
-        .reference_tsc  = d->arch.hvm.viridian.reference_tsc.raw,
     };
 
     if ( !is_viridian_domain(d) )
         return 0;
 
+    viridian_time_save_domain_ctxt(d, &ctxt);
+
     return (hvm_save_entry(VIRIDIAN_DOMAIN, 0, h, &ctxt) != 0);
 }
 
@@ -770,13 +613,10 @@ static int viridian_load_domain_ctxt(struct domain *d,
     if ( hvm_load_entry_zeroextend(VIRIDIAN_DOMAIN, h, &ctxt) != 0 )
         return -EINVAL;
 
-    d->arch.hvm.viridian.time_ref_count.val = ctxt.time_ref_count;
     d->arch.hvm.viridian.hypercall_gpa.raw  = ctxt.hypercall_gpa;
     d->arch.hvm.viridian.guest_os_id.raw    = ctxt.guest_os_id;
-    d->arch.hvm.viridian.reference_tsc.raw  = ctxt.reference_tsc;
 
-    if ( d->arch.hvm.viridian.reference_tsc.fields.enabled )
-        update_reference_tsc(d, 0);
+    viridian_time_load_domain_ctxt(d, &ctxt);
 
     return 0;
 }
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index 359fdf5a83..5ff83a46e5 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -57,15 +57,6 @@ struct viridian_time_ref_count
     int64_t off;
 };
 
-typedef struct _HV_REFERENCE_TSC_PAGE
-{
-    uint32_t TscSequence;
-    uint32_t Reserved1;
-    uint64_t TscScale;
-    int64_t  TscOffset;
-    uint64_t Reserved2[509];
-} HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE;
-
 struct viridian_domain
 {
     union viridian_guest_os_id_msr guest_os_id;
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page'
  2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
  2018-11-07 10:52 ` [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations Paul Durrant
  2018-11-07 10:52 ` [PATCH v3 2/5] viridian: separate time " Paul Durrant
@ 2018-11-07 10:52 ` Paul Durrant
  2018-11-07 11:48   ` Roger Pau Monné
  2018-11-09 10:24   ` Jan Beulich
  2018-11-07 10:52 ` [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c Paul Durrant
  2018-11-07 10:52 ` [PATCH v3 5/5] viridian: introduce struct viridian_page Paul Durrant
  4 siblings, 2 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Jan Beulich

The specification [1] defines a type so we should use it, rather than just
OR-ing and AND-ing magic bits.

No functional change.

NOTE: The type defined in the specification does include an anonymous
      sub-struct in the page type but, as we currently use only the first
      element, the struct declaration has been omitted.

[1] https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v5.0C.pdf

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

v3:
 - Move the typedef of HV_VP_ASSIST_PAGE into viridian.h so that it can
   be used in the declaration of struct viridian_vcpu
---
 xen/arch/x86/hvm/viridian/synic.c  | 52 +++++++++++++++++++++++---------------
 xen/include/asm-x86/hvm/viridian.h |  4 ++-
 2 files changed, 35 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
index 366608208f..d8d6f6e1c9 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -16,6 +16,18 @@
 
 #include "private.h"
 
+typedef struct _HV_VIRTUAL_APIC_ASSIST
+{
+    uint32_t no_eoi:1;
+    uint32_t reserved_zero:31;
+} HV_VIRTUAL_APIC_ASSIST;
+
+union _HV_VP_ASSIST_PAGE
+{
+    HV_VIRTUAL_APIC_ASSIST ApicAssist;
+    uint8_t ReservedZBytePadding[PAGE_SIZE];
+};
+
 static void dump_vp_assist(const struct vcpu *v)
 {
     const union viridian_page_msr *va = &v->arch.hvm.viridian.vp_assist.msr;
@@ -32,9 +44,9 @@ static void initialize_vp_assist(struct vcpu *v)
     struct domain *d = v->domain;
     unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
     struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
-    void *va;
+    HV_VP_ASSIST_PAGE *ptr;
 
-    ASSERT(!v->arch.hvm.viridian.vp_assist.va);
+    ASSERT(!v->arch.hvm.viridian.vp_assist.ptr);
 
     if ( !page )
         goto fail;
@@ -45,16 +57,16 @@ static void initialize_vp_assist(struct vcpu *v)
         goto fail;
     }
 
-    va = __map_domain_page_global(page);
-    if ( !va )
+    ptr = __map_domain_page_global(page);
+    if ( !ptr )
     {
         put_page_and_type(page);
         goto fail;
     }
 
-    clear_page(va);
+    clear_page(ptr);
 
-    v->arch.hvm.viridian.vp_assist.va = va;
+    v->arch.hvm.viridian.vp_assist.ptr = ptr;
     return;
 
  fail:
@@ -64,25 +76,25 @@ static void initialize_vp_assist(struct vcpu *v)
 
 static void teardown_vp_assist(struct vcpu *v)
 {
-    void *va = v->arch.hvm.viridian.vp_assist.va;
+    HV_VP_ASSIST_PAGE *ptr = v->arch.hvm.viridian.vp_assist.ptr;
     struct page_info *page;
 
-    if ( !va )
+    if ( !ptr )
         return;
 
-    v->arch.hvm.viridian.vp_assist.va = NULL;
+    v->arch.hvm.viridian.vp_assist.ptr = NULL;
 
-    page = mfn_to_page(domain_page_map_to_mfn(va));
+    page = mfn_to_page(domain_page_map_to_mfn(ptr));
 
-    unmap_domain_page_global(va);
+    unmap_domain_page_global(ptr);
     put_page_and_type(page);
 }
 
 void viridian_apic_assist_set(struct vcpu *v)
 {
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+    HV_VP_ASSIST_PAGE *ptr = v->arch.hvm.viridian.vp_assist.ptr;
 
-    if ( !va )
+    if ( !ptr )
         return;
 
     /*
@@ -94,18 +106,18 @@ void viridian_apic_assist_set(struct vcpu *v)
         domain_crash(v->domain);
 
     v->arch.hvm.viridian.vp_assist.pending = true;
-    *va |= 1u;
+    ptr->ApicAssist.no_eoi = 1;
 }
 
 bool viridian_apic_assist_completed(struct vcpu *v)
 {
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+    HV_VP_ASSIST_PAGE *ptr = v->arch.hvm.viridian.vp_assist.ptr;
 
-    if ( !va )
+    if ( !ptr )
         return false;
 
     if ( v->arch.hvm.viridian.vp_assist.pending &&
-         !(*va & 1u) )
+         !ptr->ApicAssist.no_eoi )
     {
         /* An EOI has been avoided */
         v->arch.hvm.viridian.vp_assist.pending = false;
@@ -117,12 +129,12 @@ bool viridian_apic_assist_completed(struct vcpu *v)
 
 void viridian_apic_assist_clear(struct vcpu *v)
 {
-    uint32_t *va = v->arch.hvm.viridian.vp_assist.va;
+    HV_VP_ASSIST_PAGE *ptr = v->arch.hvm.viridian.vp_assist.ptr;
 
-    if ( !va )
+    if ( !ptr )
         return;
 
-    *va &= ~1u;
+    ptr->ApicAssist.no_eoi = 0;
     v->arch.hvm.viridian.vp_assist.pending = false;
 }
 
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index 5ff83a46e5..22f14a526e 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -20,11 +20,13 @@ union viridian_page_msr
     } fields;
 };
 
+typedef union _HV_VP_ASSIST_PAGE HV_VP_ASSIST_PAGE;
+
 struct viridian_vcpu
 {
     struct {
         union viridian_page_msr msr;
-        void *va;
+        HV_VP_ASSIST_PAGE *ptr;
         bool pending;
     } vp_assist;
     uint64_t crash_param[5];
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c
  2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
                   ` (2 preceding siblings ...)
  2018-11-07 10:52 ` [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page' Paul Durrant
@ 2018-11-07 10:52 ` Paul Durrant
  2018-11-07 13:08   ` Wei Liu
  2018-11-07 10:52 ` [PATCH v3 5/5] viridian: introduce struct viridian_page Paul Durrant
  4 siblings, 1 reply; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Paul Durrant, Ian Jackson

Also add emacs boilerplate to avoid future problems.

Purely cosmetic. No functional change.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>

v2:
 - New in v2
---
 tools/misc/xen-hvmctx.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c
index 40e77851be..823aa7d736 100644
--- a/tools/misc/xen-hvmctx.c
+++ b/tools/misc/xen-hvmctx.c
@@ -371,8 +371,8 @@ static void dump_viridian_vcpu(void)
     HVM_SAVE_TYPE(VIRIDIAN_VCPU) p;
     READ(p);
     printf("    VIRIDIAN_VCPU: vp_assist_msr 0x%llx, vp_assist_pending %s\n",
-	   (unsigned long long) p.vp_assist_msr,
-	   p.vp_assist_pending ? "true" : "false");
+           (unsigned long long) p.vp_assist_msr,
+           p.vp_assist_pending ? "true" : "false");
 }
 
 static void dump_vmce_vcpu(void)
@@ -468,4 +468,14 @@ int main(int argc, char **argv)
     } while ( desc.typecode != HVM_SAVE_CODE(END) && off < len );
 
     return 0;
-} 
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 5/5] viridian: introduce struct viridian_page
  2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
                   ` (3 preceding siblings ...)
  2018-11-07 10:52 ` [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c Paul Durrant
@ 2018-11-07 10:52 ` Paul Durrant
  4 siblings, 0 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 10:52 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Ian Jackson, Jan Beulich

The 'vp_assist' page is currently an example of a guest page which needs to
be kept mapped throughout the life-time of a guest, but there are other
such examples in the specifiction [1]. This patch therefore introduces a
generic 'viridian_page' type and converts the current vp_assist/apic_assist
related code to use it. Subsequent patches implementing other enlightments
can then also make use of it.

This patch also renames the 'vp_assist_pending' field in struct
hvm_viridian_vcpu_context to 'apic_assist_pending' to more accurately
reflect its meaning. The term 'vp_assist' applies to the whole page rather
than just the EOI-avoidance enlightenment. New versons of the specification
have defined data structures for other enlightenments within the same page.

No functional change.

[1] https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v5.0C.pdf

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Roger Pau Monne <roger.pau@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>

v3:
 - Move the typedef of HV_VP_ASSIST_PAGE back into synic.c after re-
   location in eariler patch
 - Move init and teardown functions into viridian.c now that they are more
   generic, and use map/unmap naming to better reflect what they do
 - Drop unnecessary !!
---
 tools/misc/xen-hvmctx.c                |  4 +-
 xen/arch/x86/hvm/viridian/private.h    |  5 ++
 xen/arch/x86/hvm/viridian/synic.c      | 90 ++++++----------------------------
 xen/arch/x86/hvm/viridian/viridian.c   | 57 +++++++++++++++++++++
 xen/include/asm-x86/hvm/viridian.h     | 13 ++---
 xen/include/public/arch-x86/hvm/save.h |  2 +-
 6 files changed, 87 insertions(+), 84 deletions(-)

diff --git a/tools/misc/xen-hvmctx.c b/tools/misc/xen-hvmctx.c
index 823aa7d736..4f336a6cea 100644
--- a/tools/misc/xen-hvmctx.c
+++ b/tools/misc/xen-hvmctx.c
@@ -370,9 +370,9 @@ static void dump_viridian_vcpu(void)
 {
     HVM_SAVE_TYPE(VIRIDIAN_VCPU) p;
     READ(p);
-    printf("    VIRIDIAN_VCPU: vp_assist_msr 0x%llx, vp_assist_pending %s\n",
+    printf("    VIRIDIAN_VCPU: vp_assist_msr 0x%llx, apic_assist_pending %s\n",
            (unsigned long long) p.vp_assist_msr,
-           p.vp_assist_pending ? "true" : "false");
+           p.apic_assist_pending ? "true" : "false");
 }
 
 static void dump_vmce_vcpu(void)
diff --git a/xen/arch/x86/hvm/viridian/private.h b/xen/arch/x86/hvm/viridian/private.h
index a5e06f9866..398b22f12d 100644
--- a/xen/arch/x86/hvm/viridian/private.h
+++ b/xen/arch/x86/hvm/viridian/private.h
@@ -87,6 +87,11 @@ void viridian_time_save_domain_ctxt(
 void viridian_time_load_domain_ctxt(
     struct domain *d, const struct hvm_viridian_domain_context *ctxt);
 
+void viridian_dump_guest_page(const struct vcpu *v, const char *name,
+                              const struct viridian_page *vp);
+void viridian_map_guest_page(struct vcpu *v, struct viridian_page *vp);
+void viridian_unmap_guest_page(struct viridian_page *vp);
+
 #endif /* X86_HVM_VIRIDIAN_PRIVATE_H */
 
 /*
diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
index d8d6f6e1c9..845029b568 100644
--- a/xen/arch/x86/hvm/viridian/synic.c
+++ b/xen/arch/x86/hvm/viridian/synic.c
@@ -22,73 +22,11 @@ typedef struct _HV_VIRTUAL_APIC_ASSIST
     uint32_t reserved_zero:31;
 } HV_VIRTUAL_APIC_ASSIST;
 
-union _HV_VP_ASSIST_PAGE
+typedef union _HV_VP_ASSIST_PAGE
 {
     HV_VIRTUAL_APIC_ASSIST ApicAssist;
     uint8_t ReservedZBytePadding[PAGE_SIZE];
-};
-
-static void dump_vp_assist(const struct vcpu *v)
-{
-    const union viridian_page_msr *va = &v->arch.hvm.viridian.vp_assist.msr;
-
-    if ( !va->fields.enabled )
-        return;
-
-    printk(XENLOG_G_INFO "%pv: VIRIDIAN VP_ASSIST_PAGE: pfn: %lx\n",
-           v, (unsigned long)va->fields.pfn);
-}
-
-static void initialize_vp_assist(struct vcpu *v)
-{
-    struct domain *d = v->domain;
-    unsigned long gmfn = v->arch.hvm.viridian.vp_assist.msr.fields.pfn;
-    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
-    HV_VP_ASSIST_PAGE *ptr;
-
-    ASSERT(!v->arch.hvm.viridian.vp_assist.ptr);
-
-    if ( !page )
-        goto fail;
-
-    if ( !get_page_type(page, PGT_writable_page) )
-    {
-        put_page(page);
-        goto fail;
-    }
-
-    ptr = __map_domain_page_global(page);
-    if ( !ptr )
-    {
-        put_page_and_type(page);
-        goto fail;
-    }
-
-    clear_page(ptr);
-
-    v->arch.hvm.viridian.vp_assist.ptr = ptr;
-    return;
-
- fail:
-    gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
-             gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
-}
-
-static void teardown_vp_assist(struct vcpu *v)
-{
-    HV_VP_ASSIST_PAGE *ptr = v->arch.hvm.viridian.vp_assist.ptr;
-    struct page_info *page;
-
-    if ( !ptr )
-        return;
-
-    v->arch.hvm.viridian.vp_assist.ptr = NULL;
-
-    page = mfn_to_page(domain_page_map_to_mfn(ptr));
-
-    unmap_domain_page_global(ptr);
-    put_page_and_type(page);
-}
+} HV_VP_ASSIST_PAGE;
 
 void viridian_apic_assist_set(struct vcpu *v)
 {
@@ -102,10 +40,10 @@ void viridian_apic_assist_set(struct vcpu *v)
      * wrong and the VM will most likely hang so force a crash now
      * to make the problem clear.
      */
-    if ( v->arch.hvm.viridian.vp_assist.pending )
+    if ( v->arch.hvm.viridian.apic_assist_pending )
         domain_crash(v->domain);
 
-    v->arch.hvm.viridian.vp_assist.pending = true;
+    v->arch.hvm.viridian.apic_assist_pending = true;
     ptr->ApicAssist.no_eoi = 1;
 }
 
@@ -116,11 +54,11 @@ bool viridian_apic_assist_completed(struct vcpu *v)
     if ( !ptr )
         return false;
 
-    if ( v->arch.hvm.viridian.vp_assist.pending &&
+    if ( v->arch.hvm.viridian.apic_assist_pending &&
          !ptr->ApicAssist.no_eoi )
     {
         /* An EOI has been avoided */
-        v->arch.hvm.viridian.vp_assist.pending = false;
+        v->arch.hvm.viridian.apic_assist_pending = false;
         return true;
     }
 
@@ -135,7 +73,7 @@ void viridian_apic_assist_clear(struct vcpu *v)
         return;
 
     ptr->ApicAssist.no_eoi = 0;
-    v->arch.hvm.viridian.vp_assist.pending = false;
+    v->arch.hvm.viridian.apic_assist_pending = false;
 }
 
 int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
@@ -161,11 +99,13 @@ int viridian_synic_wrmsr(struct vcpu *v, uint32_t idx, uint64_t val)
         break;
 
     case HV_X64_MSR_VP_ASSIST_PAGE:
-        teardown_vp_assist(v); /* release any previous mapping */
+        /* release any previous mapping */
+        viridian_unmap_guest_page(&v->arch.hvm.viridian.vp_assist);
         v->arch.hvm.viridian.vp_assist.msr.raw = val;
-        dump_vp_assist(v);
+        viridian_dump_guest_page(v, "VP_ASSIST",
+                                 &v->arch.hvm.viridian.vp_assist);
         if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
-            initialize_vp_assist(v);
+            viridian_map_guest_page(v, &v->arch.hvm.viridian.vp_assist);
         break;
 
     default:
@@ -211,7 +151,7 @@ int viridian_synic_rdmsr(const struct vcpu *v, uint32_t idx, uint64_t *val)
 void viridian_synic_save_vcpu_ctxt(const struct vcpu *v,
                                    struct hvm_viridian_vcpu_context *ctxt)
 {
-    ctxt->vp_assist_pending = v->arch.hvm.viridian.vp_assist.pending;
+    ctxt->apic_assist_pending = v->arch.hvm.viridian.apic_assist_pending;
     ctxt->vp_assist_msr = v->arch.hvm.viridian.vp_assist.msr.raw;
 }
 
@@ -220,9 +160,9 @@ void viridian_synic_load_vcpu_ctxt(
 {
     v->arch.hvm.viridian.vp_assist.msr.raw = ctxt->vp_assist_msr;
     if ( v->arch.hvm.viridian.vp_assist.msr.fields.enabled )
-        initialize_vp_assist(v);
+        viridian_map_guest_page(v, &v->arch.hvm.viridian.vp_assist);
 
-    v->arch.hvm.viridian.vp_assist.pending = !!ctxt->vp_assist_pending;
+    v->arch.hvm.viridian.apic_assist_pending = ctxt->apic_assist_pending;
 }
 
 /*
diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index 8630bc7bb6..7d73f41de6 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -588,6 +588,63 @@ out:
     return HVM_HCALL_completed;
 }
 
+void viridian_dump_guest_page(const struct vcpu *v, const char *name,
+                              const struct viridian_page *vp)
+{
+    if ( !vp->msr.fields.enabled )
+        return;
+
+    printk(XENLOG_G_INFO "%pv: VIRIDIAN %s: pfn: %lx\n",
+           v, name, (unsigned long)vp->msr.fields.pfn);
+}
+
+void viridian_map_guest_page(struct vcpu *v, struct viridian_page *vp)
+{
+    struct domain *d = v->domain;
+    unsigned long gmfn = vp->msr.fields.pfn;
+    struct page_info *page = get_page_from_gfn(d, gmfn, NULL, P2M_ALLOC);
+
+    ASSERT(!vp->ptr);
+
+    if ( !page )
+        goto fail;
+
+    if ( !get_page_type(page, PGT_writable_page) )
+    {
+        put_page(page);
+        goto fail;
+    }
+
+    vp->ptr = __map_domain_page_global(page);
+    if ( !vp->ptr )
+    {
+        put_page_and_type(page);
+        goto fail;
+    }
+
+    clear_page(vp->ptr);
+    return;
+
+ fail:
+    gdprintk(XENLOG_WARNING, "Bad GMFN %#"PRI_gfn" (MFN %#"PRI_mfn")\n",
+             gmfn, mfn_x(page ? page_to_mfn(page) : INVALID_MFN));
+}
+
+void viridian_unmap_guest_page(struct viridian_page *vp)
+{
+    struct page_info *page;
+
+    if ( !vp->ptr )
+        return;
+
+    page = mfn_to_page(domain_page_map_to_mfn(vp->ptr));
+
+    unmap_domain_page_global(vp->ptr);
+    vp->ptr = NULL;
+
+    put_page_and_type(page);
+}
+
 static int viridian_save_domain_ctxt(struct vcpu *v,
                                      hvm_domain_context_t *h)
 {
diff --git a/xen/include/asm-x86/hvm/viridian.h b/xen/include/asm-x86/hvm/viridian.h
index 22f14a526e..ec5ef8d3f9 100644
--- a/xen/include/asm-x86/hvm/viridian.h
+++ b/xen/include/asm-x86/hvm/viridian.h
@@ -20,15 +20,16 @@ union viridian_page_msr
     } fields;
 };
 
-typedef union _HV_VP_ASSIST_PAGE HV_VP_ASSIST_PAGE;
+struct viridian_page
+{
+    union viridian_page_msr msr;
+    void *ptr;
+};
 
 struct viridian_vcpu
 {
-    struct {
-        union viridian_page_msr msr;
-        HV_VP_ASSIST_PAGE *ptr;
-        bool pending;
-    } vp_assist;
+    struct viridian_page vp_assist;
+    bool apic_assist_pending;
     uint64_t crash_param[5];
 };
 
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 4691d4d4aa..80e762c335 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -600,7 +600,7 @@ DECLARE_HVM_SAVE_TYPE(VIRIDIAN_DOMAIN, 15, struct hvm_viridian_domain_context);
 
 struct hvm_viridian_vcpu_context {
     uint64_t vp_assist_msr;
-    uint8_t  vp_assist_pending;
+    uint8_t  apic_assist_pending;
     uint8_t  _pad[7];
 };
 
-- 
2.11.0


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

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations...
  2018-11-07 10:52 ` [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations Paul Durrant
@ 2018-11-07 11:36   ` Roger Pau Monné
  0 siblings, 0 replies; 14+ messages in thread
From: Roger Pau Monné @ 2018-11-07 11:36 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Jan Beulich, Andrew Cooper

On Wed, Nov 07, 2018 at 10:52:19AM +0000, Paul Durrant wrote:
> ...into new 'synic' module.
> 
> The SynIC (synthetic interrupt controller) is specified [1] to be a super-
> set of a virtualized LAPIC, and its definition encompasses all
> enlightenments related to virtual interrupt control.
> 
> This patch reduces the size of the main viridian source module by giving
> these enlightenments their own module. This is done in anticipation of
> implementation of more such enlightenments and a desire not to further
> lengthen then main source module when this work is done.
> 
> Whilst moving the code:
> 
> - Fix various style issues.
> - Move the MSR definitions into the header (since they are now needed in
>   more than one source module).
> 
> [1] https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v5.0C.pdf
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 2/5] viridian: separate time related enlightenment implementations...
  2018-11-07 10:52 ` [PATCH v3 2/5] viridian: separate time " Paul Durrant
@ 2018-11-07 11:43   ` Roger Pau Monné
  0 siblings, 0 replies; 14+ messages in thread
From: Roger Pau Monné @ 2018-11-07 11:43 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Jan Beulich, Andrew Cooper

On Wed, Nov 07, 2018 at 10:52:20AM +0000, Paul Durrant wrote:
> ...into new 'time' module.
> 
> This patch reduces the size of the main viridian source module by
> moving time related enlightenments into their own source module. This is
> done in anticipation of implementation of more such enightenments and
> a desire to not further lengthen the main source module when this work
> is done.
> 
> While moving the code:
> 
> - Move the declaration of HV_REFERENCE_TSC_PAGE from the header file into
>   the new source module, since it is only used there.
> - Clean up a bool_t.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page'
  2018-11-07 10:52 ` [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page' Paul Durrant
@ 2018-11-07 11:48   ` Roger Pau Monné
  2018-11-07 11:50     ` Paul Durrant
  2018-11-09 10:24   ` Jan Beulich
  1 sibling, 1 reply; 14+ messages in thread
From: Roger Pau Monné @ 2018-11-07 11:48 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Jan Beulich, Andrew Cooper

On Wed, Nov 07, 2018 at 10:52:21AM +0000, Paul Durrant wrote:
> The specification [1] defines a type so we should use it, rather than just
> OR-ing and AND-ing magic bits.
> 
> No functional change.
> 
> NOTE: The type defined in the specification does include an anonymous
>       sub-struct in the page type but, as we currently use only the first
>       element, the struct declaration has been omitted.
> 
> [1] https://github.com/MicrosoftDocs/Virtualization-Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specification%20v5.0C.pdf
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Reviewed-by: Wei Liu <wei.liu2@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Just one style nit below...

> ---
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> v3:
>  - Move the typedef of HV_VP_ASSIST_PAGE into viridian.h so that it can
>    be used in the declaration of struct viridian_vcpu
> ---
>  xen/arch/x86/hvm/viridian/synic.c  | 52 +++++++++++++++++++++++---------------
>  xen/include/asm-x86/hvm/viridian.h |  4 ++-
>  2 files changed, 35 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/viridian/synic.c b/xen/arch/x86/hvm/viridian/synic.c
> index 366608208f..d8d6f6e1c9 100644
> --- a/xen/arch/x86/hvm/viridian/synic.c
> +++ b/xen/arch/x86/hvm/viridian/synic.c
> @@ -16,6 +16,18 @@
>  
>  #include "private.h"
>  
> +typedef struct _HV_VIRTUAL_APIC_ASSIST
> +{
> +    uint32_t no_eoi:1;
> +    uint32_t reserved_zero:31;
> +} HV_VIRTUAL_APIC_ASSIST;
> +
> +union _HV_VP_ASSIST_PAGE
> +{
> +    HV_VIRTUAL_APIC_ASSIST ApicAssist;
> +    uint8_t ReservedZBytePadding[PAGE_SIZE];
> +};

One struct uses CamelCase for fields while the other just uses
underscores. I think it would be better to use a single style.

Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page'
  2018-11-07 11:48   ` Roger Pau Monné
@ 2018-11-07 11:50     ` Paul Durrant
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 11:50 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel, Jan Beulich, Andrew Cooper

> -----Original Message-----
> From: Roger Pau Monne
> Sent: 07 November 2018 11:49
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Andrew Cooper
> <Andrew.Cooper3@citrix.com>; Jan Beulich <jbeulich@suse.com>
> Subject: Re: [Xen-devel] [PATCH v3 3/5] viridian: define type for the
> 'virtual VP assist page'
> 
> On Wed, Nov 07, 2018 at 10:52:21AM +0000, Paul Durrant wrote:
> > The specification [1] defines a type so we should use it, rather than
> just
> > OR-ing and AND-ing magic bits.
> >
> > No functional change.
> >
> > NOTE: The type defined in the specification does include an anonymous
> >       sub-struct in the page type but, as we currently use only the
> first
> >       element, the struct declaration has been omitted.
> >
> > [1] https://github.com/MicrosoftDocs/Virtualization-
> Documentation/raw/live/tlfs/Hypervisor%20Top%20Level%20Functional%20Specif
> ication%20v5.0C.pdf
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > Reviewed-by: Wei Liu <wei.liu2@citrix.com>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Just one style nit below...
> 
> > ---
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> >
> > v3:
> >  - Move the typedef of HV_VP_ASSIST_PAGE into viridian.h so that it can
> >    be used in the declaration of struct viridian_vcpu
> > ---
> >  xen/arch/x86/hvm/viridian/synic.c  | 52 +++++++++++++++++++++++--------
> -------
> >  xen/include/asm-x86/hvm/viridian.h |  4 ++-
> >  2 files changed, 35 insertions(+), 21 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/viridian/synic.c
> b/xen/arch/x86/hvm/viridian/synic.c
> > index 366608208f..d8d6f6e1c9 100644
> > --- a/xen/arch/x86/hvm/viridian/synic.c
> > +++ b/xen/arch/x86/hvm/viridian/synic.c
> > @@ -16,6 +16,18 @@
> >
> >  #include "private.h"
> >
> > +typedef struct _HV_VIRTUAL_APIC_ASSIST
> > +{
> > +    uint32_t no_eoi:1;
> > +    uint32_t reserved_zero:31;
> > +} HV_VIRTUAL_APIC_ASSIST;
> > +
> > +union _HV_VP_ASSIST_PAGE
> > +{
> > +    HV_VIRTUAL_APIC_ASSIST ApicAssist;
> > +    uint8_t ReservedZBytePadding[PAGE_SIZE];
> > +};
> 
> One struct uses CamelCase for fields while the other just uses
> underscores. I think it would be better to use a single style.
> 

That is deliberate. There is no struct definition in the spec. only the name. Thus the field names are ones I have invented based on the text, rather than being 'official'. I reserve CamelCase for the 'official' names :-)

  Paul

> Thanks, Roger.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c
  2018-11-07 10:52 ` [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c Paul Durrant
@ 2018-11-07 13:08   ` Wei Liu
  2018-11-07 13:09     ` Paul Durrant
  0 siblings, 1 reply; 14+ messages in thread
From: Wei Liu @ 2018-11-07 13:08 UTC (permalink / raw)
  To: Paul Durrant; +Cc: xen-devel, Ian Jackson, Wei Liu

On Wed, Nov 07, 2018 at 10:52:22AM +0000, Paul Durrant wrote:
> Also add emacs boilerplate to avoid future problems.
> 
> Purely cosmetic. No functional change.
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> Acked-by: Wei Liu <wei.liu2@citrix.com>

I have pushed this patch to staging.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c
  2018-11-07 13:08   ` Wei Liu
@ 2018-11-07 13:09     ` Paul Durrant
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-07 13:09 UTC (permalink / raw)
  Cc: xen-devel, Wei Liu, Ian Jackson

> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@citrix.com]
> Sent: 07 November 2018 13:09
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: xen-devel@lists.xenproject.org; Ian Jackson <Ian.Jackson@citrix.com>;
> Wei Liu <wei.liu2@citrix.com>
> Subject: Re: [Xen-devel] [PATCH v3 4/5] tools/misc: fix hard tabs in xen-
> hvmctx.c
> 
> On Wed, Nov 07, 2018 at 10:52:22AM +0000, Paul Durrant wrote:
> > Also add emacs boilerplate to avoid future problems.
> >
> > Purely cosmetic. No functional change.
> >
> > Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
> > Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> I have pushed this patch to staging.

Thanks :-)

  Paul

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page'
  2018-11-07 10:52 ` [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page' Paul Durrant
  2018-11-07 11:48   ` Roger Pau Monné
@ 2018-11-09 10:24   ` Jan Beulich
  2018-11-09 10:31     ` Paul Durrant
  1 sibling, 1 reply; 14+ messages in thread
From: Jan Beulich @ 2018-11-09 10:24 UTC (permalink / raw)
  To: Paul Durrant; +Cc: Andrew Cooper, xen-devel

>>> On 07.11.18 at 11:52, <paul.durrant@citrix.com> wrote:
> --- a/xen/include/asm-x86/hvm/viridian.h
> +++ b/xen/include/asm-x86/hvm/viridian.h
> @@ -20,11 +20,13 @@ union viridian_page_msr
>      } fields;
>  };
>  
> +typedef union _HV_VP_ASSIST_PAGE HV_VP_ASSIST_PAGE;
> +
>  struct viridian_vcpu
>  {
>      struct {
>          union viridian_page_msr msr;
> -        void *va;
> +        HV_VP_ASSIST_PAGE *ptr;
>          bool pending;
>      } vp_assist;
>      uint64_t crash_param[5];

I'll commit this as is, but even better would have been to avoid
having the typedef here (visible to everyone).

Jan



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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page'
  2018-11-09 10:24   ` Jan Beulich
@ 2018-11-09 10:31     ` Paul Durrant
  0 siblings, 0 replies; 14+ messages in thread
From: Paul Durrant @ 2018-11-09 10:31 UTC (permalink / raw)
  To: 'Jan Beulich'; +Cc: Andrew Cooper, xen-devel

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 09 November 2018 10:24
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-devel <xen-
> devel@lists.xenproject.org>
> Subject: Re: [PATCH v3 3/5] viridian: define type for the 'virtual VP
> assist page'
> 
> >>> On 07.11.18 at 11:52, <paul.durrant@citrix.com> wrote:
> > --- a/xen/include/asm-x86/hvm/viridian.h
> > +++ b/xen/include/asm-x86/hvm/viridian.h
> > @@ -20,11 +20,13 @@ union viridian_page_msr
> >      } fields;
> >  };
> >
> > +typedef union _HV_VP_ASSIST_PAGE HV_VP_ASSIST_PAGE;
> > +
> >  struct viridian_vcpu
> >  {
> >      struct {
> >          union viridian_page_msr msr;
> > -        void *va;
> > +        HV_VP_ASSIST_PAGE *ptr;
> >          bool pending;
> >      } vp_assist;
> >      uint64_t crash_param[5];
> 
> I'll commit this as is, but even better would have been to avoid
> having the typedef here (visible to everyone).
> 

It goes away in the next patch anyway, when the generalized guest_page is introduced.

  Paul

> Jan
> 


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-11-09 10:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07 10:52 [PATCH v3 0/5] (remainder of) viridian cleanup Paul Durrant
2018-11-07 10:52 ` [PATCH v3 1/5] viridian: separate interrupt related enlightenment implementations Paul Durrant
2018-11-07 11:36   ` Roger Pau Monné
2018-11-07 10:52 ` [PATCH v3 2/5] viridian: separate time " Paul Durrant
2018-11-07 11:43   ` Roger Pau Monné
2018-11-07 10:52 ` [PATCH v3 3/5] viridian: define type for the 'virtual VP assist page' Paul Durrant
2018-11-07 11:48   ` Roger Pau Monné
2018-11-07 11:50     ` Paul Durrant
2018-11-09 10:24   ` Jan Beulich
2018-11-09 10:31     ` Paul Durrant
2018-11-07 10:52 ` [PATCH v3 4/5] tools/misc: fix hard tabs in xen-hvmctx.c Paul Durrant
2018-11-07 13:08   ` Wei Liu
2018-11-07 13:09     ` Paul Durrant
2018-11-07 10:52 ` [PATCH v3 5/5] viridian: introduce struct viridian_page Paul Durrant

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.