Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3863934rdh; Tue, 28 Nov 2023 06:03:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2/P+ZFXKhImACoyZJYjYlhJekSRz6wXOFkekT+P4j+Dvq3ZHRUpEdwXvQNIf3O/EepYa+ X-Received: by 2002:a05:6a00:21c4:b0:6cb:b7b7:c04c with SMTP id t4-20020a056a0021c400b006cbb7b7c04cmr15094531pfj.12.1701180203535; Tue, 28 Nov 2023 06:03:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701180203; cv=pass; d=google.com; s=arc-20160816; b=ZjqB8Vabmp64unqi8mpYYTIV6Mq36fbEqdohud1lhDVmZiGI0kTcHX/OzVB4f41A9N rJOIvdBzRDSuInH7hTqlfsKev6wZdrLFQg6b9OWZ2i0P5Hf8tMKfCtKj959XjXCXI11r aVe5dC6S9tbskYtElI0zPhkdsRSbWtLSXV/m3qQdkZmt4YlgmGrLnaix+edXl8fxVzmv CJpzVTqIys/4ygLT/lwRTHWFAht84lmGo87FZkckdZmWGJ9nOybkx3VOluQXC1pXPV3h Y72Z/FPJMYmsalLj6dIx/fF/znQ1Eqqh5gyrxw+aRnTRUK1TfXyiJ+u3vg7fb1TrtDpW 2iAg== 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:autocrypt:from:references:cc:to:content-language :subject:user-agent:date:message-id:dkim-signature; bh=Zm4IkeO2pxHmfzGex2DZMXhGNXVroixGAClUkKJ78OA=; fh=w6Gcrau8Jjs4GYBKRebiQFXuZnFtepSZYpb4CUFAti0=; b=xxb0xN3V+nzzAS6dvjwUUF4kNbEHBfhPOnhW8FZmuXhdx8OMPNNqZS91Iw6No6k1yX nG2KpUgzME401U99vctJfI1td6Q05sNWUHCFsQSlOAC4dXI9gAk+pmbJbUrSaOLDB7Oo Inr2kVXe0Bj+XaGscACVi1sJhybnwMBCk7/TOOO1E86gCONrVYBhZPlzjr5bEHqFK0yB tJuHlAn+IBek6IBEecBlkja8ozEI+1+zfKljZAv6Ov3n79TohEjVdO2ShfV5fDv9dkEl Ef2uOmP2HJVk4wAadbRLAF3rYkVzs9NY9gtghl/B/beEI/IF0FamJiIcuqQ76hWlXTp7 NK6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hSMOq74Z; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m8-20020a62f208000000b006cd8a7a8fbesi4829318pfh.392.2023.11.28.06.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:03:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hSMOq74Z; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 62AE880447B0; Tue, 28 Nov 2023 06:03:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345355AbjK1ODE (ORCPT + 99 others); Tue, 28 Nov 2023 09:03:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344798AbjK1ODD (ORCPT ); Tue, 28 Nov 2023 09:03:03 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2082.outbound.protection.outlook.com [40.107.244.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1152B85 for ; Tue, 28 Nov 2023 06:03:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kYXGfin63U1e4OUoi/K3+wKnZM0MUT4pBVCcw7BPW/xEp3DC3uHgbMPb46IPnHE5XbYsrbBYcb40MNneneMTBXTbL1487lQHcNKG7T/mt+KkFvGr9zF2rZR9dnYIFNFgQbhOVwa57n8mRzUtjfPFCurYy9E0bOw/mQTSysF6SWEO4alYGjjXcQIm3B42/j34Unbs+hL5gXAFjr8ZnnmAI1HAHoBcZ9pPQke1Ha/SgS6/gyU3wpJCemzP9B7p0yd5T3T59DONkxDLKp/1x1bIklHVN1U0Rjxsw6Obo/jBY0JBO/3xGIqy5wnjn6OO+hiEnbtMhY5JP/tizNFleR9yCQ== 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=Zm4IkeO2pxHmfzGex2DZMXhGNXVroixGAClUkKJ78OA=; b=dGgPv4M8GBUlvzQTwc7q9U9TTmmupmmQV/Hgfsb/IgBs27OmanRlmKT8ms6OAwnA3/azg2J2mHwEDYS12U0nzrB6te7qoBjJaym/auIGmXQasdIWBMxtOE4kymnBvqqy79jWrXrdLs4PIaniayfgE9Nki3RBm+GofDPEo1Sj+83h6NtZ4tXagwYiHYQyJeiEz4dUCGzSUd4XMbqUZd94XexURr6VBpWDRF849/oWlWOjSMTgPwxgC+idNBD0ehNN0DK1XcljxgG/UT49EOwxEUPlUrP6kq0TQtqlcVvFzmvCZwu/YTWH6+/gzqldAEIyrrpn+ygthYpa9wAEaw5/zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zm4IkeO2pxHmfzGex2DZMXhGNXVroixGAClUkKJ78OA=; b=hSMOq74Z6BJmvdi3jxc8nv9KOdlajk49O9+rp88qwDkbvgqkKRaUaN0qzfx88MonAkS6RVZiBK/qPJzNnQYCNp53tc82HnhrDO4Fst3Tg1FI8FvhDT/PHPPdno89TQTtpnMPRKXrKxO0UfVLQLfEWA+/HyRP03R6XRcc5BJp8uQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by SJ0PR12MB6758.namprd12.prod.outlook.com (2603:10b6:a03:44a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Tue, 28 Nov 2023 14:03:04 +0000 Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::1d68:1eb8:d7dc:4b43]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::1d68:1eb8:d7dc:4b43%6]) with mapi id 15.20.7025.022; Tue, 28 Nov 2023 14:03:04 +0000 Message-ID: <29e235f7-add2-47ae-b06e-a717202c4faf@amd.com> Date: Tue, 28 Nov 2023 08:03:02 -0600 User-Agent: Mozilla Thunderbird Subject: Re: AMD Memory encryption vs. kexec Content-Language: en-US To: Dave Hansen , Borislav Petkov , "Shutemov, Kirill" , Ashish Kalra , Kai Huang Cc: LKML , the arch/x86 maintainers References: <82b2e0d5-edcc-44f3-b759-d6b8c8788ea6@intel.com> From: Tom Lendacky Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4wVDoFt1EG93YOnqMuif76YGEl3iv9tYcESEeLNruDN6 LDbE8blkR3151tdg8IkgREJ+dK+q0p9UsGfdd+H7pni6Jjcxz8mjKCx6wAuzvArA0Ciq+Scg hfIgoiYQegZjh2vF2lCUzWWatXJoy7IzeAB5LDl/E9vz72cVD8CwQZoEx4PCsHslVpW6A/6U NRAz6ShU77jkoYoI4hoGC7qZcwy84mmJqRygFnb8dOjHI1KxqQARAQABzSZUb20gTGVuZGFj a3kgPHRob21hcy5sZW5kYWNreUBhbWQuY29tPsLBmQQTAQoAQwIbIwcLCQgHAwIBBhUIAgkK CwQWAgMBAh4BAheAAhkBFiEE3Vil58OMFCw3iBv13v+a5E8wTVMFAl/aLz0FCQ7wZDQACgkQ 3v+a5E8wTV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WPBd9Izfr9wJ 1NhFSLKvfA== In-Reply-To: <82b2e0d5-edcc-44f3-b759-d6b8c8788ea6@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR13CA0083.namprd13.prod.outlook.com (2603:10b6:806:23::28) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|SJ0PR12MB6758:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c371250-2a0d-4151-1b0d-08dbf01abd58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cSr95h8QrKKF6fa/a1bHewtKPNFcudCSTBila7uy4fqJrsb3uyhAEfI2vF7m+iuD8W4cAClIZ2Wxu5rFZFo/NFyI4/7JKMZrHiLCt8fhiR7XNSPglUdFFGlwX1Y5RanKUGmYiBWRX8ZOM8T1FdKgVt1mV38pdWvsjf6cwVNBw/k0bsCoK4uSckZg0O+xOddWTKSZAwr/COA3IiFQorsPIrE3MU3iHfmb1N2Vn2fr7+ehvhXIc/DVb55DVOrK38djFo8hOoeldye1tb5u9O5F2gdD0u7F3xiy+e8H9O+nxXlEiBS74JYOxOoda5aoQ8If+67yM7Q4J5zkM9+tz6DsBebf+e9kaGoF3xIXiAXRT6ibAP1dd+zCeBTHVq86O/eHF7BgZMR+10zxeu+EzpQwXVWrIgXb9DRmTntWO5kFVI4gVQQVwDCheo3sMsY5004f19J6yV+3YAkWBO4yIXmCgY/dawea8EsFEMP4VIAdTOP23OYUIZsnVqOOnTzWnY9pNs1Sovd+hEHO1IMnI+ghd8aV6Z9MLIhR9LkpqcTS4+J+Ti3uWi/KnfYD6ayBVJsyO8gK9U3VAqDqZZg51lqfXx02/hgaepfyi88pU67YzO03raZl7yd5X/RykdLTLubqIhxCJEM9W7isD2sOy+vXvg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5732.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(366004)(396003)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(38100700002)(36756003)(31696002)(86362001)(66946007)(41300700001)(66476007)(54906003)(110136005)(8676002)(8936002)(4326008)(5660300002)(2906002)(316002)(6512007)(31686004)(53546011)(6506007)(2616005)(66556008)(478600001)(26005)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OWlycDZ1RE80TUZXWHd2L1ovK1hnMG1KV2tmSDRNeTJnd2hzSTJRQ0ZuZHRM?= =?utf-8?B?NHo5YWRwWGplNmd1MjhLV0FzTnJrclNadkErQWlXdEpCYzhXTUprNXBXbDFW?= =?utf-8?B?ZGtua2lZZDJVakVoV0tYTk56T2FCNmZyTzByUm1FVzBHZHkxajgrOWpvbG1T?= =?utf-8?B?MVdnR1h6M3VDdkxPRTJ3Ly9tcWNCMDFNYTIxNFp0WkYzUzlwWUxsR0c1eXY2?= =?utf-8?B?c2dzV1lkc1RnWmxFM0szU2pXWGZyMnRiWmVVSnNJRmxmWk9YaTE5REdFSU1T?= =?utf-8?B?Sm1Sc0NqYkcyYUVPakRiTzI4VE9uN1I2WVdFeXFsaUhIOFM3YTdxRUtDajAz?= =?utf-8?B?VGxkOVNVbXdsaFNSRWVLd3FwbGVxak94bFFnb1ZjdUYvWlFNRXRSMnBJMWJU?= =?utf-8?B?eFpoVCt1anQzL2J5TGlWQVJmM0w5QkgrQS8zVUZONEpmY1NZaVZ0RGwwMjNz?= =?utf-8?B?UDlyK2IvUkpiUytiTFcvWkNMUDVPR3BKVDlOa3QwSU1IVXVvMHpSNUdWMkp5?= =?utf-8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OERYcDZJamxV?= =?utf-8?B?aEgzMldVVDQ1SEpmeDRmTTdpaVF1c1ZOb00xNDh5NDh0ZTFrSjBTSUFubDRQ?= =?utf-8?B?VnNFUkFQRWw4eEF3UkxieDZwRXlTSGtieFNRQ1pMbVJDNTgvU0NKbExHSlJJ?= =?utf-8?B?L2xQTUkvRUJNYlJHc1BLc1I5ei9VS096Ri9ZQkh6M09aK05rQWVHdnpXeXZW?= =?utf-8?B?V2wwVDdKdTVCb1lXeWc4NEZsYUFVcUQzeFBnNEQvQXd3TmhDL1I0WFQ4Y1RY?= =?utf-8?B?dFBTSnd4Q0NRb05JR2NxU3A0RU1NMkkyV0UvQUJPZWU0MGR5eVgweG5wZzNO?= =?utf-8?B?TC93WTYwNnJ0djBnMVRrN0RzVkZXaW1QQ3pKN2k1ZFRLZ3lLZkNJaHVQRHFs?= =?utf-8?B?WERzaUZ1OW5CTjBjZVFrSWZSRFYxTERpeFIrbXhyTTFwZXI5d3duKyt4dlRV?= =?utf-8?B?NkhOUVQ4WkZadnhKZXdSRG84VXZ4MC9ObVY3WStFYmk0QlFwSTdidnJUUFQy?= =?utf-8?B?MU1xMzNlK3BUYXo4RnF0Y2JYUUY5diszRDlrLzgyK215N3Y0b1dkeGEzZUlO?= =?utf-8?B?cHl3aWZKTElEZ1hZT2xWZTRibWtCdGFReEJvNnRXTlVHMVRYbFVxWGIweWdN?= =?utf-8?B?UnE5Mlh3MGl3MmEreUNpMktIeE9ncnlWQWJhMXBPYXBTZC9wTnl6ZFhVLzcr?= =?utf-8?Q?O1GJHhXeG3KToJamXe1vxNB7E?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c371250-2a0d-4151-1b0d-08dbf01abd58 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 14:03:04.1334 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eUFr7E0GOw5GPYtDkUHz3m7yOgRmL2SuZbZXfU1DzU6k7t2ApH42drT90cPHllkd19rcRRznRN0OxqDq5vCFWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6758 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 06:03:18 -0800 (PST) On 11/27/23 18:00, Dave Hansen wrote: > ... actually cc'd the mailing lists and x86@ exploder on this one. > Please reply here. > > --- > > There are two kexec-related wbinvd's: > > One for the kexec boot CPU in relocate_kernel() which is driven by > CC_ATTR_HOST_MEM_ENCRYPT: > >> image->start = relocate_kernel((unsigned long)image->head, >> (unsigned long)page_list, >> image->start, >> image->preserve_context, >> cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT)); > > the other is for non-boot CPUs in stop_this_cpu(): > >> if (c->extended_cpuid_level >= 0x8000001f && (cpuid_eax(0x8000001f) & BIT(0))) >> native_wbinvd(); > > By my reading, the CC_ATTR_HOST_MEM_ENCRYPT is basically a check for > whether the current kernel has enabled SME but not SEV while the > stop_this_cpu() site is driven purely by whether the hardware *supports* > SME. > > The whole supposed reason stop_this_cpu() checks CPUID directly is that > the current kernel SME/SEV enabling might not match the _next_ kernel's > enabling choices. Correct. > > So, why is a _current_ kernel check OK for relocate_kernel(), but not OK > for stop_this_cpu()? The relocate_kernel() check provides an indication of whether SME is actually active. The kexec kernel is placed in unencrypted memory to match how the system was booted - where the kernel is loaded into unencrypted memory and then encrypted in-place if SME is desired (mem_encrypt=on). Since the kexec kernel will be unencrypted, the cc_platform_has() call is used to indicate whether to perform a wbinvd to remove encrypted cache line entries. If SME is not active, then there is no need to flush caches prior to booting the kexec kernel. With SEV, the kernel is loaded encrypted from the start and so the kexec kernel can remain in encrypted memory and no wbinvd is required. Thanks, Tom > > It seems to me like both sites might need to use the > stop_this_cpu()-style "raw" hardware support checks. > > Why do I care? TDX potentially needs wbinvd at the same two spots. It > would be nice to have a common cc_attr for both sites, but I need to > reconcile the apparently disparate AMD uses first.