From patchwork Wed Jan 4 12:39:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9496673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9FC4606B5 for ; Wed, 4 Jan 2017 12:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC62227F85 for ; Wed, 4 Jan 2017 12:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A14EB27F8D; Wed, 4 Jan 2017 12:48:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35C0727F85 for ; Wed, 4 Jan 2017 12:48:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOkxc-0005iU-Ve; Wed, 04 Jan 2017 12:46:32 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cOkxb-0005f0-Q6 for xen-devel@lists.xen.org; Wed, 04 Jan 2017 12:46:31 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 54/12-31649-7AEEC685; Wed, 04 Jan 2017 12:46:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42JxWrrBXnfZu5w IgxeP2SyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyfa/awFEzgrlh2qZ2tgfETRxcjJ4eEgL/E 3lurGEFsNgF9id0vPjGB2CIC6hKnOy6ydjFycTALbGWUuLXjCDNIQljAU2LZ0m6wBhYBFYlV1 2azgNi8QPFzy/ezQgyVkzh//CdYPSdQ/NnGdWD1QgIeElMuLmOHsNUkrvVfYofoFZQ4OfMJ2B xmAQmJgy9eME9g5J2FJDULSWoBI9MqRo3i1KKy1CJdIyO9pKLM9IyS3MTMHF1DA2O93NTi4sT 01JzEpGK95PzcTYzA8KlnYGDcwTj1hN8hRkkOJiVR3r72nAghvqT8lMqMxOKM+KLSnNTiQ4wy HBxKErxCb4FygkWp6akVaZk5wECGSUtw8CiJ8OqDpHmLCxJzizPTIVKnGBWlxHmNQRICIImM0 jy4Nlj0XGKUlRLmZWRgYBDiKUgtys0sQZV/xSjOwagkzGsDMoUnM68EbvoroMVMQIu3B2SDLC 5JREhJNTD6ZN0X8+d8feR864X9TvPWidlM3jRZUKEvJGxOl0bw6ZRHl0W7bx8/+pVzuV0LO1+ WU2q4TKRi1oYLtacW1guGaSwxV/pZse1r+xGF+gaXCNns9Y8eC07cF19/8o3cFYnzR0unbpk3 lcHV99Hy4qJkthR7taVhF8VPGa0/9/5jCfvKi2qnvRyVWIozEg21mIuKEwE31CvxmQIAAA== X-Env-Sender: prvs=1701003ad=Andrew.Cooper3@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1483533987!74929610!2 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 47213 invoked from network); 4 Jan 2017 12:46:29 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 4 Jan 2017 12:46:29 -0000 X-IronPort-AV: E=Sophos;i="5.33,459,1477958400"; d="scan'208";a="406724761" From: Andrew Cooper To: Xen-devel Date: Wed, 4 Jan 2017 12:39:42 +0000 Message-ID: <1483533584-8015-26-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1483533584-8015-1-git-send-email-andrew.cooper3@citrix.com> References: <1483533584-8015-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Boris Ostrovsky , Suravee Suthikulpanit , Jan Beulich Subject: [Xen-devel] [PATCH 25/27] x86/svm: Use guest_cpuid() rather than hvm_cpuid() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP More work is required before LWP details can be read straight out of the cpuid_policy block, but in the meantime hvm_cpuid() wants to disappear so update the code to use the newer interface. Signed-off-by: Andrew Cooper Reviewed-by: Boris Ostrovsky Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Boris Ostrovsky CC: Suravee Suthikulpanit --- 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 8f6737c..36c7edd 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -926,17 +926,17 @@ static inline void svm_lwp_load(struct vcpu *v) /* Update LWP_CFG MSR (0xc0000105). Return -1 if error; otherwise returns 0. */ static int svm_update_lwp_cfg(struct vcpu *v, uint64_t msr_content) { - unsigned int edx; + struct cpuid_leaf res; uint32_t msr_low; static uint8_t lwp_intr_vector; if ( xsave_enabled(v) && cpu_has_lwp ) { - hvm_cpuid(0x8000001c, NULL, NULL, NULL, &edx); + guest_cpuid(v, 0x8000001c, 0, &res); msr_low = (uint32_t)msr_content; /* generate #GP if guest tries to turn on unsupported features. */ - if ( msr_low & ~edx) + if ( msr_low & ~res.d) return -1; v->arch.hvm_svm.guest_lwp_cfg = msr_content;