Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753137AbdHISXD (ORCPT ); Wed, 9 Aug 2017 14:23:03 -0400 Received: from mail-cys01nam02on0083.outbound.protection.outlook.com ([104.47.37.83]:20448 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752389AbdHISSR (ORCPT ); Wed, 9 Aug 2017 14:18:17 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Subject: Re: [RFC Part1 PATCH v3 02/17] x86/CPU/AMD: Add the Secure Encrypted Virtualization CPU feature To: Borislav Petkov Cc: Brijesh Singh , linux-kernel@vger.kernel.org, x86@kernel.org, linux-efi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andy Lutomirski , Tony Luck , Piotr Luc , Fenghua Yu , Lu Baolu , Reza Arbab , David Howells , Matt Fleming , "Kirill A . Shutemov" , Laura Abbott , Ard Biesheuvel , Andrew Morton , Eric Biederman , Benjamin Herrenschmidt , Paul Mackerras , Konrad Rzeszutek Wilk , Jonathan Corbet , Dave Airlie , Kees Cook , Paolo Bonzini , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Arnd Bergmann , Tejun Heo , Christoph Lameter References: <20170724190757.11278-1-brijesh.singh@amd.com> <20170724190757.11278-3-brijesh.singh@amd.com> <20170725102657.GD21822@nazgul.tnic> <7236d267-ebcb-8b45-b8d3-5955903e395f@amd.com> <20170725143615.GA26029@nazgul.tnic> <47ccc32e-e113-48e0-d2e0-2f23b37cc452@amd.com> <20170725151301.GC26029@nazgul.tnic> <20170725153329.GE26029@nazgul.tnic> From: Tom Lendacky Message-ID: Date: Wed, 9 Aug 2017 13:17:54 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170725153329.GE26029@nazgul.tnic> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: MWHPR14CA0005.namprd14.prod.outlook.com (10.173.227.15) To BN6PR12MB1140.namprd12.prod.outlook.com (10.168.226.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a11d3d06-ced4-4043-169e-08d4df52fdd9 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR12MB1140; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1140;3:qkaUnzD9iULAZNXxsyfO4sZ4wzvbJpMgCKrh/KuiNh1LaWFGIZA2UWzdYsJ0Qq6ZJ6WqQbOSvXZRrHC/u2cVavNe+SqGcOE1UtRwX74tVGFUmGR4ub3Op6hdPaBRUjpMP93yT2s3yd4Gee1Wrs/dpVWM299Q6hPmDXeEUJfOaRyhgwQs+w8CO28EF6RoMVRzfycxyO+8FdjXBjM0LW34l+wA2YY79DjqoPHjY5355GWJIVh3F0Nr9aMNBEozUyle;25:8wu8ZyoonyfOFXo2mMDTCQE9J0KwlRRdy40IwRtCezD/zW9I3PKAZS2UTNdYZEh2n1LFpDB0jRm1BcF7tQMZkuUIypgeRpEdvp50jKESmiWNph03E/kt/O7vWXpnSgL7hnCiJlSW5dvwbuE8o67lXvAxQttEfIAP+72813zhgib3IDeNqn5Mf9QlWlrRnGQQJRy+KzcHxdApGXVg2kk7govmPRlw8eu12ar+uqVsImkluOCvyXme4I6E7zS6xB1JaRM+XoLQMqo+1Brk6q1Ptz05DJ6UMh+yz5RvYMvDEiP47b6tSVVi6qR9a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nl62Zr5OS8A8wJRjEpkf1GTnyP/2CL+3nx7u0knuuSmHyDW/HzSL9AxJSfEHdUx5JpPZMork= X-Exchange-Antispam-Report-Test: UriScan:(20558992708506); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR12MB1140;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR12MB1140; X-Forefront-PRVS: 0394259C80 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6049001)(6009001)(39410400002)(39840400002)(39850400002)(39450400003)(39400400002)(199003)(377454003)(189002)(24454002)(97736004)(72206003)(2950100002)(6116002)(6916009)(229853002)(31686004)(66066001)(65806001)(230700001)(2906002)(65956001)(90366009)(47776003)(6486002)(106356001)(65826007)(36756003)(31696002)(3846002)(53936002)(54356999)(6666003)(4001350100001)(76176999)(86362001)(77096006)(33646002)(105586002)(50986999)(42186005)(25786009)(7416002)(7406005)(64126003)(189998001)(5660300001)(23676002)(3260700006)(6246003)(81166006)(38730400002)(81156014)(110136004)(53546010)(8676002)(7350300001)(4326008)(68736007)(83506001)(478600001)(93886004)(101416001)(50466002)(305945005)(7736002)(54906002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1140;H:[10.236.64.250];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyT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dDVRm7HRDHECnkzYlKCYl2jRQ==;24:1NHvdKSrr306Q7Dmox2C30MvTWDCqvzQEEqxfDMhuuA/D/8zbPiycVKzzxApFeZ4mLz8OMfAHUevlR80809odgkuW9zkq42TK06tex2gD08=;7:lwFgFG/cCNpGgeV+4XTfFG3eivb4S5gmr9CfpxkVqqKV6FW/2ywJVFNUcpVVCCjS2DimmikxVlOf4mFaV4BkM8UabqbrXwp7YxjndIqfG5TTJN2gkQkZe651K8YEg6kmScrpj3EG5KyF85hMxpTSe+2boMcL8hVF43lOg8+n9wVxUEnPYShbq0vKYKtTCFvJ8E7RLL0lNwPnbk5Fxy7qd4iYUzVEtw22JkSb18gFaZo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1140;20:Tzk5hLmgwG849WXijWtATXFCretM3esGExPBVPKyBU1nghRdyJX/U53OEf+lzcN2VRvuUWH/wCC0xia+x/COvOXnOyIZAFLlxlDHxprvTx2zCDw5pqgJ/R/AY/DOLS5JxKB/I+MRVmXBR1a8tMztBUHzVc8InKUnWFISlg3bCnPjrAfRnv05i2Ca0xHP7zSeJQBqoQHp/cLgRH2PAkRRFEVb5qaa9gOPrcXXRlldrBChxZPkNabK6Ef2kZIuYs+v X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2017 18:18:04.8694 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1140 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 644 Lines: 22 On 7/25/2017 10:33 AM, Borislav Petkov wrote: > On Tue, Jul 25, 2017 at 10:29:40AM -0500, Tom Lendacky wrote: >> But early_identify_cpu() calls get_cpu_cap() which will check for cpuid >> leaf 0x80000008 support and set x86_phys_bits. > > Right, but it can't be less than 32, can it? And if it is more than 32 > bits, then it probably doesn't really matter on 32-bit. Unless it is > less than 36 bits and you do PAE... > >> I'll try to build and run a 32-bit kernel and see how this all flows. > > Yeah, that would be good. Ok, finally got around to running a 32-bit kernel and it reports x86_phys_bits as 48. Thanks, Tom > > Thanks. >