Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7008476rwi; Mon, 24 Oct 2022 08:43:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c3KHKdbSqba+pbIQcxqK8srzyyet0hR5/ysdanwO6+ZxDqQAjG/HHcdOYg14SwZ1qZPBB X-Received: by 2002:a17:90b:1e11:b0:20d:90b3:45a0 with SMTP id pg17-20020a17090b1e1100b0020d90b345a0mr71551319pjb.29.1666626192032; Mon, 24 Oct 2022 08:43:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666626192; cv=pass; d=google.com; s=arc-20160816; b=iNYiosPgQAbTCQHvJnmwhc5Bh6IA5lw1UldjMeB8q0QDnQqPrT3t64SDNj1nSIq0Zh vnu1s+hNFKx8CMp9Ix1zSwrm/wFegxy+9vXNFDScR0eb2pV//cPUTCTAIV+53F5sr4e3 rSrc+KRm7pcVquPz9SPHuooTpkWcwm0C1nStBuVopJ2nekbXSxsJB6daXJhtM2KUJabB /PEffU0T/5bvGPP2nMK2xiWRMAhktS9lgafzyXDBcUgDIY+/18AWx28wWROiFT3sM7kC 5OsRjo8icnxeGNYTlHCHycFweyB7MFbQ/0CQnfyH169uL/TUr+HB7hZHU+xs3HqPE4/o QqYQ== 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=HG7Eg9i1ggVPISnypN+HJCSR8a8fsolfEj5aA7ABVrg=; b=eOF2KKOAvpCzQanqmwJfpCIUOL/SERepZKp+O7CSeEqfGC/fP0aiASLMdI7U1dWq/O yWdJkqw/azFYrRtieetB+aB2zTCKuNlfMiXmCeCTYb5Wl93mFE5LsrvcHyYaHqb+E6Zq Dp/0SrfgPpI+hMJ0gTDMA8uxwGrSK8gYlVoNQb57A+iLDiSUSns2ref5CtphxDIoOFaG 2r1erjssF2uXl4KtcWhBeYzUF15kOqkdrF+wE1rRI5DgDA2f19vkf5s6+sHlzczaZnD3 aKfH/Fecm8vMZcosxApiFmhwexr4cvkrbqlD0Jwu7ECYsIMQ4iIuQCGZUYe7xdQeJvvr RZ8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=YbOH8TM+; 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:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b16-20020a170902d51000b001869394a38dsi7998983plg.503.2022.10.24.08.43.00; Mon, 24 Oct 2022 08:43:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@amd.com header.s=selector1 header.b=YbOH8TM+; 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231715AbiJXPaS (ORCPT + 99 others); Mon, 24 Oct 2022 11:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231587AbiJXP3o (ORCPT ); Mon, 24 Oct 2022 11:29:44 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2057.outbound.protection.outlook.com [40.107.95.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 067F31EC64 for ; Mon, 24 Oct 2022 07:16:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YxxibyM69QFhPxw/f/llJVBfwzBlSXtUiXN9m0ZETEZKkdVqCPCA/ou3PMHIIdKfhdGqHpIUkPOLmLdwHZgAGrmbOoiYzv6orDbULSuHqfEeG/Yi+Z7VgmZPjy+1LALQ5XtvTdKDIcDUOU6sllp+iWH9MqqgbKT80iL777u2fF6IV31KQPFMRIxeE/F0bUizqn0EceeBFR/G4NphWbTCQ+lLsBc6XfUF/VFOp8YKt9aXcKEZI+o1dyblwDqkZ7lFdHPrlm8zfNEw2Cg/idcdmtxBoQlZH3Shwbow/SIt3WzAkT0+ydvuUTYpPEMQzna0LKgDJYbYB8heCXF9PAAYmQ== 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=HG7Eg9i1ggVPISnypN+HJCSR8a8fsolfEj5aA7ABVrg=; b=U6U4+UxfdRg8Pad/UVZvOgb7jIQ/oR2/HLyy9zdUFNv2S72wH/Fn82sFF8OsEAVOz+D1k3xntkU6FxDby+Wf7PdGXUer5QGhflGNrV5U37wQ6z+2JIh9EogZnKEVD7hvu/BoN5N2jkT0Vo7G2G1BT6vBiJ7VoFRgzNNRXwvRJRXLIv9ZaK13ICM+Tz3zuFluqLuPMrF58bIhHJ2Wyy7v16HnljQGZYmSACIrs/01aBAzSoVPViw/ITEpziKaHZjLDtccnRihdUHcohgjxh9Z1Xmbu4Dub+g+FjWbbLlLrlX0Zu5RUwUNcYGC9VC2fK2PpqOtFEESsrOQCR3V+jHq8g== 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=HG7Eg9i1ggVPISnypN+HJCSR8a8fsolfEj5aA7ABVrg=; b=YbOH8TM++9FWOucSwzF6DMiE/pfzKvWs5hnR4wOVuaKHwZV+g0222GNLs4YKPhPqwziXM/kAnUWTt2dd9kNFFMr7A9rQeNupn4R8UfZ7+AQfPtCbp74cfvZNsvdTMrNeyC7fRpP8mvFBh4PC6e9LLcv1Si9X/RjyZrlCer7xqH8= 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 BL1PR12MB5208.namprd12.prod.outlook.com (2603:10b6:208:311::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Mon, 24 Oct 2022 14:09:41 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::4da8:e3eb:20eb:f00]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::4da8:e3eb:20eb:f00%2]) with mapi id 15.20.5746.026; Mon, 24 Oct 2022 14:09:41 +0000 Message-ID: Date: Mon, 24 Oct 2022 09:09:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v3 2/4] x86/sev: Change snp_guest_issue_request's fw_err Content-Language: en-US To: Dionna Glaze , linux-kernel@vger.kernel.org, x86@kernel.org Cc: Paolo Bonzini , Joerg Roedel , Peter Gonda , Thomas Gleixner , Dave Hansen References: <20221021165943.1968044-1-dionnaglaze@google.com> <20221021165943.1968044-3-dionnaglaze@google.com> From: Tom Lendacky In-Reply-To: <20221021165943.1968044-3-dionnaglaze@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH0PR08CA0012.namprd08.prod.outlook.com (2603:10b6:610:33::17) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|BL1PR12MB5208:EE_ X-MS-Office365-Filtering-Correlation-Id: bb18c84f-f770-4f57-b72d-08dab5c96512 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j5CAnMbPh3B8jYbe9rI6UZjchzdRpkpri+QdtxAmuDiIbCqUvSMTcFtcYLlubawEz6iWF8BACat/qSBxpFNrs1tDGb1p7pEQj231kEHmBWvk6d9B5JyBziMAHtGDGmk0czcyuo9KAz5MFQKj3tvo/74HL4Uqe0WiPIPpb+9dsYJ6KtB5U4sZ9cZwTqSW6Rt5mOHwgwQwW/XUzpgw7tEEEaoCcxI4WLpnJzYNYj61cf4DZGESBBTi2/Sk7Rl9yL8PFKHk/wLah9p081DXmVwTYoFpju04pSJNKvxjU4Hksz/7Qu7E5A4vyTLPfJnZpRpHKZQtzhHjW7vLUWaQBkUwvtbkMxKHlTBEFWvhlbkC0c52dCVqcfkQI17m+ep79qlPV3rcZHhajVfArQyZSl5JH+6ZEOdfy2iMT9l1fhIGZ1EUdg3mVrQ7aHwxJyaYOjZ26FZ7Vc/OynbqOWs48WDYdgpDsbh6/Z07D6LOmdqfxKBhu1krFdHoddRa84TR4CKXxoGGv5IKtf6D6BelDBtknBClSNzRlZeV1v4gEe6+2Q810F9Cpq++tdHNgBVr3HbFrWIHo4tEHuqLnUg9chpCF+mAsKK0KiqgH6deFmQ8m3Sd5Un92oUhTtB5kqiAb78H5nUBC5kmDM/y/cGJRedQPDqUmvKW342SY3Lopacb7YREqgNMp/KKQhiHWdLogLZzXgrblV42+j70Lchd+TPcUsK2us28I3Nf39hIepbJgou4WGAfBFep89S/aFpxKJYElfxbzmVymMODInxSJQ47Z6am/TFxO2hBER7obToPa0I= 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:(13230022)(4636009)(136003)(376002)(396003)(366004)(346002)(39860400002)(451199015)(41300700001)(26005)(8936002)(6512007)(5660300002)(66946007)(66556008)(54906003)(53546011)(8676002)(6506007)(36756003)(4326008)(66476007)(316002)(38100700002)(186003)(2906002)(2616005)(83380400001)(31696002)(86362001)(31686004)(6486002)(478600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZGtCMWw3dlplNC9OYVBFNW1XODNNb0g3d2JXd3p2eDNTcUtITURLVnpyOHZi?= =?utf-8?B?NFF6YkwyUVZjUkJhN1VnT0l6QmxZUFJtQllDT1VuZkNtbG9vcXlFVmhTWWt3?= =?utf-8?B?MXZPb2JRK1BheEZBandpeTZEL0JWNThwWEVUNUQ1WXpoRy9DbVFoNHpuZVFU?= =?utf-8?B?dHdQU05oNkFtK01DaVlhRFlvb1pJOGZoU0hvb0x5aUlNWHIxRlRUaWxHMWtN?= =?utf-8?B?QVZmNlpETVhLZzJNK3k5YVErdkhlSTRHZHZGVUQ0MVZmdlNkQ3ZsSHh1eDNG?= =?utf-8?B?aXBobG4rcmVpaSsrNkFDUHR0cThXSGllR1kwMkxnbUxoZWRMZlh3OEtSL25U?= =?utf-8?B?RDdzTnBMQUl5azVWK0F1ZGE4U1M1aHQ3cW1HaEVxSy9uakk3MzNkb0lFMFRZ?= =?utf-8?B?UldPOGl1UzREa0dwbHRMNEN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229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2022 14:09:41.5906 (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: CUnh/ZmOARWw2c2XalXZ8MWY1Mhco7S0k9XxyGVJDEu2NuOnhTMUy+bAgjhLxedcV7YttNQUwJ6WxwWYi/B06Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5208 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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-kernel@vger.kernel.org On 10/21/22 11:59, Dionna Glaze wrote: > The GHCB specification declares that the firmware error value for a > guest request will be stored in the lower 32 bits of EXIT_INFO_2. > The upper 32 bits are for the VMM's own error code. The fw_err argument > is thus a misnomer, and callers will need access to all 64 bits. > > The type of unsigned long also causes problems, since sw_exit_info2 is > u64 (unsigned long long) vs the argument's previous unsigned long*. > The signature change requires the follow-up change to > drivers/virt/coco/sev-guest to use the new expected type in order to > compile. > > The firmware might not even be called, so we bookend the call with the > no firmware call error and clearing the error. > > Cc: Tom Lendacky > Cc: Paolo Bonzini > Cc: Joerg Roedel > Cc: Peter Gonda > Cc: Thomas Gleixner > Cc: Dave Hansen > > Fixes: d5af44dde546 ("x86/sev: Provide support for SNP guest request NAEs") > Signed-off-by: Dionna Glaze > --- > arch/x86/include/asm/sev.h | 4 ++-- > arch/x86/kernel/sev.c | 11 ++++++++--- > 2 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/include/asm/sev.h b/arch/x86/include/asm/sev.h > index ebc271bb6d8e..8ebd78b6a57c 100644 > --- a/arch/x86/include/asm/sev.h > +++ b/arch/x86/include/asm/sev.h > @@ -196,7 +196,7 @@ void snp_set_memory_private(unsigned long vaddr, unsigned int npages); > void snp_set_wakeup_secondary_cpu(void); > bool snp_init(struct boot_params *bp); > void __init __noreturn snp_abort(void); > -int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, unsigned long *fw_err); > +int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, u64 *exitinfo2); > #else > static inline void sev_es_ist_enter(struct pt_regs *regs) { } > static inline void sev_es_ist_exit(void) { } > @@ -217,7 +217,7 @@ static inline void snp_set_wakeup_secondary_cpu(void) { } > static inline bool snp_init(struct boot_params *bp) { return false; } > static inline void snp_abort(void) { } > static inline int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, > - unsigned long *fw_err) > + unsigned long *exitinfo2) s/unsigned long/u64/ > { > return -ENOTTY; > } > diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c > index a428c62330d3..5a402df7549e 100644 > --- a/arch/x86/kernel/sev.c > +++ b/arch/x86/kernel/sev.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -2175,7 +2176,7 @@ static int __init init_sev_config(char *str) > } > __setup("sev=", init_sev_config); > > -int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, unsigned long *fw_err) > +int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, u64 *exitinfo2) > { > struct ghcb_state state; > struct es_em_ctxt ctxt; > @@ -2186,9 +2187,11 @@ int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, unsigned > if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) > return -ENODEV; > > - if (!fw_err) > + if (!exitinfo2) > return -EINVAL; > > + *exitinfo2 = SEV_RET_NO_FW_CALL; > + > /* > * __sev_get_ghcb() needs to run with IRQs disabled because it is using > * a per-CPU GHCB. > @@ -2218,9 +2221,11 @@ int snp_issue_guest_request(u64 exit_code, struct snp_req_data *input, unsigned > ghcb->save.sw_exit_info_2 == SNP_GUEST_REQ_INVALID_LEN) > input->data_npages = ghcb_get_rbx(ghcb); > > - *fw_err = ghcb->save.sw_exit_info_2; > + *exitinfo2 = ghcb->save.sw_exit_info_2; Looks like you can do "*exitinfo2 = ghcb->save.sw_exit_info_2;" just before the "if (ghcb->save.sw_exit_info_2) {". That would eliminate the need to assign it in each branch of the if. Thanks, Tom > > ret = -EIO; > + } else { > + *exitinfo2 = 0; > } > > e_put: