All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Durrant, Paul" <pdurrant@amazon.com>
To: Wei Liu <wl@xen.org>,
	Xen Development List <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <liuwe@microsoft.com>, "Paul Durrant" <paul@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Michael Kelley" <mikelley@microsoft.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH 1/4] x86/viridian: drop duplicate defines from private.h and viridian.c
Date: Sat, 21 Dec 2019 12:19:26 +0000	[thread overview]
Message-ID: <58cffe9a734a4a118bef5293531bcd0c@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <20191220195135.20130-2-liuwe@microsoft.com>

> -----Original Message-----
> From: Wei Liu <wei.liu.xen@gmail.com> On Behalf Of Wei Liu
> Sent: 20 December 2019 19:52
> To: Xen Development List <xen-devel@lists.xenproject.org>
> Cc: Michael Kelley <mikelley@microsoft.com>; Durrant, Paul
> <pdurrant@amazon.com>; Wei Liu <liuwe@microsoft.com>; Paul Durrant
> <paul@xen.org>; Jan Beulich <jbeulich@suse.com>; Andrew Cooper
> <andrew.cooper3@citrix.com>; Wei Liu <wl@xen.org>; Roger Pau Monné
> <roger.pau@citrix.com>
> Subject: [PATCH 1/4] x86/viridian: drop duplicate defines from private.h
> and viridian.c
> 
> Also add HVCALL_EXT_CALL_QUERY_CAPABILITIES to hyperv-tlfs.h.
> HvGetPartitionID was never used in code so just dropped it.
> 
> No functional change intended.
> 
> Signed-off-by: Wei Liu <liuwe@microsoft.com>

Reviewed-by: Paul Durrant <paul@xen.org>

