From patchwork Fri Mar 17 09:57:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 9630149 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 1FBA2602D7 for ; Fri, 17 Mar 2017 09:59:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9C70286A1 for ; Fri, 17 Mar 2017 09:59:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE795286A3; Fri, 17 Mar 2017 09:59:49 +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 2219B286A2 for ; Fri, 17 Mar 2017 09:59:48 +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 1coodL-0000Tu-HD; Fri, 17 Mar 2017 09:57:19 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coodK-0000T9-7K for xen-devel@lists.xenproject.org; Fri, 17 Mar 2017 09:57:18 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id CE/59-19731-DF2BBC85; Fri, 17 Mar 2017 09:57:17 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeJIrShJLcpLzFFi42JxWrrBXvfvptM RBu0HBS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oylH+cwFczmrHg+aRlzA2MrexcjJ4eEgL9E y4fdrCA2m4COxNSnl4BsDg4RARWJ23sNQExmgXKJjgm1IBXCAuESG6fsZwEJswioSsx4pgoS5 hVwl9i1eD4jxEA5ifPHfzKD2JwCHhIXLzWBxYWAahY0f2WDsFUk1k+dxQbRKyhxcuYTFhCbWU BC4uCLF8wTGHlnIUnNQpJawMi0ilGjOLWoLLVI19BcL6koMz2jJDcxM0fX0MBMLze1uDgxPTU nMalYLzk/dxMjMGwYgGAH4+2NAYcYJTmYlER5r587ESHEl5SfUpmRWJwRX1Sak1p8iFGGg0NJ grf+NlBOsCg1PbUiLTMHGMAwaQkOHiUR3k8gad7igsTc4sx0iNQpRkUpcd5nIAkBkERGaR5cG yxqLjHKSgnzMgIdIsRTkFqUm1mCKv+KUZyDUUmY9zPIFJ7MvBK46a+AFjMBLU78eQRkcUkiQk qqgXHC92M39rpwefUv3N88UYVRyjC25vyWIvdQpc06NVwXdT2MbI6dUGnJ+DBHs9GleckGx8U cM36+yoquWMP4pjtz01G7EMN54q5tr/u7pFQbZGrn3p/L+qZMLbF8ztZ/SwS9VGUFBGYclKk8 vLY8bWKD9V+lhWf6Jb+dOvEpdFrMSo23Jxe2sSixFGckGmoxFxUnAgB2q4yPlQIAAA== X-Env-Sender: prvs=242126e8b=Paul.Durrant@citrix.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1489744635!56150447!1 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.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16486 invoked from network); 17 Mar 2017 09:57:16 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2017 09:57:16 -0000 X-IronPort-AV: E=Sophos;i="5.36,176,1486425600"; d="scan'208";a="423198444" From: Paul Durrant To: Date: Fri, 17 Mar 2017 09:57:10 +0000 Message-ID: <1489744633-28760-5-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1489744633-28760-1-git-send-email-paul.durrant@citrix.com> References: <1489744633-28760-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 Cc: Andrew Cooper , Paul Durrant , Jan Beulich Subject: [Xen-devel] [PATCH 4/7] x86/viridian: get rid of the magic numbers in CPUID leaves 1 and 2 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 The numbers correspond to ASCII characters so just use appropriate character strings directly. Signed-off-by: Paul Durrant --- Cc: Jan Beulich Cc: Andrew Cooper --- xen/arch/x86/hvm/viridian.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c index 433035e..4151ba5 100644 --- a/xen/arch/x86/hvm/viridian.c +++ b/xen/arch/x86/hvm/viridian.c @@ -119,14 +119,16 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf, switch ( leaf ) { case 0: + /* See section 2.4.1 of the specification */ res->a = 0x40000006; /* Maximum leaf */ - res->b = 0x7263694d; /* Magic numbers */ - res->c = 0x666F736F; - res->d = 0x76482074; + res->b = *(uint32_t *)"Micr"; + res->c = *(uint32_t *)"osof"; + res->d = *(uint32_t *)"t Hv"; break; case 1: - res->a = 0x31237648; /* Version number */ + /* See section 2.4.2 of the specification */ + res->a = *(uint32_t *)"Hv#1"; break; case 2: