From patchwork Mon Aug 29 12:01:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 9303731 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 8D2E46077C for ; Mon, 29 Aug 2016 12:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E57E2884D for ; Mon, 29 Aug 2016 12:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72B282885D; Mon, 29 Aug 2016 12:04:34 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 A6E132884D for ; Mon, 29 Aug 2016 12:04:30 +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 1beLGX-0007Zn-Ok; Mon, 29 Aug 2016 12:02:13 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1beLGW-0007Ze-Ia for xen-devel@lists.xen.org; Mon, 29 Aug 2016 12:02:12 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 73/FF-30284-34424C75; Mon, 29 Aug 2016 12:02:11 +0000 X-Br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.tower-206.messagelabs.com!1472472129!20369843!1 X-Originating-IP: [104.47.32.80] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5359 invoked from network); 29 Aug 2016 12:02:10 -0000 Received: from mail-sn1nam01on0080.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) (104.47.32.80) by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP; 29 Aug 2016 12:02:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=x9e8+tAjJAQe5U5sPdAp2y09RJZ4VFZOIKqAtLEgYWE=; b=oMC5cfIAqGExk+0DunTdbC55Dew5yxBGjGUdNlhZGhrwRQx5YIY3t9lssxKvhEqiyLA1RpzvyfleYRHQC9HzX4Fbe4OSsRV8jfAJQRtu7f/6F/qRkLc6YZXSg6Eax1aLrXz3G+0njwSr3ihN5HP/VehQ4hEddaOp5Dii033B9RI= Received: from localhost.localdomain (114.109.128.54) by CY4PR12MB1446.namprd12.prod.outlook.com (10.172.71.138) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 29 Aug 2016 12:02:05 +0000 From: Suravee Suthikulpanit To: Date: Mon, 29 Aug 2016 07:01:23 -0500 Message-ID: <1472472083-2300-1-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [114.109.128.54] X-ClientProxiedBy: SINPR01CA0033.apcprd01.prod.exchangelabs.com (10.141.109.33) To CY4PR12MB1446.namprd12.prod.outlook.com (10.172.71.138) X-MS-Office365-Filtering-Correlation-Id: cd4e2c32-d2b8-4ab7-2008-08d3d0044ce1 X-Microsoft-Exchange-Di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KhsVVTwmKizdv4BDtKqG/BAZX0rEb8ZhpkhufX8nIbMa7+DrLxQXO97fvFPmnMraYYPvGVc/M6V7AUpCNjeT5WEsM1oD6edCEBB7Lz0Q= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 31:hsBw3vTBYRVlWSX9gjI6rxm59UmSBomfRmsv9UzcJgjVaKh3IM7Br7UHBXpWwzL2pzpH4y7Q43rrxJYNgey3e/Bz2pZmPvDXC5y6V3U9uvbkptDi6s1CEHGy1MJV0F2i7YyUz6oE004uBcDH3uyIIm1vuOS+LwJOm5n7YAkgvalJrLNcKTb6dQGwlfn7sj0akY8vbfVZe1uXIDshQbMMKrSzBpR2ZkxytwYBXIcsYrY=; 20:jj+XMSLaIkUza/bo2XJkW7gn87QcGk3FzpTYr3w05IVeLmK5OmnpJxmVzYPUw+bRbOiNUh2hUmybQkdf2BEVVT/sEBU2WPOnw9AKDO5dI0knNeijLDGoACu7n3RZXt3+/eFBg/9xB4rX2c4oDJuneOCp6qYYGA1jVZsHCFPsbfHW3syBnwblQm2qERBOxrUgri1CszYWC5JA89nqzP0OnyvW3zg6LF/9A21PcUzJJBSSjvM8BBls7LiAHi3jeyvg/+KJBQvkQPg00g2Ga5C5FLxd3e5TZuwDw/aTPaDayRdV1Ev+fSn8MorTR7lzhOvo2FLUNOP9PTfBiSzk5EV/D3HYjXZtjHoKFCVF8uIGyllAwFb1wzWDV0qRiwJD+4UIlQhgEJ8nStoKun48XwFGKov2JWBI8RvIx6xKexYvwxGDIOmgCjuXnb05IToC6NcvyzBodn5OMWTCektR4yFk1yiig70ZuSzp+cFH7bQL9T3YCUTsy33afWF3QEc9bzD+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(70601490899591); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:CY4PR12MB1446; BCL:0; PCL:0; RULEID:; SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 4:sdowYhw69FC7Fd/Pt9DgF70KrZMRQ5Sul16CCVtvjrrxybfv+rDc7o1Xcmo4soNjbesE8ev3zPsQzl67qbUzFHYfj4So+MXNjBQK9W+X32WgSEhfkrRELnjTuGgu/UgFxpAH5liIT47afIt/8RbDliKxY+bXo7KSiRzFvFFmokDO2Px/ER+aTZCq4Drg2dEH3SdvYTUKhURrXTdt96l7FwfZ4kPH9OZbJtvj2W6Cn/ie1MR1C6sNXCG3OrGheJ9oY5ruCv2hpFGvnlS3hFbaClwpAWC0AIMWpq/osrlJAplD55Iby0n3U+ZjuieNWpxt4WantdhZwUj7feqAJ+f2v+UPgyrBvs95qCI1H7EwHICFtVa8M91AvyjW57PUJ+xlIycSD7RgSkPRpJbJQZZijPH0yCUAXcYGBOnSgSsQZ8d1DK3SRD2/CDx/nDkGc/R3Kp/AyiPkJxnF3PBPNbSATRS1TRqPgmEelLTlZdE4+Es= X-Forefront-PRVS: 0049B3F387 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(92566002)(5003940100001)(50986999)(42186005)(97736004)(3846002)(586003)(50226002)(4326007)(81156014)(81166006)(8666005)(2906002)(8676002)(6116002)(48376002)(50466002)(105586002)(101416001)(106356001)(229853001)(2351001)(110136002)(189998001)(36756003)(19580395003)(19580405001)(33646002)(47776003)(77096005)(66066001)(68736007)(305945005)(86362001)(7846002)(5660300001)(7736002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1446; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1446; 23:W3DEY+FG3R7xGO3G9Y+eVAuGEnoJBttlrfb0ZQJB6?= =?us-ascii?Q?+Rs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2AnTNakCOm+i6G7YkFevBIgjFcfeyqXLuZMgaZNe9doSVwpKOHl+lhqW5vEzMKE88 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 20:dEuAurkExnpAWhpKXvWOeJc+BZIUSl79yqUPSxjBnDQcz8EOGA/VH9Vko2/KvJH13nBmi/sl74RLyLfakl8x5fx7xnYIJB3hi5kM1xM06K3cg2ZZJFq6Ixq8BcubB5HKnq9Lrd1V6MVQX4znZoxBBEBYzqEQpTa7edv8B4v+wXbaydd8nBGGhVOcSODe3F8xKIWO1QbfAUouiTTQNxdBy7HytyeSDyur/Aag119pwhAdgnb6N7ok0jTcvtPkBu60 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2016 12:02:05.7015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1446 Cc: andrew.cooper3@citrix.com, Wei Liu , Suravee Suthikulpanit , jbeulich@suse.com, sherry.hurwitz@amd.com Subject: [Xen-devel] [PATCH] xen/HVM: Add guarding logic for VMX specific code 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 struct hvm_domain.vmx is defined in a union along with the svm. This can causes issue for SVM since this code is used in the common scheduling code for x86. The logic must check for cpu_has_vmx before accessing the hvm_domain.vmx sturcture. Signed-off-by: Suravee Suthikulpanit Cc: Wei Liu Cc: Jan Beulich Reviewed-by: Konrad Rzeszutek Wilk --- Note: I ran into an issue while working on the upcoming patch series for AMD Advance Virtual Interrupt Controller patch series, which will use the hvm_domain.svm structure. xen/include/asm-x86/hvm/hvm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 314881a..5d463e0 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -611,7 +611,7 @@ unsigned long hvm_cr4_guest_reserved_bits(const struct vcpu *v, bool_t restore); struct vcpu *v_ = (v); \ struct domain *d_ = v_->domain; \ if ( has_hvm_container_domain(d_) && \ - d_->arch.hvm_domain.vmx.vcpu_block ) \ + (cpu_has_vmx && d_->arch.hvm_domain.vmx.vcpu_block) ) \ d_->arch.hvm_domain.vmx.vcpu_block(v_); \ })