All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH] x86/msr: Drop {pv,hvm}_max_vcpu_msrs objects
Date: Mon, 24 Feb 2020 14:22:31 +0000	[thread overview]
Message-ID: <20200224142231.31097-1-andrew.cooper3@citrix.com> (raw)

It turns out that these are unused, and we dup a type-dependent block of
zeros.  Use xzalloc() instead.

Read/write MSRs are typically 0 to being with, and non-zero defaults would
need dealing with at suitable INIT/RESET points (e.g. arch_vcpu_regs_init).

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msr.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index dd26c87758..3ebf777c53 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -35,9 +35,6 @@ struct msr_policy __read_mostly     raw_msr_policy,
                   __read_mostly hvm_max_msr_policy,
                   __read_mostly  pv_max_msr_policy;
 
-struct vcpu_msrs __read_mostly hvm_max_vcpu_msrs,
-                 __read_mostly  pv_max_vcpu_msrs;
-
 static void __init calculate_raw_policy(void)
 {
     /* 0x000000ce  MSR_INTEL_PLATFORM_INFO */
@@ -103,10 +100,7 @@ int init_domain_msr_policy(struct domain *d)
 
 int init_vcpu_msr_policy(struct vcpu *v)
 {
-    struct domain *d = v->domain;
-    struct vcpu_msrs *msrs =
-        xmemdup(is_pv_domain(d) ?  &pv_max_vcpu_msrs
-                                : &hvm_max_vcpu_msrs);
+    struct vcpu_msrs *msrs = xzalloc(*msrs);
 
     if ( !msrs )
         return -ENOMEM;
-- 
2.11.0


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

             reply	other threads:[~2020-02-24 14:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24 14:22 Andrew Cooper [this message]
2020-02-24 14:32 ` [Xen-devel] [PATCH] x86/msr: Drop {pv, hvm}_max_vcpu_msrs objects Roger Pau Monné
2020-02-24 14:34   ` Andrew Cooper
2020-02-25 14:42 ` Jan Beulich

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=20200224142231.31097-1-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --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.