Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2530439rwi; Fri, 28 Oct 2022 08:07:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM60LPXt6dil8+7QIPUdoecKYJpNN9bBDCZBs55uaXHIkVKoJkmpsrFseXsPamj0GV4Dg/q/ X-Received: by 2002:a63:d241:0:b0:43c:474c:c6c6 with SMTP id t1-20020a63d241000000b0043c474cc6c6mr47476749pgi.523.1666969669591; Fri, 28 Oct 2022 08:07:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666969669; cv=pass; d=google.com; s=arc-20160816; b=VnKfzj/4iJ+bhABrfInn7bQua5DIdQDjySWnwHAjxr7ETvylrSo1yGT5I9Jw6y+4Zn zjU4J5jcjN0fgUgyXZPee2iy2git6vOAQRLg8AZcf8a7vXTY8jGvwhJkz5BwYang/EU+ 5Z7eKrU63uQrGMMYE/OMchLCDs+BDMeHQnRhYwoN2PlBlz8S8m1dHTnJ874GJ2iixPA4 q49nGKvpyXZBRrX4C0q3j9dnmcGpUUTkt9IlDk5+xQl+ggQoMJHFfhnwZfbrvaM1hCoo V4cps1KHM1ZEyHRUxELc1tI7mL4sxMItSzwYXZoRGepVKObDC8ioDpbhgZu5vhCcT60i bfwA== 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=Tkorc6DWHSXuVsl1CaeLj67JnqOdaJ6NBI4GE4t3wGM=; b=wQPh21mvmvNovui5mbLGY4J2XfXVitM6DwobhAk2eNGVKgj6qxRRcB3qXVSlwOVgra e1pc9ZRC+7wUgoFIMYIIDoF+OiTpYkomgyYIIl0yP8u7M1vt091MDH4P5QJ9VdSjrORO i6Jpbej2CovpyZ+Kf1oX9yUdupQ+51VIg7z763WxSUaDUkDovLfdDt9+W3sVIcMY7EaO zEFsdyHIedAJxdAjTQfqUjHll/MOiMyNljgkVjao7kYEBgFRLYS7oMfDRwR72gzZjueK FL5SV9gw4ptlQsis0b8PHdBuBcf6xgKMrtMGFF0KO2wthXAwS9gOaG6FdFi/4PXs5hpW dCUg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=1vFkM1av; 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 cw1-20020a056a00450100b0056bbdb48fcdsi5201425pfb.118.2022.10.28.08.07.36; Fri, 28 Oct 2022 08:07:49 -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=1vFkM1av; 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 S230344AbiJ1Opa (ORCPT + 99 others); Fri, 28 Oct 2022 10:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbiJ1OpQ (ORCPT ); Fri, 28 Oct 2022 10:45:16 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2052.outbound.protection.outlook.com [40.107.223.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A16CE371A8 for ; Fri, 28 Oct 2022 07:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Onm7o8fmgtdxO7qeiTJ4hxIRYO3bBJY6q6l3OtQwkqtVdPVpfF+WfF7d9WBD7Z9Gpv5PQ7DeyYSn2TRQiGMcbwBP2//O9huuH10lPxvrU0+x9NzX7HLGVXty9AUu8onkQR3m4fksf9AMWWMg0jhAxk2UyQkC7eBRjMX1VD5M4i0atbuT7/Qal/4NqqyDyIRjXjzCuAaEdibhrIThwgfLoBFbnvqKHd5xNH9zC7Nt4TXcgxpQ9Qayk1PNKU22xulo6Y5pR+lYcHcxJVIYmLahXc+q4Kdwj8wyu9Dx/T7IFiA1g4cvGIjPefxTxpBkAAFbngNZQhWcNefWYTe04myirw== 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=Tkorc6DWHSXuVsl1CaeLj67JnqOdaJ6NBI4GE4t3wGM=; b=fwWCOCttIlg8x8UMy8XYNUGn4YFPhlv2CvS/OBIGfyBc+wTwV/HijVhLje8T30RqSnyF2X6QvCE4ZzlKlUA12+n8wM3HckvUE8qXbp7++Iw/eBddN4JyxhR6svO8/boZrgn8Cus3+BFoD2WQoVdYLdMrITRfPoCe4F4hdXFQXWEyv8AslpLAfWlOnpSSU2nJDaIVl/yfTKJ1HlDbH+7kTNR0K1ymNnzzPaMv0eD1mOrFP5s7E5P8T42UmZOpmhzAAL7vyIumtMXgPsmhkXf2kEJZZEZFjkRLYQBEg/PkIkscPnamJ8pqXxd68nsE7X5Z8bFkN7jQ0hRjwqQP/10ICA== 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=Tkorc6DWHSXuVsl1CaeLj67JnqOdaJ6NBI4GE4t3wGM=; b=1vFkM1avWSh0oD+MIkvBXHakFDv/naTVF7TEWx7iaU9tTKVEmjhEGR/8rgyVAd+s2RWbGJhNaU4BMp2+cEET0iiqow85GXkAiW5BHvGU1AoqO+yyc+EavQEx9mdfgD7DBzVW8s3HOcIJy9tdDC8U5g5EBjPsQg1AFPq37JVUXxI= 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 IA1PR12MB6260.namprd12.prod.outlook.com (2603:10b6:208:3e4::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28; Fri, 28 Oct 2022 14:45:12 +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.5769.015; Fri, 28 Oct 2022 14:45:12 +0000 Message-ID: <3f1b0015-9393-a441-ce5f-79b39c3e8ee7@amd.com> Date: Fri, 28 Oct 2022 09:45:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v4 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: <20221024224657.2917482-1-dionnaglaze@google.com> <20221024224657.2917482-3-dionnaglaze@google.com> From: Tom Lendacky In-Reply-To: <20221024224657.2917482-3-dionnaglaze@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BL0PR02CA0119.namprd02.prod.outlook.com (2603:10b6:208:35::24) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|IA1PR12MB6260:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d880e24-cecc-447c-ceac-08dab8f30499 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l0d3bnvanVOKItuVM8OEvr0NM0Zx98Lr4wd39p8ftdmK4TSo9fWEDgqE050ydC2LRlmtB0PuSx3vZjFW9Qn6JEZLAQzH4tLLMpuz7ynzPtP9B1jGg7ktKwfrjNHprUVS4Q+9FLPqsPzl/ULJXkiwkh/x2L68M7GfqPuoWNbc48FahU25I4uVFUMz7+TJHQp17a/GF32yMUU/J64nCugNrYeOFWNiflqCZ699X19K/yhztg0DAxNKoQmYduxHrv+Zwq7gowJFrVxsqfBjHJSFCqPWb0rhnfHbc0K0zkssXNsaSolsC3LbtjlTqua4h5IUagcrul+lWiNiLXc1wuRYoIkGAmtXFTbZy5irQ8KNC5dMRIrBLxX8dzZm0DHRyGGWb4OowCQT4Fi1EqO1PJmV9u5AXkJXCSEnDJorDHjgUrR2lT4EjhSG1ewqEiQ4vCHU0fXHxr4bodcklJl0DqcfL3QC7KRGeOwtGr8ic2gXVzwJcrQFmX60ue1UbrGinFnQcDWEJ7zGsekGv0vEg8N/EPhg46VJgAAiC7NKhSGvIx0zT59IHQm8oFUSo9WogMgultZMylhHXMkVgCs38+XA/BVmy/u8ADqu1Pq0KZzw/3xL9XgolCh8MsBmy5TDtv1F5/gLvwfE1M8ePy4Q6z4f9b1d70ZVBfWzax57+sifFVTce/ObMtIn1g7sji7Tuy526LYG/xFYrXvVN1bIC2j6J4OrokpQZgkp/UhHLQOhTCQi58bEkXBD8AbkuDUBQdHkwACBMxrMUXDMg2GU/AnNiy53YD/P0efuCKOu7MOQ4Ak= 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)(346002)(396003)(366004)(39860400002)(376002)(451199015)(31696002)(86362001)(36756003)(31686004)(38100700002)(186003)(53546011)(2906002)(26005)(6666004)(478600001)(83380400001)(2616005)(6512007)(6506007)(66946007)(5660300002)(54906003)(66556008)(6486002)(8676002)(8936002)(4326008)(41300700001)(66476007)(316002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SXIwOGpPMjR0Ynd4QTBZWmJOdFpUSWdySkZoNFBlUXVGYTBiQUVTRTZCMEFz?= =?utf-8?B?UkdTV3JEdDFaQ2hiZW1naTdHR1FVMExTNkRVMHJxL2hpQzFJT0Vud1FLazNB?= =?utf-8?B?dTR0OFZvbnVadVNkNmlTNFlrMHZHeW1jMjlDa0RvT2kxbHdyT2gvQi9RejEr?= =?utf-8?B?MzkxcmlRRS9zb2VXZWJ2L0k2Z2ZSTlU2eVNzb0ZNay91N2pUK1dwL0YxVjEv?= =?utf-8?B?S0JiUXZUYVVmRjZQSWNrVmxaK0tQWlNrWFYrVC9NYi9YWHgvb3p1ZlhyTXpa?= =?utf-8?B?UDY2cVNzK0lUbTc1NWJWN083c2xtNmFBYzRFZHd4SlErQTVUeUJodGpwdUUw?= =?utf-8?B?WmVZRkZpTXd5TWtUa2JuaHl0U1hDV1kxUFJxU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ab8f30499 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2022 14:45:12.1348 (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: F//uyaekQT/og3S2EBI+BCUirDH7SshiL08ZF3CRv4fMBMK3qNwTi+SMe+tDpo6GJBzMOIXNwjG3iZHbce+6Ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6260 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/24/22 17:46, 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 Reviewed-by: Tom Lendacky > --- > arch/x86/include/asm/sev.h | 4 ++-- > arch/x86/kernel/sev.c | 10 ++++++---- > 2 files changed, 8 insertions(+), 6 deletions(-) >