Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp976288pxb; Fri, 22 Apr 2022 15:46:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyILgFwu15CFc/E/OGeE0mRdFFfR0PXSzypLrYTHBZpfUoloLErxW4b5WBJ3d3J78c93/uC X-Received: by 2002:a05:6e02:1ca9:b0:2cc:584c:40f4 with SMTP id x9-20020a056e021ca900b002cc584c40f4mr2664248ill.128.1650667566515; Fri, 22 Apr 2022 15:46:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1650667566; cv=pass; d=google.com; s=arc-20160816; b=W2hvVtkGptsVtQSBXhchOOPZzsVEzn2TjXaNCK6P39jSulNEvnECGB+OcCw8DTjtGu mQeZVbKoXfy/dUUcq5MAgp5Dlwh8svhc/d5kjdVqIeP0Sfu8Fe6KifXfxtQD445o6Q4j gIAdkxE7zzmXvthMZMvhghQIUbc9E60JJOozuK24ZzLRSlE7RyXIVisLxY/9Vx3+RDQd iLAYMbIWQYe0HGn4Lm0mDtA/0SOXnRRwdfJAyHCe7ueRK17sf41lz3DSJUdsdWMNrA++ YJkhNDvHv8Q60zovoveAq9TM2kal0xqxUQkPDtYgDYCJbXzB7f56tiFDJZV3q81/Mf3m rttA== 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; bh=o//bJ76awndrxPuDsErQs2FtHqw5TU3tPx0GpyJvlOI=; b=dhc+6CiGunctgU/gqw2VcgZJFhQQRU1YvFrr1cqoUOfjx8TkKyemB6GT9o1nXHEMr4 vniVIK5EHD2msA7mKoU3YDvawGkCSfaqmzewxYbyEiDE4MoLLaO5rMsRKuMUHagUkkkY VJtJmB/5sn5jeGpQoZ/3rFa89Y19JHPaxJUd6Q94CH0Gfq3gRmvamGOdCAAPVPREq9Dt wyJAFX80tFiXou2pkeszX+yuX2vLs21L6jlQ4osqo3dM/u26q9hwd68MNatBPBul5+WH 97p1ba6v6kreFUBiiDGTzKZmS4119EyJaOZi4CuHQ/+qA7TVuUR+U1bEB3yjbyjtJBW0 pRLg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="iFvzPxz/"; 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 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x10-20020a056e021caa00b002cc029bf23asi5175736ill.58.2022.04.22.15.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:46:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="iFvzPxz/"; 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 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F0B8A1C1DC1; Fri, 22 Apr 2022 13:34:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232915AbiDVRlZ (ORCPT + 99 others); Fri, 22 Apr 2022 13:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229919AbiDVRlX (ORCPT ); Fri, 22 Apr 2022 13:41:23 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2081.outbound.protection.outlook.com [40.107.102.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C847AE1CE9 for ; Fri, 22 Apr 2022 10:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=USkfdyuKazD4CFVuvRPShtaDzIzhu8Clnc1p+UxXz+PP3Punt6ZR1obsaYh/css6u4kpzz8zGDCaT/EBkt8f6JG6/q1zhn5FajWaqYuiGlIBUM1WbgHCql6Max2n9bh+TRLNgJNWbtF/NH/lwppnQv/68JZqws02WzpM4ulvmmnZraZK4eC8rZVb7Lv2bmhx2MhPKS3gHmmD2jGhRIHiaenJTIuwpM473UyhAQqiNjSGoDjkuOP/noNGLrfN1stfnExctiY0MN7oJHCBXtN93uebE+I1MyGCam+ZWr0+mbznMz7b11UgvXfQkXnCzt44uLFqic3TZF95vxMqfYX8aA== 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=o//bJ76awndrxPuDsErQs2FtHqw5TU3tPx0GpyJvlOI=; b=Uofvh2pJJId1a+ZZik8c/O7Yk19WgytOQVHvg3RvfcmdSoFNWFo+F27McB6XHmYw5h7gVHpRfzV6eobpqJulfqK+uGbO4vsKWIGn/7leZjNzF5Xi06GI1+QPXA0qaJClAFPk37O5aU0u9V3kDeCoCrEsj0UZ1QjMRw4/688JGlZQcg4J/TL+qX1hAybCzcSeWXsgUJpbpenmCpuaB+dmYmBf0c0nebPuYvFQoFQx/YqW6wT6jQfAgjhjkVMxCfnfoPRg84x8sJ48+zoJd/z18Mdx7beCy3tQhR/OaYFQppSLxCxN00gVRy9FrP12PUt11sQIQ7ApCAqpWW8FOq4QAw== 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=o//bJ76awndrxPuDsErQs2FtHqw5TU3tPx0GpyJvlOI=; b=iFvzPxz/O+dN+Bv5ukAUbyZcuS+WAYm+uSm2+kRgncyxRel8HClJEgPNIULiD9d1XFZD2cuW13nTcMzFhmqjCj0V3D7em1MEhinb/oW8B5Jx+5xw3M8hRQ4bwb0lkrnzIWAIwQW20muEebazh6iXrEYcqvU/KhFHa5ykXAT6j28= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by MN2PR12MB4160.namprd12.prod.outlook.com (2603:10b6:208:19a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Fri, 22 Apr 2022 17:27:14 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::781d:15d6:8f63:a4e7]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::781d:15d6:8f63:a4e7%7]) with mapi id 15.20.5186.015; Fri, 22 Apr 2022 17:27:14 +0000 Message-ID: <44b72da3-05d3-a9cb-eb74-43295383c9d0@amd.com> Date: Fri, 22 Apr 2022 12:27:11 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v3 2/2] x86/sev: Get the AP jump table address from secrets page Content-Language: en-US To: Michael Roth Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Kees Cook , "Kirill A . Shutemov" , Tony Luck , Nick Desaulniers , Kuppuswamy Sathyanarayanan , Venu Busireddy , Joerg Roedel , Tianyu Lan , Brijesh Singh References: <20220422135624.114172-1-michael.roth@amd.com> <20220422135624.114172-3-michael.roth@amd.com> <20220422154056.lhzmii34he6blvwv@amd.com> From: Tom Lendacky In-Reply-To: <20220422154056.lhzmii34he6blvwv@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0024.namprd04.prod.outlook.com (2603:10b6:806:f2::29) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fe3e955-4776-4cae-88d8-08da24855726 X-MS-TrafficTypeDiagnostic: MN2PR12MB4160:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: feBwBdh1efCZYd1F6MuphN6MBz4hbyMLFA7tVxF77HkoeGRkIrkLwco1mAC51ofSnaBjeNOyjVR1+7f94sAWoTz9pfAfDbQ+4d2Nk+eMD95ZuIk9QlcUgPq4OACFn71fD24M/aAqOI4foYh+D3JOJ3d214+wCo7eKxjGD0e/V0Fyw3JDECXTPx2wKYW5Y3JKXnWLvidQUTcUg8RpHWoc16lGG3NqRWS25MB6ORWTUCssZaPPzmHjz/FGhwdpd0qYt34QCS5GuKFwElUPiuVqf9xkTo8WljcPD6niF2msdGw1lde6+OdwOaLuzdm2olVgx+6QNh7ERDQJu821T7gJB5knZfc5GvFtEtaD4EnYbM9PNj8JvXF/WX5+QuRIsoGmAIs/ouwU5uPomV0GvorRYyJS+Paa6GgtJWtMBceDmMZBjam2BBy5RXkDsx7PsM9sWb8HePnacd8YLwXqwj8FNJOxjYOfwDk4R9oa5JCkUoeSfh4DmI0cWa8xcGgbvyCuGVeMpgwaNkAFKIHtHP3uqg8dyebn6URg1nTopCM7lZUvZ+91tRJ6SgG8TrKSUDBVVepOa+rB7zoRM7cFaM68ZK/9ON7ehA33B0dYBYjy5eIHypnXZpFzAM0Vr4L4ibvTNiB+slnZ10lpnMjRfJ+XjF9ZwIG0wtbo25ustC9MLGKPB+aohyubezFUlV7HLlL6SSdJGPBY5U/hsZeMudfCQRJlpKzjNExecHU/PU4QyhklZHkH3GTff1+ZKhHib86GghmLU+YNEcaMQpMKC+9QXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6862004)(4326008)(5660300002)(8676002)(66946007)(66556008)(66476007)(36756003)(53546011)(31686004)(86362001)(7416002)(6506007)(316002)(508600001)(6486002)(2906002)(37006003)(6636002)(54906003)(83380400001)(8936002)(6512007)(2616005)(26005)(31696002)(186003)(6666004)(38100700002)(15583001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWphZ01kYllzbGVCekZ4TGhUMG4zQXVjekd5dkJ4YnR0Q05EbVl0YkNNWEs1?= =?utf-8?B?WTMxNUlwQVR4eEszSnlabmRSSlhTWHkrS29GUTh3U25URGpuYUpYUmRPV0Q3?= =?utf-8?B?VFhYQ0dZeUo3ckdsdFVYYmRBQ2orMG5Qam1YejAzd0YzbUgwUEdzMjdFQWpv?= =?utf-8?B?Tm40aVlOYTFpWHh4bGhBU0FVaDErL2hXL0pvbkI3aGI4SmRlejRBU0xweWo1?= =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T0pFd3NjcllDdzlvSXhicDhweVJ3ZlBZNVNL?= =?utf-8?B?VDh4RUlPVkZFWHNFRWNvL3NxWUZlRnpXd3VPMloxTHdmSllVRmk4bk9pdk1Q?= =?utf-8?B?aFd5NWhWUDBEVlRubmlFekZxZnNlQ2NXcTdvMVZBdjZwdFNhakJ0Ukc0UFkv?= =?utf-8?B?SEpVdmZldUYyWU10b2RtQks3MkJwM3BaMDhoY1R4UU8zN0RkZG5IbmRkUktx?= =?utf-8?B?eGdkaEtsem00cVA1dHZDdjQwbm9Xd2pWZldIRG5sUXlGbkpzWURyTW1TMG1J?= =?utf-8?B?czZWZVdYbkp1dzYyVnBCNHErMHpmWENBajdUMmU3UEp3M1htTEt6UT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fe3e955-4776-4cae-88d8-08da24855726 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2022 17:27:13.9769 (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: GpsrLPDVkEcxN7TXlw9RVQ6mq5wEE0oDnGD2Cfg7AaQAVyhOZth7bRdIxrGNoGWmvbc73Y481pR3TNP9l/7lOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4160 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable 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-kernel@vger.kernel.org On 4/22/22 10:40, Michael Roth wrote: > On Fri, Apr 22, 2022 at 10:15:08AM -0500, Tom Lendacky wrote: >> On 4/22/22 08:56, Michael Roth wrote: >>> From: Brijesh Singh >>> >>> The GHCB specification section 2.7 states that when SEV-SNP is enabled, >>> a hypervisor must provide the AP jump table physical address through >> >> I missed this on the first version. It's not the hypervisor, but the guest >> BIOS that directly provides the AP jump table physical address, in our case >> OVMF sets the address in the SNP secrets page. This allows communication >> between UEFI/BIOS and OS without hypervisor involvement. > > How about this wording for the commit message? > > The GHCB specification section 2.7 states that when SEV-SNP is enabled, > a guest should not rely on the hypervisor to provide the address of the > AP jump table. Instead, if a guest BIOS wants provide an AP jump table, > it should record the address in the SNP secrets page so the guest > operating system can obtain it directly from there. > > Fix this on the guest kernel side by having SNP guests use the AP jump > table address published in the secrets page rather than issuing a GHCB > request to get it. That sounds good to me. Thanks, Tom > >> >>> the SNP secrets pages. >>> >>> Fixes: 0afb6b660a6b ("x86/sev: Use SEV-SNP AP creation to start secondary CPUs") >>> Signed-off-by: Brijesh Singh >>> [ mroth: improve error handling when ioremap()/memremap() return NULL ] >>> [ mroth: don't mix function calls with declarations ] >>> [ mroth: add missing __init ] >>> Signed-off-by: Michael Roth >> >> With the commit message change: >> >> Reviewed-by: Tom Lendacky