Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1320012rwr; Fri, 5 May 2023 12:12:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UPXnr2FiyG2UZ0yOaYGLe3n8IBmvNl17mkwDE3EWlij8cw0GgBgj2mqiLGZN7QmRIMz3R X-Received: by 2002:a05:6a21:7886:b0:ec:88e1:1452 with SMTP id bf6-20020a056a21788600b000ec88e11452mr2934491pzc.62.1683313941439; Fri, 05 May 2023 12:12:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683313941; cv=pass; d=google.com; s=arc-20160816; b=xxSK+TU0s9Ehgp2ts2WFgl6Pvm2UJBmQDFbiA8p1CwLE9TYrkZ4+V9JjUtH+II+dMC EL6HBHNzM8jL0m2YCYqRECc6V/0rIXvr3t1GjH/5aBg0s7SVty0eQpaJvqhpZakRXVFf GME4DihL4BmVXs0WRtJlzpYOjgeeTx2A0fqQq7tK5YYmBUe+LX1qq+CE6ZfEgtfqtFhu Nbd/w+Jfw2RB9X6miIDms2twO69cPw41Ro/HIhO5yxPdFVD0HG/1+whKfQfW2sUsVKkS +MSp9IJrsVpfqgMUr4LW/maGkPziDcXceA/OBpn8Y1GSreCfNt8z5RTZQBWh4zbHkJco vm5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=hov1Zo1lnPY6atYbUmrFa5EKgki3mIk0ZVqrusDVusk=; b=k0Fm/gDwVDDmW3KF60litva6rCuRHAQ1qSlgJpp07zNmkoF/gKi/76aO9x1FkAhbGg taI/NgnmwN4bJwrYpEP8vYAjHL9wxKJVFJGcRQnZaPuwqbD6kwx3S/+dj9VNXFUUzkUL HkJpC3FTdbkBCkewGsfMzgzHopFc0rc6HHDyJBBKhVcDCpzKySu+LZjgQmSUwvMelg2c rY2ikmklEs7XY4xJK1qtHzazJ5Rna4Yc9RE943Bo4GyFmgu7cuEzUgnEEe4wZDeKSMkk 12sTa4fXGmx6TrVIJAdQILlGk0uGlEITTrYcrhuegNxAz2ajtrQNoMbHE6NZ0aYf9Pqt oJeg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="rs/uDbFY"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jYtgB9SF; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x27-20020a63b21b000000b0051a8a22a43csi2578879pge.450.2023.05.05.12.12.02; Fri, 05 May 2023 12:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="rs/uDbFY"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=jYtgB9SF; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233034AbjEETAh (ORCPT + 99 others); Fri, 5 May 2023 15:00:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233040AbjEETAg (ORCPT ); Fri, 5 May 2023 15:00:36 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B31A12154D; Fri, 5 May 2023 12:00:24 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 345HhQ5G006361; Fri, 5 May 2023 18:59:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=hov1Zo1lnPY6atYbUmrFa5EKgki3mIk0ZVqrusDVusk=; b=rs/uDbFYsE/NTeaGMPiiTCv1Xnch/CJ85Z3WW8lJDXmkNeUNPepWwNYTvEf9+lMpKXYJ Gaowi35FG+IWJhwuiMFoL3oSNWLp83W3zlptodOOd/T3kaeGw2nrKYf9FoH0VmLenrYM TfIxCVTzrvP5squahRIEyCblYTFb5gfIaZil96P/GZDe3pXzUhg25hmP62EGyuXTBYjl LpO8AigQnYGkyreJCM/GYOV8pRCRA3M1ARonVjIUzEm/JHHmLOnueLx+6CkJv4VS/t0F xcJtAd/FJ0vCVA7Vnb1RIa7G+tWkrfUynKpKgo/Fp0FG+guaUuxB7QpQbidJqivU8zaa 1g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3q8u4awe51-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 May 2023 18:59:32 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 345HVOkU009977; Fri, 5 May 2023 18:59:31 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3q8spar1f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 05 May 2023 18:59:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oD0ii5d1mxlbvSMLgbG/AM8JvOHwvY5ryPnpMJbJ36TqrAWRHycbOG0CtLTY/rJR9LOuraJ1jzCccmBbD2QV9o7Qg7UILGlZh8xTmIohWq/pbjt83+h+erQKTtBitMTMIK043kgq2r6ZQYKdvSB2EHvqOPeHhS2v3pviIOAHSrshas9UcGPm/Dm3dcm4P6oecGU5rBgrC/xpnuoPCyidzmAiAp5+Ke9wHjRykI2xwhafMwMnnDaJXK9F2O1dIYlPoOT+BKd/PuX7tDWoLpEtBzOqvRpR8uOsmXYymzp5oRF3VI8XmG3Je4Jw1uty38R21yL8GFpYgNFLweqWsbXVkw== 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=hov1Zo1lnPY6atYbUmrFa5EKgki3mIk0ZVqrusDVusk=; b=H8SGsqmI8WhbYy0wrN+kdM+4S8Npw7Qf8yjg/vpkrbTESnY4rDvvtW9sdskrPrJwKhnruXzuLpqkJBMXuvU12Xgacb+TPk0TQ22cJUCEwItYOwAMZCXPhdF9Mnu0FvaZH1fULbfrW8tpkwf53Hb9Op1nXL7fhmiwtzZlDe7gLdGyU3YJuZfPXXjd2iQIhk3mfce2kTahQN+BdlUd09Z5tfIM5ussZCNLk7DEAh7+gKVA96wuUKIz2F2HOl5v2o4nWpV5S9B/PSG700NMv7AOFoaLF/EKduE3m9nrOVwdlSH7xyGsYpVd5hAdMx5dh+4zGDPI8tltMVPTgY/HIgongw== 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=hov1Zo1lnPY6atYbUmrFa5EKgki3mIk0ZVqrusDVusk=; b=jYtgB9SFGbP8H1qr6HAH6RfCEAWJ4210Z1CCHHfeHQ00vc+SffWdvRworEs+41AJBHlhrBbQXTdws24kenbWlC5l98dG2obQUW/dvNB1WT0clBTmM89V+PK5lgG/Sd2UswDjp3SmTQO6x6Tn3N6kGd0KxvSXEjM5HZbPVA6RsvY= Received: from BY5PR10MB3793.namprd10.prod.outlook.com (2603:10b6:a03:1f6::14) by PH8PR10MB6528.namprd10.prod.outlook.com (2603:10b6:510:228::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Fri, 5 May 2023 18:59:28 +0000 Received: from BY5PR10MB3793.namprd10.prod.outlook.com ([fe80::a007:b0c1:5cb:329a]) by BY5PR10MB3793.namprd10.prod.outlook.com ([fe80::a007:b0c1:5cb:329a%5]) with mapi id 15.20.6363.026; Fri, 5 May 2023 18:59:28 +0000 Message-ID: <12e91cad-340c-cf90-ab10-16b099bb254f@oracle.com> Date: Fri, 5 May 2023 14:59:24 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v6 08/14] x86: Secure Launch kernel late boot stub Content-Language: en-US To: Simon Horman Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-integrity@vger.kernel.org, linux-doc@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kexec@lists.infradead.org, linux-efi@vger.kernel.org, dpsmith@apertussolutions.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, ardb@kernel.org, mjg59@srcf.ucam.org, James.Bottomley@hansenpartnership.com, luto@amacapital.net, nivedita@alum.mit.edu, kanth.ghatraju@oracle.com, trenchboot-devel@googlegroups.com References: <20230504145023.835096-1-ross.philipson@oracle.com> <20230504145023.835096-9-ross.philipson@oracle.com> From: Ross Philipson In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR10CA0007.namprd10.prod.outlook.com (2603:10b6:610:4c::17) To BY5PR10MB3793.namprd10.prod.outlook.com (2603:10b6:a03:1f6::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB3793:EE_|PH8PR10MB6528:EE_ X-MS-Office365-Filtering-Correlation-Id: bcf74abc-6207-4cac-c8f3-08db4d9ada22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gh/KGENgzHzIzimH7KV082qPHdd10GSplup/3iQ/RemcXAqVgpTu/58TyKn3Uj/z25lMjhIP1O6bayvRIoavqmElZCbWm5xEMfD6KFJ8QhRlJ81IfkwCWYLgl0HRNBjzyH35rtqXFFq2qJkz+5JasYEgIHXgrkxjV6MAbe7TU0GM12YZ0H3KVGOoYBkQraKp0q4jdOY3sZOMHVb0t5gNawaiPYZtmjlWXGlI+3VC1dRGxEqkRbSGFiaLsmCbQMISPuL7FyxzUerj7XSF1DcoanVc7zSr/vOMoDPSwUACoNk9jlyVabka2X47g/CCkIxaN4vB4SMvApEGX0xS+kBObjBgchPyu8nd26UkChVm91Rg2T10I3PYlXbFGk0tmenVFsC0MpmDcwVgtW2iFGr7qmSHC9DmNYlE9Ym79m7rk6EuDl4jKqeu9zEpiISYx12G09aKlek67vxWj0rZ9ouJAceY82S4RAROA3bIJqRzB21EAGAHZXmEfJLKQx/o74dpF6Cr2oRLtCGR5C+xf0gp6XWXBvRKFyzPUQEcfJ+GZIg1qXBsMqFRsh+GQwEb/FE9hpXpaLHXtTWlcuALs/I6IJ1UVUBfbjpfpCtyFLD5vYeKOaow0c8iJJpzuw+X8bnH4hulWfvPXk3s34I6WXjA1A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB3793.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(376002)(136003)(396003)(366004)(39860400002)(451199021)(2906002)(6916009)(8936002)(66556008)(66946007)(8676002)(316002)(4326008)(66476007)(31686004)(41300700001)(478600001)(7416002)(44832011)(6486002)(6666004)(6512007)(83380400001)(5660300002)(53546011)(6506007)(186003)(2616005)(36756003)(86362001)(31696002)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SVUvcjZnVkxhZ05qR3NUckJjbXBPRmV2WkZRWjU4Mjc5WlZoTWZFVjA1dEhX?= =?utf-8?B?OVlYTGVCbVdMWnovUEVyZ3J5ZzR2TW9ScHBQVTgrc2x5WmFFOERRMy9jaHVr?= =?utf-8?B?WEI5UHl1RnhURXdQQWsvWTladjFsVWRXUHNkKytjZmtIbG4rb0NybEtpN2l0?= =?utf-8?B?V1hubDVkMTB2K2JiSjJ0VUlVSWpwTTVEWlc2V01mMmNRcDdDeWY0Vzd1bDl3?= =?utf-8?B?RC96ckR2d3p4OTludzh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BLQkNscDJjemkyRVE5R3RHbCtlRXNZOFZ2T3BXUC9RV0ZOeHk4UjY2?= =?utf-8?B?T1FCRVM2dWxXNW1ndFRDV2NJc1VScWFsdkJOMy9tc3JyR1NUZjVXSmVuWkRX?= =?utf-8?B?VHZEc3RtaElRSkF6SUVJKzdSVlg0UE0yNS9udURlOGYvMTJmOHRPNFNqbVp3?= =?utf-8?Q?QnabJinHvUE42HsZAs=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcf74abc-6207-4cac-c8f3-08db4d9ada22 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB3793.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 18:59:28.5183 (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: e1+lRPm9qGjLkF/roGwrBb5REdCK5JC2i7zx6y3oqob0FVU3jCx2/93E3NxlrnZdhcuYYFaoBrGy+d0vYHnYplZVoP3o0zxGXDl7ATXQhuo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR10MB6528 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-05_25,2023-05-05_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305050156 X-Proofpoint-GUID: HcDV2fjBMqNXuqLCEyHslCsOUo_qow11 X-Proofpoint-ORIG-GUID: HcDV2fjBMqNXuqLCEyHslCsOUo_qow11 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 5/5/23 13:52, Simon Horman wrote: > On Thu, May 04, 2023 at 02:50:17PM +0000, Ross Philipson wrote: >> The routine slaunch_setup is called out of the x86 specific setup_arch >> routine during early kernel boot. After determining what platform is >> present, various operations specific to that platform occur. This >> includes finalizing setting for the platform late launch and verifying >> that memory protections are in place. >> >> For TXT, this code also reserves the original compressed kernel setup >> area where the APs were left looping so that this memory cannot be used. >> >> Signed-off-by: Ross Philipson > > Hi Ross, > > a few nits from my side. Yup we will fix all of those. Thanks Ross > >> +/* >> + * The TXT heap is too big to map all at once with early_ioremap >> + * so it is done a table at a time. >> + */ >> +static void __init *txt_early_get_heap_table(void __iomem *txt, u32 type, >> + u32 bytes) >> +{ >> + u64 base, size, offset = 0; >> + void *heap; >> + int i; >> + >> + if (type > TXT_SINIT_TABLE_MAX) >> + slaunch_txt_reset(txt, >> + "Error invalid table type for early heap walk\n", >> + SL_ERROR_HEAP_WALK); > > nit: the indentation should align to the opening '('. > > slaunch_txt_reset(txt, > "Error invalid table type for early heap walk\n", > SL_ERROR_HEAP_WALK); > > Likewise in a few other places in this patch. > > ... > >> +static void __init slaunch_txt_reserve_range(u64 base, u64 size) >> +{ >> + int type; >> + >> + type = e820__get_entry_type(base, base + size - 1); >> + if (type == E820_TYPE_RAM) { >> + pr_info("memblock reserve base: %llx size: %llx\n", base, size); >> + memblock_reserve(base, size); >> + } >> +} >> + >> +/* >> + * For Intel, certain regions of memory must be marked as reserved by putting >> + * them on the memblock reserved list if they are not already e820 reserved. >> + * This includes: >> + * - The TXT HEAP >> + * - The ACM area >> + * - The TXT private register bank >> + * - The MDR list sent to the MLE by the ACM (see TXT specification) >> + * (Normally the above are properly reserved by firmware but if it was not >> + * done, reserve them now) >> + * - The AP wake block >> + * - TPM log external to the TXT heap >> + * >> + * Also if the low PMR doesn't cover all memory < 4G, any RAM regions above >> + * the low PMR must be reservered too. > > nit: s/reservered/reserved/ > >> + */ >> +static void __init slaunch_txt_reserve(void __iomem *txt) >> +{ >> + struct txt_sinit_memory_descriptor_record *mdr; >> + struct txt_sinit_mle_data *sinit_mle_data; >> + u64 base, size, heap_base, heap_size; >> + u32 mdrnum, mdroffset, mdrslen; >> + u32 field_offset, i; >> + void *mdrs; >> + >> + base = TXT_PRIV_CONFIG_REGS_BASE; >> + size = TXT_PUB_CONFIG_REGS_BASE - TXT_PRIV_CONFIG_REGS_BASE; >> + slaunch_txt_reserve_range(base, size); >> + >> + memcpy_fromio(&heap_base, txt + TXT_CR_HEAP_BASE, sizeof(heap_base)); >> + memcpy_fromio(&heap_size, txt + TXT_CR_HEAP_SIZE, sizeof(heap_size)); >> + slaunch_txt_reserve_range(heap_base, heap_size); >> + >> + memcpy_fromio(&base, txt + TXT_CR_SINIT_BASE, sizeof(base)); >> + memcpy_fromio(&size, txt + TXT_CR_SINIT_SIZE, sizeof(size)); >> + slaunch_txt_reserve_range(base, size); >> + >> + field_offset = offsetof(struct txt_sinit_mle_data, >> + sinit_vtd_dmar_table_size); >> + sinit_mle_data = txt_early_get_heap_table(txt, TXT_SINIT_MLE_DATA_TABLE, >> + field_offset); >> + >> + mdrnum = sinit_mle_data->num_of_sinit_mdrs; >> + mdroffset = sinit_mle_data->sinit_mdrs_table_offset; >> + >> + txt_early_put_heap_table(sinit_mle_data, field_offset); >> + >> + if (!mdrnum) >> + goto nomdr; >> + >> + mdrslen = mdrnum * sizeof(struct txt_sinit_memory_descriptor_record); >> + >> + mdrs = txt_early_get_heap_table(txt, TXT_SINIT_MLE_DATA_TABLE, >> + mdroffset + mdrslen - 8); >> + >> + mdr = mdrs + mdroffset - 8; >> + >> + for (i = 0; i < mdrnum; i++, mdr++) { >> + /* Spec says some entries can have length 0, ignore them */ >> + if (mdr->type > 0 && mdr->length > 0) >> + slaunch_txt_reserve_range(mdr->address, mdr->length); >> + } >> + >> + txt_early_put_heap_table(mdrs, mdroffset + mdrslen - 8); >> + >> +nomdr: >> + slaunch_txt_reserve_range(ap_wake_info.ap_wake_block, >> + ap_wake_info.ap_wake_block_size); >> + >> + /* >> + * Earlier checks ensured that the event log was properly situated >> + * either inside the TXT heap or outside. This is a check to see if the >> + * event log needs to be reserved. If it is in the TXT heap, it is >> + * already reserved. >> + */ >> + if (evtlog_addr < heap_base || evtlog_addr > (heap_base + heap_size)) >> + slaunch_txt_reserve_range(evtlog_addr, evtlog_size); >> + >> + for (i = 0; i < e820_table->nr_entries; i++) { >> + base = e820_table->entries[i].addr; >> + size = e820_table->entries[i].size; >> + if ((base >= vtd_pmr_lo_size) && (base < 0x100000000ULL)) > > nit: unnecessary parentheses > >> + slaunch_txt_reserve_range(base, size); >> + else if ((base < vtd_pmr_lo_size) && >> + (base + size > vtd_pmr_lo_size)) >> + slaunch_txt_reserve_range(vtd_pmr_lo_size, >> + base + size - vtd_pmr_lo_size); >> + } >> +} >> + >> +/* >> + * TXT stashes a safe copy of the DMAR ACPI table to prevent tampering. >> + * It is stored in the TXT heap. Fetch it from there and make it available >> + * to the IOMMU driver. >> + */ >> +static void __init slaunch_copy_dmar_table(void __iomem *txt) >> +{ >> + struct txt_sinit_mle_data *sinit_mle_data; >> + u32 field_offset, dmar_size, dmar_offset; >> + void *dmar; >> + >> + memset(&txt_dmar, 0, PAGE_SIZE); >> + >> + field_offset = offsetof(struct txt_sinit_mle_data, >> + processor_scrtm_status); >> + sinit_mle_data = txt_early_get_heap_table(txt, TXT_SINIT_MLE_DATA_TABLE, >> + field_offset); >> + >> + dmar_size = sinit_mle_data->sinit_vtd_dmar_table_size; >> + dmar_offset = sinit_mle_data->sinit_vtd_dmar_table_offset; >> + >> + txt_early_put_heap_table(sinit_mle_data, field_offset); >> + >> + if (!dmar_size || !dmar_offset) >> + slaunch_txt_reset(txt, >> + "Error invalid DMAR table values\n", >> + SL_ERROR_HEAP_INVALID_DMAR); >> + >> + if (unlikely(dmar_size > PAGE_SIZE)) >> + slaunch_txt_reset(txt, >> + "Error DMAR too big to store\n", >> + SL_ERROR_HEAP_DMAR_SIZE); >> + >> + > > nit: one blank line is enough > >> + dmar = txt_early_get_heap_table(txt, TXT_SINIT_MLE_DATA_TABLE, >> + dmar_offset + dmar_size - 8); >> + if (!dmar) >> + slaunch_txt_reset(txt, >> + "Error early_ioremap of DMAR\n", >> + SL_ERROR_HEAP_DMAR_MAP); >> + >> + memcpy(&txt_dmar[0], dmar + dmar_offset - 8, dmar_size); >> + >> + txt_early_put_heap_table(dmar, dmar_offset + dmar_size - 8); >> +} > > ... > >> +/* >> + * Intel TXT specific late stub setup and validation. >> + */ >> +void __init slaunch_setup_txt(void) >> +{ >> + u64 one = TXT_REGVALUE_ONE, val; >> + void __iomem *txt; >> + >> + if (!boot_cpu_has(X86_FEATURE_SMX)) >> + return; >> + >> + /* >> + * If booted through secure launch entry point, the loadflags >> + * option will be set. >> + */ >> + if (!(boot_params.hdr.loadflags & SLAUNCH_FLAG)) >> + return; >> + >> + /* >> + * See if SENTER was done by reading the status register in the >> + * public space. If the public register space cannot be read, TXT may >> + * be disabled. >> + */ >> + txt = early_ioremap(TXT_PUB_CONFIG_REGS_BASE, >> + TXT_NR_CONFIG_PAGES * PAGE_SIZE); >> + if (!txt) >> + return; >> + >> + memcpy_fromio(&val, txt + TXT_CR_STS, sizeof(val)); >> + early_iounmap(txt, TXT_NR_CONFIG_PAGES * PAGE_SIZE); >> + >> + /* SENTER should have been done */ >> + if (!(val & TXT_SENTER_DONE_STS)) >> + panic("Error TXT.STS SENTER_DONE not set\n"); >> + >> + /* SEXIT should have been cleared */ >> + if (val & TXT_SEXIT_DONE_STS) >> + panic("Error TXT.STS SEXIT_DONE set\n"); >> + >> + /* Now we want to use the private register space */ >> + txt = early_ioremap(TXT_PRIV_CONFIG_REGS_BASE, >> + TXT_NR_CONFIG_PAGES * PAGE_SIZE); >> + if (!txt) { >> + /* This is really bad, no where to go from here */ >> + panic("Error early_ioremap of TXT priv registers\n"); >> + } >> + >> + /* >> + * Try to read the Intel VID from the TXT private registers to see if >> + * TXT measured launch happened properly and the private space is >> + * available. >> + */ >> + memcpy_fromio(&val, txt + TXT_CR_DIDVID, sizeof(val)); >> + if ((val & 0xffff) != 0x8086) { >> + /* >> + * Can't do a proper TXT reset since it appears something is >> + * wrong even though SENTER happened and it should be in SMX >> + * mode. >> + */ >> + panic("Invalid TXT vendor ID, not in SMX mode\n"); >> + } >> + >> + /* Set flags so subsequent code knows the status of the launch */ >> + sl_flags |= (SL_FLAG_ACTIVE|SL_FLAG_ARCH_TXT); > > nit: spaces around '|' > > ... >