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 5/4] x86/svm: Minor cleanup to start_svm()
Date: Thu, 5 Dec 2019 10:51:34 +0000 [thread overview]
Message-ID: <20191205105134.7801-1-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20191204094335.24603-1-andrew.cooper3@citrix.com>
The function is init, so can use boot_cpu_data directly.
There is no need to write 0 to svm_feature_flags in the case of a CPUID
mismatch (not least because this is dead code on real hardware), and no need
to use locked atomic operations.
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/hvm/svm/svm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index af3d45fe56..806bf91171 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1632,14 +1632,14 @@ const struct hvm_function_table * __init start_svm(void)
setup_vmcb_dump();
- svm_feature_flags = (current_cpu_data.extended_cpuid_level >= 0x8000000A ?
- cpuid_edx(0x8000000A) : 0);
+ if ( boot_cpu_data.extended_cpuid_level >= 0x8000000a )
+ svm_feature_flags = cpuid_edx(0x8000000a);
printk("SVM: Supported advanced features:\n");
/* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
if ( !cpu_has_svm_nrips )
- clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
+ __clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
if ( cpu_has_tsc_ratio )
svm_function_table.tsc_scaling.ratio_frac_bits = 32;
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-12-05 10:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 9:43 [Xen-devel] [PATCH 0/4] x86/svm: (Post TASK_SWITCH) cleanup Andrew Cooper
2019-12-04 9:43 ` [Xen-devel] [PATCH 1/4] x86/svm: Clean up construct_vmcb() Andrew Cooper
2019-12-04 10:06 ` Jan Beulich
2019-12-04 19:21 ` Andrew Cooper
2019-12-04 9:43 ` [Xen-devel] [PATCH 2/4] x86/svm: Don't shadow variables in svm_vmexit_handler() Andrew Cooper
2019-12-04 10:10 ` Jan Beulich
2019-12-04 9:43 ` [Xen-devel] [PATCH 3/4] x86/svm: Clean up intinfo_t variables Andrew Cooper
2019-12-04 10:19 ` Jan Beulich
2019-12-04 19:22 ` Andrew Cooper
2019-12-04 19:38 ` Andrew Cooper
2019-12-05 9:11 ` Jan Beulich
2019-12-05 12:33 ` Andrew Cooper
2019-12-04 9:43 ` [Xen-devel] [PATCH 4/4] x86/svm: Use named (bit)fields for task switch exit info Andrew Cooper
2019-12-04 10:24 ` Jan Beulich
2019-12-04 20:04 ` Andrew Cooper
2019-12-05 9:05 ` Jan Beulich
2019-12-05 10:51 ` Andrew Cooper [this message]
2019-12-05 10:53 ` [Xen-devel] [PATCH 5/4] x86/svm: Minor cleanup to start_svm() 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=20191205105134.7801-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).