Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CD6C4332F for ; Fri, 10 Dec 2021 20:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344206AbhLJUel (ORCPT ); Fri, 10 Dec 2021 15:34:41 -0500 Received: from mga04.intel.com ([192.55.52.120]:46752 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344184AbhLJUek (ORCPT ); Fri, 10 Dec 2021 15:34:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1639168265; x=1670704265; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=/TxMjglwcIrbFMUfkDQBobQZc4R/Xxx3e0Ioikv42jk=; b=X1k/GZkKv+ASuekq52W/jGnW/T8/tG9IGSzSHIkAzj8ezVDyOIg6uIGM JieuxCP+S0FNLYjlYlCV/s4KQAAtDqyEceUVY+y6itouisauC5mOlyfLd gXRaMP7NlgxUp6/3YOVGsH57SI3ZgigHzIR+k08Rpn8TlJpOe+k/WOPlT gRdnxYzYw1rD8JfBHCLAcwUr5aiQxamIM/lz8MBnnvPmGsbFkJjK7ky3h Xo/vTagFIsxZLgMEBhi/L9wShd4nk3jM2m0RI0CKAk3nwbWJOkjNvHPsT +Yc1/ikIhJw4/PkRCI9f6SsrL9mI28rA+ueVWOvRh/x56ZcxDxAIB/Ztv g==; X-IronPort-AV: E=McAfee;i="6200,9189,10194"; a="237173377" X-IronPort-AV: E=Sophos;i="5.88,196,1635231600"; d="scan'208";a="237173377" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 12:31:03 -0800 X-IronPort-AV: E=Sophos;i="5.88,196,1635231600"; d="scan'208";a="607628736" Received: from klarson-mobl.amr.corp.intel.com (HELO [10.251.16.229]) ([10.251.16.229]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 12:31:01 -0800 Subject: Re: [PATCH v8 27/40] x86/boot: Add Confidential Computing type to setup_data To: Brijesh Singh , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org Cc: Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Borislav Petkov , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , "Dr . David Alan Gilbert" , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com References: <20211210154332.11526-1-brijesh.singh@amd.com> <20211210154332.11526-28-brijesh.singh@amd.com> <1fdaca61-884a-ac13-fb33-a47db198f050@intel.com> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5IuYsSwAeZGkdQ5g6m1xq7AlDJQZddhr/1DC/nMVa/2BoY 2UnKuZuSBu7lgOE193+7Uks3416N2hTkyKUSNkduyoZ9F5twiBhxPJwPtn/wnch6n5RsoXsb ygOEDxLEsSk/7eyFycjE+btUtAWZtx+HseyaGfqkZK0Z9bT1lsaHecmB203xShwCPT49Blxz VOab8668QpaEOd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AAlT YZ14P0dIPdIPIlfEPiAWcg5BtLQU4Wg3cNQdpWrCJ1E3m/RIlXy/2Y3YOVVohfSy+4kvvYU3 lXUdPb04UPw4VWwjcVZPg7cgR7Izion61bGHqVqURgSALt2yvHl7cr68NYoFkzbNsGsye9ft M9ozM23JSgMkRylPSXTeh5JIK9pz2+etco3AfLCKtaRVysjvpysukmWMTrx8QnI5Nn5MOlJj 1Ov4/50JY9pXzgIDVSrgy6LYSMc4vKZ3QfCY7ipLRORyalFDF3j5AGCMRENJjHPD6O7bl3Xo 4DzMID+8eucbXxKiNEbs21IqBZbbKdY1GkcEGTE7AnkA3Y6YB7I/j9mQ3hCgm5muJuhM/2Fr OPsw5tV/LmQ5GXH0JQ/TZXWygyRFyyI2FqNTx4WHqUn3yFj8rwTAU1tluRUYyeLy0ayUlKBH ybj0N71vWO936MqP6haFERzuPAIpxj2ezwu0xb1GjTk4ynna6h5GjnKgdfOWoRtoWndMZxbA z5cecg== Message-ID: <2a5cfbd0-865c-2a8b-b70b-f8f64aba5575@intel.com> Date: Fri, 10 Dec 2021 12:30:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/10/21 12:18 PM, Brijesh Singh wrote: > On 12/10/21 1:12 PM, Dave Hansen wrote: >> On 12/10/21 7:43 AM, Brijesh Singh wrote: >>> +/* AMD SEV Confidential computing blob structure */ >>> +#define CC_BLOB_SEV_HDR_MAGIC 0x45444d41 >>> +struct cc_blob_sev_info { >>> + u32 magic; >>> + u16 version; >>> + u16 reserved; >>> + u64 secrets_phys; >>> + u32 secrets_len; >>> + u64 cpuid_phys; >>> + u32 cpuid_len; >>> +}; >> This is an ABI structure rather than some purely kernel construct, right? > > This is ABI between the guest BIOS and Guest OS. It is defined in the OVMF. > > https://github.com/tianocore/edk2/blob/master/OvmfPkg/Include/Guid/ConfidentialComputingSevSnpBlob.h > > SEV-SNP FW spec does not have it documented; it's up to the guest BIOS > on how it wants to communicate the Secrets and CPUID page location to > guest OS. Well, no matter where it is defined, could we please make it a bit easier for folks to find it in the future? >> I searched through all of the specs to which you linked in the cover >> letter. I looked for "blob", "guid", the magic and part of the GUID >> itself trying to find where this is defined to see if the struct is correct. >> >> I couldn't find anything. >> >> Where is the spec for this blob? How large is it? Did you mean to >> leave a 4-byte hole after secrets_len and before cpuid_phys? > Yes, the length is never going to be > 4GB. I was more concerned that this structure could change sizes if it were compiled on 32-bit versus 64-bit code. For kernel ABIs, we try not to do that. Is this somehow OK when talking to firmware? Or can a 32-bit OS and 64-bit firmware never interact?