Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp264807lqb; Tue, 4 Jun 2024 10:34:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWSuMSDSgXIRuT8rAI8KUBVMppxXBNDKhidBJA96KDjL9APiHHOzXNf2++GIg21VQiZchGVWJB6jwqVtbftV9+5erMeRdCLSrINQLYD1g== X-Google-Smtp-Source: AGHT+IGgBTcGVXYOl4ut1k5q2PYNWZ64p0LEk+EnGW0qaPH0Ng0eClnEzIkq7T+zi+9QTmQtrc1d X-Received: by 2002:a05:620a:2a01:b0:792:ba44:7b23 with SMTP id af79cd13be357-79523fc626amr3899585a.67.1717522493995; Tue, 04 Jun 2024 10:34:53 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794fa906272si1058911185a.325.2024.06.04.10.34.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 10:34:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=neutral (bad format) header.i=@oracle.com; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=GjQqbSbF; arc=fail (signature failed); spf=pass (google.com: domain of linux-crypto+bounces-4698-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4698-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A2A81C219BA for ; Tue, 4 Jun 2024 17:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBAF914A0A7; Tue, 4 Jun 2024 17:34:40 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B80751494CB; Tue, 4 Jun 2024 17:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717522480; cv=fail; b=ldGnG2ow2qgbiM0OYCeN8ttzFuby/O5xuAuFAn38S2ENGu9/CXdgcItrZABI6YfOBnPfWRiulnR9JMo1aTDEWTJLuXkC9/hr9YYtuLOrOOuyKiyXYt31vInM4zOliJlYBzZEJ2bMG1RXCJp3QSNx79e1RM9ih5uFTTyw3c0NAgk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717522480; c=relaxed/simple; bh=y3VdBLuGCJa4+WxgNLZDrBzXPXcvTMII6zboeqxCR1E=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=jLfnVAz6y4NMlpkbzwUGFCp7Qa1aqcD1dmE2pH+FbwKleh8ejr64J1lLwDUXEws/1tKMy99uJQfIERNx8x+ihfUBAZMmTauEovwle8BY6iT25CnLbVGPkvDV1qoV3agBmb5wlwEnb2Uqvc2Y8cwRH/6I2RIFM7WCSYVp0p2jWeE= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 454Bn29D013802; Tue, 4 Jun 2024 17:34:03 GMT DKIM-Signature: =?UTF-8?Q?v=3D1;_a=3Drsa-sha256;_c=3Drelaxed/relaxed;_d=3Doracle.com;_h?= =?UTF-8?Q?=3Dcc:content-transfer-encoding:content-type:date:from:in-reply?= =?UTF-8?Q?-to:message-id:mime-version:references:subject:to;_s=3Dcorp-202?= =?UTF-8?Q?3-11-20;_bh=3DiwAAH+yaHWyAcVHtLfsMpkiMznlEaS/of0fT1gFUsnY=3D;_b?= =?UTF-8?Q?=3DEW4Q5hE+R/lWO7PSBegVLLQJjpWSlshZtlOhQ4kmM7uKapvsC2O9Oo10nwrw?= =?UTF-8?Q?DLamf3Bm_r6aNSuox8dHmck3HDBKsd6zkwbVT/53ycaWI3BT/pdpUhZZdNmbYyV?= =?UTF-8?Q?fcIQ1M+gq1OB0A_RrlYAFmE9qh1JMiwupqazVGJO+NATohwTxR+iydDzQAvNE/y?= =?UTF-8?Q?7RczMYOifZFDvW0CZtss_DKvNj4CHCYwHuLwVpZE/9zaEnJQYD0M13X78xwzF7p?= =?UTF-8?Q?aQ1OneiMk/ofxmJgSuMIiFqEoB_GPmdeZjeQaN69hruVxdxIZZZpCsP4thQIaLU?= =?UTF-8?Q?dLGBmYI61yuNTsUmnHNAbWkhviBgEiBY_pA=3D=3D_?= Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yfuwm5jac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:34:02 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 454HFp7c016446; Tue, 4 Jun 2024 17:34:02 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrsaesu0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 04 Jun 2024 17:34:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PlV0CxdGSYQE/j6zRX0mPAERuBG392+9Ra5VDFDQccvfls7tuhXqDcn/NqnvTPotxiUM+8madc9Miioqgsziryof0/VbF/QMbzTfcUQGtVzOtDyyPAECY6gJkYkSvjmbLkvAwLSbsUP0LCJgmxDUoVYZwCBPMa0AJlx/Z5YTcDnGciLe/xoLpacJAzT5G0+XZeBaUJzdIc2tMfpa2a4kDSPMBpBhOK5mTSBKMGUcnBbzdFHj1sHi3l0SGmbcNSWj/desrhkZW9Y2HTTXmI0O4wKY3VYKTFCSYJ8DzhG97jdHJL47yVMx/JuCiYBIrzAlVQETF0PypdCpxNZpmhYIEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iwAAH+yaHWyAcVHtLfsMpkiMznlEaS/of0fT1gFUsnY=; b=Dg3uBEzoUjQK3U4QnIFtK8SrocqktsocR4MJXVsfhCCtzWxn11YghpkLLskJu4Pp0QMJD+y1XoLdMDAMORJfsUTVPUFko+HocsHZosYRmSU8o7SIUWaEJ12XlmJI7ao6Rf/RMbvqmkiip+x07k2oNrZcj5LGays/+2l73rxYhaBFRG1+RyJb9CSprAjk1WS7cKI9oGc8VsUb6JOVVQsJxS2WNUaRiN5t+380dqhoSVeZiLqTgP48vwYAcOYMH44rffoD9K6ZknGnrY06uTXw//g/6pGTaAdnNamI+Fr6JNPtU95aXoruZW6pcAEkwaD7LKdWxA2CUoHtowyLqPNs9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iwAAH+yaHWyAcVHtLfsMpkiMznlEaS/of0fT1gFUsnY=; b=GjQqbSbFPiZ8j2LJ2YEIlYjMIXLDvy/RP53Rxv3nV/Euf/Ybm57eGVR6juTOLTBklp5dSh/L5XghixnFR8yh/q+AaM0yjMZlWWWais/0aL40NLrYJXDdcZPYU3zs8mSM7JmsX5QihuvgLGQSUb5FZub9R9Zq+Cd4u/rECv0Tyt4= Received: from DS0PR10MB7224.namprd10.prod.outlook.com (2603:10b6:8:f5::14) by MW5PR10MB5825.namprd10.prod.outlook.com (2603:10b6:303:19a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 17:33:58 +0000 Received: from DS0PR10MB7224.namprd10.prod.outlook.com ([fe80::c57:383f:cfb2:47f8]) by DS0PR10MB7224.namprd10.prod.outlook.com ([fe80::c57:383f:cfb2:47f8%6]) with mapi id 15.20.7633.021; Tue, 4 Jun 2024 17:33:58 +0000 Message-ID: <5b32106b-bb7b-463d-8b0b-589e3d466bf3@oracle.com> Date: Tue, 4 Jun 2024 10:33:54 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 08/19] x86: Secure Launch kernel early boot stub To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, iommu@lists.linux-foundation.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, mjg59@srcf.ucam.org, James.Bottomley@hansenpartnership.com, peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca, luto@amacapital.net, nivedita@alum.mit.edu, herbert@gondor.apana.org.au, davem@davemloft.net, corbet@lwn.net, ebiederm@xmission.com, dwmw2@infradead.org, baolu.lu@linux.intel.com, kanth.ghatraju@oracle.com, andrew.cooper3@citrix.com, trenchboot-devel@googlegroups.com, ross.philipson@oracle.com References: <20240531010331.134441-1-ross.philipson@oracle.com> <20240531010331.134441-9-ross.philipson@oracle.com> <5bffa507-75e8-4cce-ac0c-fe13d6efd3bb@oracle.com> Content-Language: en-US From: ross.philipson@oracle.com In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR02CA0022.namprd02.prod.outlook.com (2603:10b6:a02:ee::35) To DS0PR10MB7224.namprd10.prod.outlook.com (2603:10b6:8:f5::14) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB7224:EE_|MW5PR10MB5825:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d790ca2-fc61-481f-5051-08dc84bc83a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13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NK2hldDc5ZVpnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR10MB7224.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005)(7416005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L0xzSkJsQXNsV2FPZHJEVG5GOFRnNHIrWlIyR1BIMmk5QnlVVDNSQkZNdnBu?= =?utf-8?B?dVVydXduRDlpanhwL0pzK1B0a0w0YUNBZWQ0WllRS3FZT1daVm5VaHZFUTcx?= =?utf-8?B?UU43NmVOYy9aRGFYK0tpZWJtRHN6SFNEMkZCZ3lTSE1OUzNBM0xVRVcwZkgr?= =?utf-8?B?bEpzRlFQc2E4aFBneGlrciswYzZENFpRZ1lkOWhoeUNOOHJOYlNXd3dCZXhk?= =?utf-8?B?Wk5xTmk4a3psSWxwdHpYMXU4Z1Bjb2grS1lwdWxFVkYxSkZnREVmV2F5YkZD?= =?utf-8?B?UGd1MEM0NGovOGpOYkZmWVd4TDc0ZTJOYTE4ZEpSMWJ2NnhvZjI0ajEyNndt?= =?utf-8?B?dFVjcTZienVlZkhTN09sTmpaWWpSTWVGVkk5TTN3R2lYTWFSV3BOc3dqakNx?= =?utf-8?B?dXhhcktkR3NlREgvR01nZzF5MUxnUEVlSUgwNmdmQXRtUXA5M1hvZkR0eFlO?= =?utf-8?B?MVZGZ1cxTlorV05MNm93c1R6b1lRYWZYaVgrWjg5SkZsMzE4Qk00RzlKZFFm?= =?utf-8?B?Z0lIUTJ5eFg5MzREaFBMcUxmM3hYVXNET0ZxaEtROUxmT3IrY2lGMGo2UERk?= =?utf-8?B?R1dJbmx0NEFBZmg0NGxhdkV0U0laRzFUb2hzdzQyRWE0Qjg1V29IdzVPNGVy?= =?utf-8?B?RWxNK2FCd0xRZjFWR1ZsR3RXO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Pt4uaf+OXnsRTQAjgRMOHupZ/Owx7WxxkRZO29dNTRoI2XHrcTfK+rG7cyjmEcY/6TNat3FU2gdNEVyS3BSZom9uZZxtW+CN5+WGAGpIN7KBI2rt8Ggewr14EKmCkHWGNWjcpbXC7LpCVNx9xO9cT7+juEO6QzsFv1Ajme4LBc9hjvQaLNooXBjGo3Jz9paQZidEZicWRvwMd2r4bR8Xe/o3EvbsDrYjgQgFmbunsaWjfaC252GqJ7GWABRxc2GPjxjqtx1te/9n6hYbfymbxNlsZpeK545RfHqZBPCuZkRMkTvGXPhsUXT30SbcOmAobY0aIWLEPX6IChXraepgnTTpTFPsPTQWLqtMDVKmzjqQSA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d790ca2-fc61-481f-5051-08dc84bc83a4 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB7224.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 17:33:57.8598 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AFi2ySnDs9URxEP1TlEenz2JixeEM2ExvF7FaIzZLxxZyO3U4qT5xn6Oy4Yvyf69a3Sf1BKWqxqhTCIB/fuvuAkCbGWHkbidfwRuCNX0uMg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR10MB5825 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-04_09,2024-06-04_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406040141 X-Proofpoint-GUID: 2jeY6i5kTd45XkiGhbifNwZU3zfTi2Ih X-Proofpoint-ORIG-GUID: 2jeY6i5kTd45XkiGhbifNwZU3zfTi2Ih On 6/4/24 10:27 AM, Ard Biesheuvel wrote: > On Tue, 4 Jun 2024 at 19:24, wrote: >> >> On 5/31/24 6:33 AM, Ard Biesheuvel wrote: >>> On Fri, 31 May 2024 at 13:00, Ard Biesheuvel wrote: >>>> >>>> Hello Ross, >>>> >>>> On Fri, 31 May 2024 at 03:32, Ross Philipson wrote: >>>>> >>>>> The Secure Launch (SL) stub provides the entry point for Intel TXT (and >>>>> later AMD SKINIT) to vector to during the late launch. The symbol >>>>> sl_stub_entry is that entry point and its offset into the kernel is >>>>> conveyed to the launching code using the MLE (Measured Launch >>>>> Environment) header in the structure named mle_header. The offset of the >>>>> MLE header is set in the kernel_info. The routine sl_stub contains the >>>>> very early late launch setup code responsible for setting up the basic >>>>> environment to allow the normal kernel startup_32 code to proceed. It is >>>>> also responsible for properly waking and handling the APs on Intel >>>>> platforms. The routine sl_main which runs after entering 64b mode is >>>>> responsible for measuring configuration and module information before >>>>> it is used like the boot params, the kernel command line, the TXT heap, >>>>> an external initramfs, etc. >>>>> >>>>> Signed-off-by: Ross Philipson >>>>> --- >>>>> Documentation/arch/x86/boot.rst | 21 + >>>>> arch/x86/boot/compressed/Makefile | 3 +- >>>>> arch/x86/boot/compressed/head_64.S | 30 + >>>>> arch/x86/boot/compressed/kernel_info.S | 34 ++ >>>>> arch/x86/boot/compressed/sl_main.c | 577 ++++++++++++++++++++ >>>>> arch/x86/boot/compressed/sl_stub.S | 725 +++++++++++++++++++++++++ >>>>> arch/x86/include/asm/msr-index.h | 5 + >>>>> arch/x86/include/uapi/asm/bootparam.h | 1 + >>>>> arch/x86/kernel/asm-offsets.c | 20 + >>>>> 9 files changed, 1415 insertions(+), 1 deletion(-) >>>>> create mode 100644 arch/x86/boot/compressed/sl_main.c >>>>> create mode 100644 arch/x86/boot/compressed/sl_stub.S >>>>> >>>>> diff --git a/Documentation/arch/x86/boot.rst b/Documentation/arch/x86/boot.rst >>>>> index 4fd492cb4970..295cdf9bcbdb 100644 >>>>> --- a/Documentation/arch/x86/boot.rst >>>>> +++ b/Documentation/arch/x86/boot.rst >>>>> @@ -482,6 +482,14 @@ Protocol: 2.00+ >>>>> - If 1, KASLR enabled. >>>>> - If 0, KASLR disabled. >>>>> >>>>> + Bit 2 (kernel internal): SLAUNCH_FLAG >>>>> + >>>>> + - Used internally by the setup kernel to communicate >>>>> + Secure Launch status to kernel proper. >>>>> + >>>>> + - If 1, Secure Launch enabled. >>>>> + - If 0, Secure Launch disabled. >>>>> + >>>>> Bit 5 (write): QUIET_FLAG >>>>> >>>>> - If 0, print early messages. >>>>> @@ -1028,6 +1036,19 @@ Offset/size: 0x000c/4 >>>>> >>>>> This field contains maximal allowed type for setup_data and setup_indirect structs. >>>>> >>>>> +============ ================= >>>>> +Field name: mle_header_offset >>>>> +Offset/size: 0x0010/4 >>>>> +============ ================= >>>>> + >>>>> + This field contains the offset to the Secure Launch Measured Launch Environment >>>>> + (MLE) header. This offset is used to locate information needed during a secure >>>>> + late launch using Intel TXT. If the offset is zero, the kernel does not have >>>>> + Secure Launch capabilities. The MLE entry point is called from TXT on the BSP >>>>> + following a success measured launch. The specific state of the processors is >>>>> + outlined in the TXT Software Development Guide, the latest can be found here: >>>>> + https://urldefense.com/v3/__https://www.intel.com/content/dam/www/public/us/en/documents/guides/intel-txt-software-development-guide.pdf__;!!ACWV5N9M2RV99hQ!Mng0gnPhOYZ8D02t1rYwQfY6U3uWaypJyd1T2rsWz3QNHr9GhIZ9ANB_-cgPExxX0e0KmCpda-3VX8Fj$ >>>>> + >>>>> >>>> >>>> Could we just repaint this field as the offset relative to the start >>>> of kernel_info rather than relative to the start of the image? That >>>> way, there is no need for patch #1, and given that the consumer of >>>> this field accesses it via kernel_info, I wouldn't expect any issues >>>> in applying this offset to obtain the actual address. >>>> >>>> >>>>> The Image Checksum >>>>> ================== >>>>> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile >>>>> index 9189a0e28686..9076a248d4b4 100644 >>>>> --- a/arch/x86/boot/compressed/Makefile >>>>> +++ b/arch/x86/boot/compressed/Makefile >>>>> @@ -118,7 +118,8 @@ vmlinux-objs-$(CONFIG_EFI) += $(obj)/efi.o >>>>> vmlinux-objs-$(CONFIG_EFI_MIXED) += $(obj)/efi_mixed.o >>>>> vmlinux-objs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a >>>>> >>>>> -vmlinux-objs-$(CONFIG_SECURE_LAUNCH) += $(obj)/early_sha1.o $(obj)/early_sha256.o >>>>> +vmlinux-objs-$(CONFIG_SECURE_LAUNCH) += $(obj)/early_sha1.o $(obj)/early_sha256.o \ >>>>> + $(obj)/sl_main.o $(obj)/sl_stub.o >>>>> >>>>> $(obj)/vmlinux: $(vmlinux-objs-y) FORCE >>>>> $(call if_changed,ld) >>>>> diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S >>>>> index 1dcb794c5479..803c9e2e6d85 100644 >>>>> --- a/arch/x86/boot/compressed/head_64.S >>>>> +++ b/arch/x86/boot/compressed/head_64.S >>>>> @@ -420,6 +420,13 @@ SYM_CODE_START(startup_64) >>>>> pushq $0 >>>>> popfq >>>>> >>>>> +#ifdef CONFIG_SECURE_LAUNCH >>>>> + /* Ensure the relocation region is coverd by a PMR */ >>>> >>>> covered >>>> >>>>> + movq %rbx, %rdi >>>>> + movl $(_bss - startup_32), %esi >>>>> + callq sl_check_region >>>>> +#endif >>>>> + >>>>> /* >>>>> * Copy the compressed kernel to the end of our buffer >>>>> * where decompression in place becomes safe. >>>>> @@ -462,6 +469,29 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated) >>>>> shrq $3, %rcx >>>>> rep stosq >>>>> >>>>> +#ifdef CONFIG_SECURE_LAUNCH >>>>> + /* >>>>> + * Have to do the final early sl stub work in 64b area. >>>>> + * >>>>> + * *********** NOTE *********** >>>>> + * >>>>> + * Several boot params get used before we get a chance to measure >>>>> + * them in this call. This is a known issue and we currently don't >>>>> + * have a solution. The scratch field doesn't matter. There is no >>>>> + * obvious way to do anything about the use of kernel_alignment or >>>>> + * init_size though these seem low risk with all the PMR and overlap >>>>> + * checks in place. >>>>> + */ >>>>> + movq %r15, %rdi >>>>> + callq sl_main >>>>> + >>>>> + /* Ensure the decompression location is covered by a PMR */ >>>>> + movq %rbp, %rdi >>>>> + movq output_len(%rip), %rsi >>>>> + callq sl_check_region >>>>> +#endif >>>>> + >>>>> + pushq %rsi >>>> >>>> This looks like a rebase error. >>>> >>>>> call load_stage2_idt >>>>> >>>>> /* Pass boot_params to initialize_identity_maps() */ >>>>> diff --git a/arch/x86/boot/compressed/kernel_info.S b/arch/x86/boot/compressed/kernel_info.S >>>>> index c18f07181dd5..e199b87764e9 100644 >>>>> --- a/arch/x86/boot/compressed/kernel_info.S >>>>> +++ b/arch/x86/boot/compressed/kernel_info.S >>>>> @@ -28,6 +28,40 @@ SYM_DATA_START(kernel_info) >>>>> /* Maximal allowed type for setup_data and setup_indirect structs. */ >>>>> .long SETUP_TYPE_MAX >>>>> >>>>> + /* Offset to the MLE header structure */ >>>>> +#if IS_ENABLED(CONFIG_SECURE_LAUNCH) >>>>> + .long rva(mle_header) >>>> >>>> ... so this could just be mle_header - kernel_info, and the consumer >>>> can do the math instead. >>>> >>>>> +#else >>>>> + .long 0 >>>>> +#endif >>>>> + >>>>> kernel_info_var_len_data: >>>>> /* Empty for time being... */ >>>>> SYM_DATA_END_LABEL(kernel_info, SYM_L_LOCAL, kernel_info_end) >>>>> + >>>>> +#if IS_ENABLED(CONFIG_SECURE_LAUNCH) >>>>> + /* >>>>> + * The MLE Header per the TXT Specification, section 2.1 >>>>> + * MLE capabilities, see table 4. Capabilities set: >>>>> + * bit 0: Support for GETSEC[WAKEUP] for RLP wakeup >>>>> + * bit 1: Support for RLP wakeup using MONITOR address >>>>> + * bit 2: The ECX register will contain the pointer to the MLE page table >>>>> + * bit 5: TPM 1.2 family: Details/authorities PCR usage support >>>>> + * bit 9: Supported format of TPM 2.0 event log - TCG compliant >>>>> + */ >>>>> +SYM_DATA_START(mle_header) >>>>> + .long 0x9082ac5a /* UUID0 */ >>>>> + .long 0x74a7476f /* UUID1 */ >>>>> + .long 0xa2555c0f /* UUID2 */ >>>>> + .long 0x42b651cb /* UUID3 */ >>>>> + .long 0x00000034 /* MLE header size */ >>>>> + .long 0x00020002 /* MLE version 2.2 */ >>>>> + .long rva(sl_stub_entry) /* Linear entry point of MLE (virt. address) */ >>>> >>>> and these should perhaps be relative to mle_header? >>>> >>>>> + .long 0x00000000 /* First valid page of MLE */ >>>>> + .long 0x00000000 /* Offset within binary of first byte of MLE */ >>>>> + .long rva(_edata) /* Offset within binary of last byte + 1 of MLE */ >>>> >>>> and here >>>> >>> >>> Ugh never mind - these are specified externally. >> >> Can you clarify your follow on comment here? >> > > I noticed that -as you pointed out in your previous reply- these > fields cannot be repainted at will, as they are defined by an external > specification. > > I'll play a bit more with this code tomorrow - I would *really* like > to avoid the need for patch #1, as it adds another constraint on how > we construct the boot image, and this is already riddled with legacy > and other complications. Yea I should have read forward through all your replies before responding to the first one but I think it clarified things as you point out here. We appreciate you help and suggestions. Ross