From patchwork Mon Jan 9 11:03:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9504347 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 C474B60710 for ; Mon, 9 Jan 2017 11:18:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2BB1282ED for ; Mon, 9 Jan 2017 11:18:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7E742848D; Mon, 9 Jan 2017 11:18:28 +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 7F8AB282ED for ; Mon, 9 Jan 2017 11:18:28 +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 1cQXwN-0003nQ-L1; Mon, 09 Jan 2017 11:16:39 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQXwM-0003m5-BG for xen-devel@lists.xen.org; Mon, 09 Jan 2017 11:16:38 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id 30/8B-27678-51173785; Mon, 09 Jan 2017 11:16:37 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphkeJIrShJLcpLzFFi42JxWrrBXleksDj C4MwWRoslHxezODB6HN39mymAMYo1My8pvyKBNWPP+qOsBdeEKg5+PMrWwHict4uRk0NCwF9i 3oyvbCA2m4C+xO4Xn5hAbBEBdYnTHRdZuxg5OJgFdCVW/dQACQsLJErMuNPJAmKzCKhITDw0g R3E5hXwkvg8pY0RYqScxPnjP5lBbE6g+LQ/J8DiQgKeEgsfvmCGsNUkrvVfguoVlDg58wnYTG YBCYmDL14wT2DknYUkNQtJagEj0ypGjeLUorLUIl0jE72kosz0jJLcxMwcXUMDM73c1OLixPT UnMSkYr3k/NxNjMDQYQCCHYwr1wUeYpTkYFIS5XWMKogQ4kvKT6nMSCzOiC8qzUktPsQow8Gh JMGbl18cISRYlJqeWpGWmQMMYpi0BAePkgjvbJA0b3FBYm5xZjpE6hSjopQ47w2QhABIIqM0D 64NFjmXGGWlhHkZgQ4R4ilILcrNLEGVf8UozsGoJMy7CGQKT2ZeCdz0V0CLmYAWR9qBLS5JRE hJNTDKvz8zfVO906KdHmzc0XEh2s2CYX1reNt/iYb3OcUdqmnpU1511jTmgkt6cHjcFEt3fcH N/XXFMguCzI5f/1rkUrpY6t6iq1XlAkfu7f6bbe7xaaOn5mnP97+e9es8/LHU+ahz38R5tr4r E1wChJJ4+7yZv4Zucb2yuNeoplTD17DnVZW1jRJLcUaioRZzUXEiAH5Z70CXAgAA X-Env-Sender: prvs=175ce6123=Andrew.Cooper3@citrix.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1483960586!68499925!5 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 48030 invoked from network); 9 Jan 2017 11:16:35 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 9 Jan 2017 11:16:35 -0000 X-IronPort-AV: E=Sophos;i="5.33,339,1477958400"; d="scan'208";a="407515713" From: Andrew Cooper To: Xen-devel Date: Mon, 9 Jan 2017 11:03:32 +0000 Message-ID: <1483959822-30484-16-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1483959822-30484-1-git-send-email-andrew.cooper3@citrix.com> References: <1483959822-30484-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper Subject: [Xen-devel] [PATCH v2 15/25] x86/pv: Use per-domain policy information when calculating the cpumasks 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 ... rather than dynamically clamping against the PV maximum policy. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- v2: * Spelling fix in the commit message --- xen/arch/x86/domctl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index a3b2b72..c538781 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -100,8 +100,8 @@ static void update_domain_cpuid_info(struct domain *d, if ( is_pv_domain(d) && ((levelling_caps & LCAP_1cd) == LCAP_1cd) ) { uint64_t mask = cpuidmask_defaults._1cd; - uint32_t ecx = ctl->ecx & pv_featureset[FEATURESET_1c]; - uint32_t edx = ctl->edx & pv_featureset[FEATURESET_1d]; + uint32_t ecx = p->basic._1c; + uint32_t edx = p->basic._1d; /* * Must expose hosts HTT and X2APIC value so a guest using native @@ -175,7 +175,7 @@ static void update_domain_cpuid_info(struct domain *d, { uint64_t mask = cpuidmask_defaults._7ab0; uint32_t eax = ctl->eax; - uint32_t ebx = ctl->ebx & pv_featureset[FEATURESET_7b0]; + uint32_t ebx = p->feat._7b0; if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD ) mask &= ((uint64_t)eax << 32) | ebx; @@ -191,7 +191,7 @@ static void update_domain_cpuid_info(struct domain *d, if ( is_pv_domain(d) && ((levelling_caps & LCAP_Da1) == LCAP_Da1) ) { uint64_t mask = cpuidmask_defaults.Da1; - uint32_t eax = ctl->eax & pv_featureset[FEATURESET_Da1]; + uint32_t eax = p->xstate.Da1; if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ) mask &= (~0ULL << 32) | eax; @@ -204,8 +204,8 @@ static void update_domain_cpuid_info(struct domain *d, if ( is_pv_domain(d) && ((levelling_caps & LCAP_e1cd) == LCAP_e1cd) ) { uint64_t mask = cpuidmask_defaults.e1cd; - uint32_t ecx = ctl->ecx & pv_featureset[FEATURESET_e1c]; - uint32_t edx = ctl->edx & pv_featureset[FEATURESET_e1d]; + uint32_t ecx = p->extd.e1c; + uint32_t edx = p->extd.e1d; /* * Must expose hosts CMP_LEGACY value so a guest using native