From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.57]) by mx.groups.io with SMTP id smtpd.web11.8889.1624460552442876810 for ; Wed, 23 Jun 2021 08:02:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=BZkl4Tm7; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.57, mailfrom: ashish.kalra@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V63jcrhF53iaRvwme2K1xm7b7BWtwEUqyjaNiDXJxvS0RQVFGbgUbOg4eA54aIDMXbaw0+rQc7lZ+W5e3nPQTSmuBJb6E1PyV6hsqn/vXAMooUW4g0o443fiPah1BXPNcc0XVlEy0DHvi/0ihQTsJ5d+rU5aUZPomPISuxleyQYsVAO8wnRxNaT1npdOryRIpiE/roPqhv85pUbqToR2MgxsbToKOYp7h26WmBEwry1/WffkHzlBLoDZxVjgpt4tNqE8+ZxWCHVy79y6kHAppueqMI9ndFUAkocsc3yyRNjccmAO90IEinCmy2VzV8YWilQ6w3kewjYVvpeiLmLY5A== 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-SenderADCheck; bh=EFTZM9VIksiBBOVksEiLzB6Oyn0cfcdgysun15u1s6c=; b=iiEwzCSaC+msYpu5pywY2pNcvw1jqYyNAgY0ydI+eq2QTPllcrcV36NpMHaHaQ0/WeQdf0jxBrJvkh82lPSYoI/paJD0nN7ADTgEc0gHabYcluQTyjaQ6fGLaBOuYy9qwD/oQUnfqBR9clYhQMSxOwVhbXJLJ6Q8cCqO39Jq/8QEXrOq486EMYa3VSCESFAO3tqrCgz0zD5xHmDhs37gOfs8rIC6KUSk9Gdh3QmcNlI+tDtPxCIPceHPFiDtDY6QaqnNuptJ24OpWsInQ6s3SbL+41oSy0oXItMZOWLhdbnWTaPBasACU9/RDPCXSBlelbiv0HsAK+XO7KxzgDPWBQ== 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=EFTZM9VIksiBBOVksEiLzB6Oyn0cfcdgysun15u1s6c=; b=BZkl4Tm7P/XsiVRLw/IaA3HRwv0pFdi0ULSCSrokWwxNuT+ILF/54ulU+JTbxrr1m5rGtNcX/S8yhGEn+R0c+87Sher1J+uaU/xd+aFkD0PSIlPlyEDwiXVYmtalM270pQIrxzPe1C6yAwRvh3WUxEJmU9B4GvsBZiYBKU3PhTQ= Authentication-Results: amd.com; dkim=none (message not signed) header.d=none;amd.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) by SN1PR12MB2512.namprd12.prod.outlook.com (2603:10b6:802:31::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.23; Wed, 23 Jun 2021 15:02:30 +0000 Received: from SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::958d:2e44:518c:744c]) by SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::958d:2e44:518c:744c%7]) with mapi id 15.20.4242.023; Wed, 23 Jun 2021 15:02:30 +0000 Date: Wed, 23 Jun 2021 15:02:25 +0000 From: "Ashish Kalra" To: Tom Lendacky Cc: devel@edk2.groups.io, brijesh.singh@amd.com, jejb@linux.ibm.com, erdemaktas@google.com, jiewen.yao@intel.com, min.m.xu@intel.com, lersek@redhat.com, jordan.l.justen@intel.com, ard.biesheuvel@arm.com, dgilbert@redhat.com, pbonzini@redhat.com, tobin@ibm.com, dovmurik@linux.ibm.com Subject: Re: [PATCH v4 1/4] OvmfPkg/MemEncryptHypercallLib: add library to support SEV hypercalls. Message-ID: <20210623150225.GA8080@ashkalra_ubuntu_server> References: <7d0a30a022a7d3d3e056af8f79b87ed9991d2f52.1624281247.git.ashish.kalra@amd.com> <20210623014747.GA6881@ashkalra_ubuntu_server> In-Reply-To: <20210623014747.GA6881@ashkalra_ubuntu_server> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN6PR01CA0035.prod.exchangelabs.com (2603:10b6:805:b6::48) To SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) Return-Path: ashish.kalra@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ashkalra_ubuntu_server (165.204.77.1) by SN6PR01CA0035.prod.exchangelabs.com (2603:10b6:805:b6::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.18 via Frontend Transport; Wed, 23 Jun 2021 15:02:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f54850a1-ac5a-4b27-d93f-08d93657ec71 X-MS-TrafficTypeDiagnostic: SN1PR12MB2512: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hbJV3kKpzDiF0tucLCJxBkizwEqXz0bNO7Gech5j6xC68E+TXVLuOoMnW0OJYi5L6XMlFNFhSqoZOaIG/UphfH4aEdH0OwoqNEIVFDdmBTJkcSboMSI93EJddM9hMTXWookOZ/R3vybed2T8er5O8d74YYZRX5cSuCfsR8zsd9/BaH5OdtF6kVzg0RoGtaBm6VM4ftPbUeRPtOJ2/TD3chRo0armfQmhf6V4lS7U2u/pqDkTBi6c/8txM46FMZEhnCMIvJg5j5MdH6fbLq/CfYtVsyXlbIb8qVrNvotkMiKLAdWiS32gNESaRkZkcwI4UGwh1csg2m3B5G+jpBvF6+zdDRwQ131MzSY08Z0e7yjS2eTsgq3q+gSXn4pYzXtod+fofvvgp31CvH0rSbN5TOhQKiAd/I8HPyMdYNuNabu/ynrDleHelGZgca1Re9h+9yEmDEOeOPXwiLFEwKYq/PzflS/zeLEaTQvo9V8XB3rIsxU52EnBgjaKwTy1uDy6aCGF0HGzopiqKxc1Ac4B2LG3RlXlQ+5VC7Kk6MB5+ZCnkgxExVGiII6gKqxjLL+ubtsmi3pgsYukAjOliqgKBLnT9Kzzxs1kqqSGrhjVOUTY3n3KGMfiRRb7eKtpciwpYv6E0Zhuga6tDcBp9/BXI32idY4WN9ncISZ9odPfbj9LG2woT3g/YpMNSdZ8S92mb0J250b5h0YuouGKPvcudg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2767.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(136003)(366004)(396003)(346002)(376002)(1076003)(4326008)(7416002)(5660300002)(6862004)(66946007)(66476007)(55016002)(9686003)(186003)(44832011)(6496006)(38100700002)(26005)(6636002)(478600001)(66556008)(33656002)(316002)(38350700002)(2906002)(956004)(52116002)(33716001)(86362001)(16526019)(8676002)(6666004)(53546011)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?s7iIwgS0H54Hf/X2zQtJUrly5rP5pEILgI7RjDATgJCuGxpggeTgN9og2v8b?= =?us-ascii?Q?jbF0IjqgFrGT8wKIeVCawNNey5swSHJIO0yPaLMZpv+MWGBTBCOs+W5g8Drp?= =?us-ascii?Q?J9FkGcWAjgNZr4zYy+8NK+afmG2kjRA92WUjzTfgLZLAx6wOcxOHYgM+6tlg?= =?us-ascii?Q?RyScBPRRcGBCGcJV/BSIcey6dnhTb++o6iJiF083Wqu7TDfxO1Z7GEDTi9qV?= =?us-ascii?Q?s1GKG4FMnLt7QFitBO5w0z2ekxTw29z8nyU4oIVKh6LSNvFBagLcb8fZHMBf?= =?us-ascii?Q?QRc14koeGNFUc8ZUN8CoVcB2oMRie2sCB3Hf+0Jt7oFj9m3cZt68TKALHsrE?= =?us-ascii?Q?4J1Vf+jOWlh42htC/fJwSohdWaH0SzbPzfiUWVDGEZc+ie/1lmKzMWTytx33?= =?us-ascii?Q?aKViXZrh6ytlglXPfra7bFvgN1MxOocDMRvJO0Mgfe/uMDHFSM6pKUnlM64L?= =?us-ascii?Q?xaXoDRIRnYnHF5H7w1wi5wopVcOIrYzyC8yS2RrOgJ8UEx546k0i641YTvli?= =?us-ascii?Q?ugO/hJLGI2kohe5xWBBPVUXjP85A2qngMEguiQA+SOUt09/3Fx3mqn9ApBa+?= =?us-ascii?Q?UaV3UILeBXlHLRhgxs/ecoOWRIhKICqurOlvl5YYvDlLOklZl/6oNpArvL5c?= =?us-ascii?Q?qDpi0+9t09iPQ/oZMbhs/VljaLShVfydKWLWYEdrrFoLn8baN5FLt20V55bn?= =?us-ascii?Q?PkeuW1SLw3CGct+kprrfZLvej57EnTA8uzjQ09pf5zYIIciAmhu2ksi7px3f?= =?us-ascii?Q?CNTLTdVOf/uojIunSMey2kmMJSCcUx3DurYmbjirqMtJK4uPKRSGKbjEZM7G?= =?us-ascii?Q?y/AT78uKP8qxT3cjBoxbt8qZIfu157YYyJFQAY+BMDgl0IQoC1iHKCt7rrgN?= =?us-ascii?Q?uPXvEgQxB8L0HyV8BMWEqft9h7R4mhEGQw/6hQePrx6axHb7ZIuDsfQq/0O5?= =?us-ascii?Q?9RYM0Xp0fo9QJFjOFux242zuOrx29kNk8LnYF3DmtF/9WunO3SCH7UPH6lSY?= =?us-ascii?Q?e51BH88640k8nKTgXFnLxYChFt5axrBgOPDxj40LfuEZqbVAsMSTcpD7ZCXV?= =?us-ascii?Q?XRhXDtl3xeaSyC/o4F/X6UZim65eESZr1Awe8zAq61j/H2ytXRFyOokPl0Jy?= =?us-ascii?Q?UdLVYe1/p1/re1Xg0dwLxqjQgk/Ukjeb7/C7pN6vD8c01A3fJ/mgzjtedaGS?= =?us-ascii?Q?ohMWcpsY1XqqOmuN4C5DvoC3bHiddDGAGT13eTmfnPw3qzYUDVyFUF92D28/?= =?us-ascii?Q?J6idirY+uYryoGoor/LXCfhNMWDIdcgM8FBz2yAuOh67c1jXiTrcSi1DZOiE?= =?us-ascii?Q?8YMhY8yovwMv1SFPAwXBSrBS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f54850a1-ac5a-4b27-d93f-08d93657ec71 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2767.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2021 15:02:30.8193 (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: dFmt32zeGvc1dmWqFya6FRD/jEVchy16jBrn90PX/MpSxMua0PRhV6AjElkn9L5Y4PiP8dUW6kNMOb5XQe2v3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2512 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello Tom, Brijesh, Thanks for your comments and feedback on this patch-set. With reference to those, i will remove the new library and add the hypercall function inside BaseMemEncryptSevLib library. Also i will let the hypercall handling for SEV-ES be done as part of #VC exception handling in VmgExitLib library. Thanks, Ashish On Wed, Jun 23, 2021 at 01:47:47AM +0000, Ashish Kalra wrote: > Hello Tom, > > On Tue, Jun 22, 2021 at 05:47:48PM -0500, Tom Lendacky wrote: > > On 6/21/21 8:56 AM, Ashish Kalra wrote: > > > From: Ashish Kalra > > > > > > Add SEV and SEV-ES hypercall abstraction library to support SEV Page > > > encryption/deceryption status hypercalls for SEV and SEV-ES guests. > > > > Does this have to be a new library? It's just a single function and so I > > would think it could live in the BaseMemEncryptSevLib library where the > > change to the c-bit is being done anyway. > > > > Actually i like this approach, instead of adding a new library. > > Again, IIRC we had discussed this internally and then decided to > create a new hypercall library similar to Xen, with reference to > the email copied below : > > ... > Xen has support under Ovmf for a Xen hypercall library > (OvmfPkg/Library/XenHypercallLib). Take a look at that and maybe create > something similar for KVM. > ... > > Thanks, > Ashish