From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.72]) by mx.groups.io with SMTP id smtpd.web09.17701.1655384978320792056 for ; Thu, 16 Jun 2022 06:09:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=omx9b/X6; 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.237.72, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/GOj8ha9hblFyuApeyWVrE5yDbuyCONUo0ewEkvGoN+OjmzPwvil/zDwsgdlLefut6a+FpyoTObwYdvJbe0RR6d4LIuDrRkkuGHvcBLiI+xDdQATYcoqotF0wt+4PUE1yolZVpJAA1FhvRE2LYAyi5PYVlCYInYsq7HIJSwWxwgAhEWU04MR1hj3ldiknn7baMqqijCeZcgUT+f+NuxSxnUmwzIRLKZay6pd4ddKhkEr3Hk/kg/OJg7uUW4pEWVVQPiXxODtBG5Wdee5dS9XLf41UeICFAWuvRsTzHDB+5zgZSse4+UFZO9c6qvsSk4N51SSMs0cUy7mG0ewm4RPw== 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=9PSaKlym5IUpVEIc64XnBZ6XIQgp92hpFvNHDd1yF0U=; b=MFVAaxaGhtCfxx7eQSLmXGuaVLMS9pwcTYq9+wYrqT939rFQBgsbkokFZ4qPKquns+iNZxzYThJAJUsfpKa2mPoWe5e9hSa4fM3iKauulgu+w1cw8mMsOk/NRnHn0aWl4Nh+yi4zrSlogVG/dEFcclgM+g6ALJBnRpNvWaokCK5lEXS+w4TY8QnIW1ajmubee4zDlkIZef+0qyOVK9KbuJIdhSx9xlSDLsull9tZjdjJI0lTEu2hRTvDGRsoT3wSQlIo/D2I4EhYsa+qyDqvdGedc0hUUHu0U5PBOeEnND7AMJMhayX7Zztv4zdg+mFUIhMtAY5SWlS1WvLN/7Aacg== 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=9PSaKlym5IUpVEIc64XnBZ6XIQgp92hpFvNHDd1yF0U=; b=omx9b/X6fl/08ir4YbtlS63TtyQLJRFt31KIeup6WpcuJudZtMBwRjPOqznEytMDIDEPdkRhpXPeejyTHp4M5Dxu7Llc7C8rp+fqFn1ZF3VMIYvoU+OsQB4I6Cl/eEkmA7uCogRpIvg47fDjViQQhLP65EPAMFKR5CiPSifKJQo= 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 MWHPR1201MB0142.namprd12.prod.outlook.com (2603:10b6:301:55::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Thu, 16 Jun 2022 13:09:35 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::db8:5b23:acf0:6f9a]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::db8:5b23:acf0:6f9a%4]) with mapi id 15.20.5332.023; Thu, 16 Jun 2022 13:09:35 +0000 Message-ID: Date: Thu, 16 Jun 2022 08:09:33 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [edk2-devel] [PATCH 07/14] OvmfPkg: Add PCD and DEFINEs for Lazy Accept page. To: Gerd Hoffmann , "Xu, Min M" Cc: "devel@edk2.groups.io" , "dionnaglaze@google.com" , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Ashish Kalra , Michael Roth References: <20220607104550.hz6c7etgxtksylwu@sirius.home.kraxel.org> <20220608061805.vvsjiqt55rqnl3fw@sirius.home.kraxel.org> <20220615080508.oqjojsevfxc4pw3f@sirius.home.kraxel.org> <20220616055117.vrlynishfc5afbld@sirius.home.kraxel.org> From: "Lendacky, Thomas" In-Reply-To: <20220616055117.vrlynishfc5afbld@sirius.home.kraxel.org> X-ClientProxiedBy: SN6PR16CA0043.namprd16.prod.outlook.com (2603:10b6:805:ca::20) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) Return-Path: Thomas.Lendacky@amd.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf789f20-df7f-4aa8-ea65-08da4f997602 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0142: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: c/oHoa8yyyO5kG/hd+uW+zmkMfXdnlLK6CUXo9Mg0ourNtNmkEdWcYCY1bprpojVR+8RlZEB62ALSsLnm9oyF8rXcnHbuZirZ7AoYgqEIs+R+kcpOY9Hu00uYywBonB0JJm/oFqGOqR5j5czWRhc9Hw6CbHr+3qsk9aAF9UrxCOMSIJYTyCak6Z7Or3zAf3Nvq1jgZsFT4aZnLVtGw5A9nQ+hEe4UJCB1Y6EmtA5uY5Bwn/yi0e1Zsgg03UYd+BTMMLuu2RfGKlWV7XkQc2KunBJWelZCvCKH5YzNefaLd4zFe3PhtzU2+V5bCwV/Ru9W5qNhp7Nx85iYtNMYDaLUjsu7D20xuaWayvf45WRFiiGxyQKel3zZZFQGnLSMwwxnhKj/TNmZVIinCZm43lqaBtWrZUAgU7Kph6rhqxlN6oj0kfI1x1AOTKUJ/TNQB2hYp8qcZu9d4ZpsAY1SMY80FHLvGlazEORqHa/NwYKgER1V5bt5R61ewx5surtuDmGmNfrpAnPAAh+vKaRWMbLAe/mLrkTmHD9NkDt87j38QtPlQdVV8hfZzcrNISdNVva6PQYZwulnuktxzeHiZ6zdTvnrnTzfebLQBWBbgYVr9Ctg2DetvvyB3E8s/7LZtLekvRjSH+nUeIGzFuhQsMDBZXYZwxOLzeEblk014C4ZboAbOPJrAXRC1ZMHvmIBQxTJMNb+xwCCnl1lm+QkMxwjAwhTNOSPfQWa+OwrxMmc6Y= 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:(13230016)(4636009)(366004)(2616005)(110136005)(83380400001)(26005)(6512007)(4326008)(36756003)(8676002)(66476007)(66556008)(54906003)(316002)(66946007)(31686004)(5660300002)(53546011)(8936002)(6486002)(508600001)(2906002)(38100700002)(6506007)(86362001)(186003)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SEdkNzRPQ0lBUHBVbGV1U3h5THBicFV2VUE5RXo5YlAxajJBTng3cDR4Q0dC?= =?utf-8?B?WjVkSlhGWCszcWNCR20va0VjRUtjd1NaNXdLUlcvanR2eC9jVG9SNUs1MG9F?= =?utf-8?B?bVdNZDFmMCtDWlRTbVJoQlRTRjFvK0huRGpESlZIa01qQ2piYXgrTEVUblV5?= =?utf-8?B?eUlOK1A4RUdzdUJKWkQ2UHJtck5JcnZwdFlLVzhIb2piZnA4ZUpmaklvZFBi?= =?utf-8?B?Yk50SDhaTEVyUFVpR3pQb2NrVEJEN1VTWFhkSUlC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NHSXFPTG1rQ3FCKzN3MVh5azBuS2tYVXlZTU9Y?= =?utf-8?B?THdzRnJjYVZLTmltRjYzNDFXeUZhVFRPS3FXbDRxNHl6WGJJYjF3U2xNdGZY?= =?utf-8?B?OEllNUh1SnRROGhBRHFFTDVjZGpwQU1DZTFaSEtXRlJ5aXJQNEZndVlxeDQ2?= =?utf-8?B?R3VNOXpCZnVoeXBEOUg4OVozdmlISzlsdkhzc0d3dGlyM0ZFNEVsRjUyTWhB?= =?utf-8?B?MTA4Qk5mOVA3RGpPdWg4MEJiekxobllreERaWHFlNHJxSFdLZ3dVdz09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf789f20-df7f-4aa8-ea65-08da4f997602 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jun 2022 13:09:35.6245 (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: FUWi8q6BkHP0ZtRMcPvHSE5uA7sf8Xw6cbdbONfznOC3V9uCPRTHhA/gEPmn1ItrpsDWQoa6Tr7/mmZZvLfzHg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0142 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/16/22 00:51, Gerd Hoffmann wrote: > Hi, > >>> Tom Lendacky's suggestion for SEV-SNP is to pre-accept all memory under >>> 4GB to make all that complexity go away. Only this approach worked in my >>> own testing. With the MMIO hole it's just validating 3GB of memory. >> Accepting all memory under 4GB will make the things much simpler. In this way I think the accept-on-demand maybe not needed. >> A question: is there some performance impact when accepting all memory under 4GB? > > That would certainly be easiest when it is acceptable from a performance > point of view. Will also simplify the code because you don't have to > split the low memory block into accepted/unaccepted parts. > > It'll be 3G (-machine pc) or 2G (-machine q35) of memory. > Is it possible to accept gigabyte pages btw? +Ashish/Mike - I thought I had added them earlier... SNP supports 4K and 2MB. However, SNP can support multiple pages in a single Page State Change GHCB request. This might be better than having to exit once for every on-demand page. Thanks, Tom > > And, yes, this might be enough that accept-on-demand is not needed any > more. > > take care, > Gerd >