From patchwork Mon Aug 22 22:36:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9294573 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 6FD1B60574 for ; Mon, 22 Aug 2016 23:08:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F38A28ACF for ; Mon, 22 Aug 2016 23:08:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5381128AF7; Mon, 22 Aug 2016 23:08:52 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE90928ACF for ; Mon, 22 Aug 2016 23:08:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753286AbcHVXIb (ORCPT ); Mon, 22 Aug 2016 19:08:31 -0400 Received: from mail-by2nam01on0057.outbound.protection.outlook.com ([104.47.34.57]:17444 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752016AbcHVXI1 (ORCPT ); Mon, 22 Aug 2016 19:08:27 -0400 X-Greylist: delayed 865 seconds by postgrey-1.27 at vger.kernel.org; Mon, 22 Aug 2016 19:08:27 EDT 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=IDIqJ9aVRxHP2i2jrL5qkWHUflcpmrIV7xlm21qn6gs=; b=GIym4hxhnoLdxijQJiX42FL1JmTPZVmSfqo7yEDIV1ifRYLUveBZNaHUGxczu42D/Q1QP4KQyp2no0K7MwIYBGdD+qbeWwFMZWpvltM+U+hcpo4oi7W23sTYbRLVaL0vrtn3vtDgkm2UszSQ7HL2eD3QmW0DB4DVIX2U8WGjKd0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1152.namprd12.prod.outlook.com (10.169.204.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.557.21; Mon, 22 Aug 2016 22:36:38 +0000 From: Tom Lendacky Subject: [RFC PATCH v2 06/20] x86: Handle reduction in physical address size with SME To: , , , , , , , , CC: Radim =?utf-8?b?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Joerg Roedel , "Konrad Rzeszutek Wilk" , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , "Andy Lutomirski" , "H. Peter Anvin" , "Paolo Bonzini" , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov Date: Mon, 22 Aug 2016 17:36:34 -0500 Message-ID: <20160822223634.29880.93825.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> References: <20160822223529.29880.50884.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN1PR12CA0029.namprd12.prod.outlook.com (10.162.96.167) To MWHPR12MB1152.namprd12.prod.outlook.com (10.169.204.16) X-MS-Office365-Filtering-Correlation-Id: e872c510-a8e9-4449-ce8c-08d3cadcc8f0 X-Microsoft-Exchange-Diagnostics: 1; MWHPR12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W4LG5GtHyl9WwdKj21f8ZULfGvq7FQjCcvKpI4iFZnVGcYyXOiOQX69GuHdDX1XGwZHyC/ZYqdv93dwSGt8K3waZqi1sI4LxsqQ0IyXw7gMqkD4wdtoz//QnvoEte/AHbOd2n7zoYTX0vJT1AxZC5EI3gRweraYYyUxeZUo5ZaU5+uEjPkHrsf9MXsdYCrJJsJQkURwhSVncCNa7LP0vzYr92UOegHBtNmVPLw9a6XkcD o3KC9Pee9Zc2Lybp9BgqGf6WIq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:MWHPR12MB1152; BCL:0; PCL:0; RULEID:; SRVR:MWHPR12MB1152; X-Forefront-PRVS: 00429279BA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(19580405001)(19580395003)(53416004)(86362001)(97746001)(575784001)(4326007)(7736002)(42186005)(8676002)(5660300001)(2950100001)(68736007)(83506001)(69596002)(305945005)(7846002)(2906002)(81166006)(81156014)(54356999)(230700001)(105586002)(76176999)(50986999)(50466002)(66066001)(47776003)(33646002)(101416001)(586003)(7416002)(3846002)(97736004)(189998001)(2201001)(5001770100001)(92566002)(9686002)(6116002)(77096005)(103116003)(229853001)(4001350100001)(1076002)(23676002)(106356001)(71626007)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1152; H:tlendack-t1.amdoffice.net; 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: =?utf-8?B?MTtNV0hQUjEyTUIxMTUyOzIzOlZoZE1zOHhuMFcwUXM1ckpPeXZ2bjlPeEFL?= =?utf-8?B?U3VlUEVMaVdBTm0xY1JDUXFUYkFLN01FMkE0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lnXm1N4E6+qGFRSnAVWvwFZhEbEszBX5eIGHzsz7XbyzEFXZnMINQw7EmofQKlHYvEod3bbirwvRm9o+kpTcTpEw32M1pVs5bCN3Ltz050QVOqj0OFpt X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2016 22:36:38.5748 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1152 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When System Memory Encryption (SME) is enabled, the physical address space is reduced. Adjust the x86_phys_bits value to reflect this reduction. Signed-off-by: Tom Lendacky --- arch/x86/kernel/cpu/common.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index ce7a4c1..c0fe783 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -44,6 +44,7 @@ #include #include #include +#include #ifdef CONFIG_X86_LOCAL_APIC #include @@ -736,6 +737,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c) c->x86_virt_bits = (eax >> 8) & 0xff; c->x86_phys_bits = eax & 0xff; + c->x86_phys_bits -= sme_get_me_loss(); c->x86_capability[CPUID_8000_0008_EBX] = ebx; } #ifdef CONFIG_X86_32