> ---
>  xen/arch/x86/hvm/viridian/private.h     | 66 -------------------------
>  xen/arch/x86/hvm/viridian/viridian.c    | 29 +++--------
>  xen/include/asm-x86/guest/hyperv-tlfs.h |  1 +
>  3 files changed, 8 insertions(+), 88 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/viridian/private.h
> b/xen/arch/x86/hvm/viridian/private.h
> index c272c34cda..958a2814c2 100644
> --- a/xen/arch/x86/hvm/viridian/private.h
> +++ b/xen/arch/x86/hvm/viridian/private.h
> @@ -5,72 +5,6 @@
> 
>  #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);
> 
> diff --git a/xen/arch/x86/hvm/viridian/viridian.c
> b/xen/arch/x86/hvm/viridian/viridian.c
> index 4b06b78a27..341592f054 100644
> --- a/xen/arch/x86/hvm/viridian/viridian.c
> +++ b/xen/arch/x86/hvm/viridian/viridian.c
> @@ -10,6 +10,7 @@
>  #include <xen/hypercall.h>
>  #include <xen/domain_page.h>
>  #include <asm/guest_access.h>
> +#include <asm/guest/hyperv-tlfs.h>
>  #include <asm/paging.h>
>  #include <asm/p2m.h>
>  #include <asm/apic.h>
> @@ -19,22 +20,6 @@
> 
>  #include "private.h"
> 
> -/* Viridian Hypercall Status Codes. */
> -#define HV_STATUS_SUCCESS                       0x0000
> -#define HV_STATUS_INVALID_HYPERCALL_CODE        0x0002
> -#define HV_STATUS_INVALID_PARAMETER             0x0005
> -
> -/* Viridian Hypercall Codes. */
> -#define HvFlushVirtualAddressSpace 0x0002
> -#define HvFlushVirtualAddressList  0x0003
> -#define HvNotifyLongSpinWait       0x0008
> -#define HvSendSyntheticClusterIpi  0x000b
> -#define HvGetPartitionId           0x0046
> -#define HvExtCallQueryCapabilities 0x8001
> -
> -/* Viridian Hypercall Flags. */
> -#define HV_FLUSH_ALL_PROCESSORS 1
> -
>  /* Viridian Partition Privilege Flags */
>  typedef struct {
>      /* Access to virtual MSRs */
> @@ -214,7 +199,7 @@ void cpuid_viridian_leaves(const struct vcpu *v,
> uint32_t leaf,
>          /*
>           * This value is the recommended number of attempts to try to
>           * acquire a spinlock before notifying the hypervisor via the
> -         * HvNotifyLongSpinWait hypercall.
> +         * HVCALL_NOTIFY_LONG_SPIN_WAIT hypercall.
>           */
>          res->b = viridian_spinlock_retry_count;
>          break;
> @@ -583,7 +568,7 @@ int viridian_hypercall(struct cpu_user_regs *regs)
> 
>      switch ( input.call_code )
>      {
> -    case HvNotifyLongSpinWait:
> +    case HVCALL_NOTIFY_LONG_SPIN_WAIT:
>          /*
>           * See section 14.5.1 of the specification.
>           */
> @@ -591,8 +576,8 @@ int viridian_hypercall(struct cpu_user_regs *regs)
>          status = HV_STATUS_SUCCESS;
>          break;
> 
> -    case HvFlushVirtualAddressSpace:
> -    case HvFlushVirtualAddressList:
> +    case HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE:
> +    case HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST:
>      {
>          struct {
>              uint64_t address_space;
> @@ -632,7 +617,7 @@ int viridian_hypercall(struct cpu_user_regs *regs)
>          break;
>      }
> 
> -    case HvSendSyntheticClusterIpi:
> +    case HVCALL_SEND_IPI:
>      {
>          struct vcpu *v;
>          uint32_t vector;
> @@ -695,7 +680,7 @@ int viridian_hypercall(struct cpu_user_regs *regs)
>          gprintk(XENLOG_WARNING, "unimplemented hypercall %04x\n",
>                  input.call_code);
>          /* Fallthrough. */
> -    case HvExtCallQueryCapabilities:
> +    case HVCALL_EXT_CALL_QUERY_CAPABILITIES:
>          /*
>           * This hypercall seems to be erroneously issued by Windows
>           * despite EnableExtendedHypercalls not being set in CPUID leaf
> 2.
> diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-
> x86/guest/hyperv-tlfs.h
> index ccd9850b27..b128807b2c 100644
> --- a/xen/include/asm-x86/guest/hyperv-tlfs.h
> +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
> @@ -374,6 +374,7 @@ struct hv_tsc_emulation_status {
>  #define HVCALL_SIGNAL_EVENT			0x005d
>  #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af
>  #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0
> +#define HVCALL_EXT_CALL_QUERY_CAPABILITIES	0x8001
> 
>  #define HV_X64_MSR_VP_ASSIST_PAGE_ENABLE	0x00000001
>  #define HV_X64_MSR_VP_ASSIST_PAGE_ADDRESS_SHIFT	12
> --
> 2.20.1


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

  reply	other threads:[~2019-12-21 12:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 19:51 [Xen-devel] [PATCH 0/4] Clean up viridian code Wei Liu
2019-12-20 19:51 ` [Xen-devel] [PATCH 1/4] x86/viridian: drop duplicate defines from private.h and viridian.c Wei Liu
2019-12-21 12:19   ` Durrant, Paul [this message]
2019-12-20 19:51 ` [Xen-devel] [PATCH 2/4] x86/viridian: drop private copy of HV_REFERENCE_TSC_PAGE in time.c Wei Liu
2019-12-21 12:20   ` Durrant, Paul
2019-12-20 19:51 ` [Xen-devel] [PATCH 3/4] x86: provide and use hv_tsc_scale Wei Liu
2019-12-21 12:27   ` Durrant, Paul
2019-12-20 19:51 ` [Xen-devel] [PATCH 4/4] x86: move viridian_guest_os_id_msr to hyperv-tlfs.h Wei Liu
2019-12-21 12:28   ` Durrant, Paul
2019-12-20 21:21 ` [Xen-devel] [PATCH 5/4] x86/viridian: drop a wrong invalid value from reference TSC implementation Wei Liu
2019-12-21 12:06   ` Durrant, Paul

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=58cffe9a734a4a118bef5293531bcd0c@EX13D32EUC003.ant.amazon.com \
    --to=pdurrant@amazon.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=liuwe@microsoft.com \
    --cc=mikelley@microsoft.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 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.