Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp337796rwd; Wed, 24 May 2023 19:28:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4J4lqK/BfKhPZMj5vc4mpuGyw9EGfdvJFKWgKfZG4byigk8bfEViBLKjDIa1U8qi6XwYZd X-Received: by 2002:a17:90a:9704:b0:250:4847:426a with SMTP id x4-20020a17090a970400b002504847426amr60076pjo.11.1684981696540; Wed, 24 May 2023 19:28:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684981696; cv=pass; d=google.com; s=arc-20160816; b=FsvbuX+1coqnAILB5c1uW7krKp+cd10j8cDYBQUjWfC5HuEGhPhsc7lntcsw4lfV7d RSsfPsCNAVNceOqDN4cxFYGQv/KnR5gNCTCLk6pwiq+ahl/8+MSYHmEGTchWgUeQUj2u obhW8xIMfJPJo6lALm7PZw4j4rHhk58Fo7XhjaHXIdcFjMFQVMpFHykGCVhlbo6Q9lpg wu1s8eT3SklK36gMIKELI/yo6Jxth4uvpll46aBi1Gau/alA45BYPuYToH+3E0bc8bg4 CG0W+KpdEjxYIjgnc8LAqEJg0KP/v+YYrt2v2DoFS4peoNbWkZYqRRUq1EJtSFFtIBVT 9AAw== 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 :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=TVKiF/2l/MRuRFtF5IumgDeW/tPDoCMd0lhvBEPz+Bc=; b=yX22sQc+x9YEIHtzLI/NdwnZhh4XFJfLSuCnSpdoaxEWt2KP8U+ENUz++1Z8n+yZtY tp1+BawND6SEwsPxcioosO0/hFQS9xveeaZQWHQhWLRbEsbdzRWdf1AyOjBsfGuJD7HX TbtnKb8/Bw/vM+eMvE0oRhcywUQELJFcEZuajFqO5nM5XqvmhRntSDsYN6ziydNrhGNz OYmZBwjU1Krt1fHoL74U1JYiPHALywYUgywOTNUZaR+g4wU4kzoBTWDawgBtHzw0crxQ h4sOmUoMS/zrZuctj85UORT5CTHi4YroRBclyPvswV/nxqkpLrVkKtkISvWEkigVgr8h SC6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=W5nt2RS6; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a17090acf0300b0023d3fad2294si445894pju.10.2023.05.24.19.27.38; Wed, 24 May 2023 19:28:16 -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=@microsoft.com header.s=selector2 header.b=W5nt2RS6; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232889AbjEYCG0 (ORCPT + 99 others); Wed, 24 May 2023 22:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbjEYCGZ (ORCPT ); Wed, 24 May 2023 22:06:25 -0400 Received: from BN3PR00CU001.outbound.protection.outlook.com (mail-eastus2azon11020026.outbound.protection.outlook.com [52.101.56.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E274D3; Wed, 24 May 2023 19:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F+ZiD8EjafPQyvHt1JT+jcyaWu0+M7shjUY9AjBxlIAUiV7hlVOImGlrxXylX1DIL6edp20xbQSnEMyqolYUeDjfVA3FzfINGwCoHuZTqN6zEGhPRc/PEILjyt27P1lj3DBhpKb+bdpp5MlCtksaEL6BqQzojkq6UvsSxPLIbKRUWX7ZpCRaOfYKdZAu6bGfHCijc/0o8jOgjWjuPp/AYiBiDQ90HW3CHvA/OLnn0IGuiyQ5tBP78+QJtt/pedz642z4IANxBHbCjGLQum3SqcAqO/wgLWYBpFvMvtlGxrmXA9U4WoTPskHyEZZccnhrbXI2Y53uUzj3eJYEKtsH0g== 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=TVKiF/2l/MRuRFtF5IumgDeW/tPDoCMd0lhvBEPz+Bc=; b=ldUWyT2zOxgFuykUfayz9UQOjhl6ONahQ+k+e2EFSZ+0Y55gL1CAx7u24tbU6aeKuUyJ6xcqAUS+1JAQYYVj5AexL1xqYnFzedE8G+tsToJTCEDNOpcKHSMe5+aLvVZmFioDsmIfzN2t2sYHyMoHrxxBk1IVn4A2/qIviqw/PDIxtyzlEFLpx2+QeC3jLJTQjQMgWYLZ12YZUfuhVZoFPtlDp7vOf5I/+cShHPjsG30xJqzbVk++tE7zp84XNWakSLzloeIWbv8HcmXfmigLWQUz87kBDcgfHSqPW96jm4vsBo/g1izgh6XawQb8ifkNw0QJDDi7q3PwkEracZg8zQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TVKiF/2l/MRuRFtF5IumgDeW/tPDoCMd0lhvBEPz+Bc=; b=W5nt2RS6W7t+PqZTVND+2iSDIWSN6hvBbolSk6nx8nQgrDfjv4MtQ50XUwxJx1hPld2kr5frgpoX8ZWQLYH+L1BrcjzA75GWS1YKAt8FCPSiVGQ+UQNa1XZWfgjvmXV9JwX+d76H/vBs2M4We9dhr98rvVk6oTEid/WbXrZmaGU= Received: from SA1PR21MB1335.namprd21.prod.outlook.com (2603:10b6:806:1f2::11) by DS7PR21MB3340.namprd21.prod.outlook.com (2603:10b6:8:7f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.13; Thu, 25 May 2023 02:06:20 +0000 Received: from SA1PR21MB1335.namprd21.prod.outlook.com ([fe80::c454:256a:ce51:e983]) by SA1PR21MB1335.namprd21.prod.outlook.com ([fe80::c454:256a:ce51:e983%4]) with mapi id 15.20.6455.004; Thu, 25 May 2023 02:06:20 +0000 From: Dexuan Cui To: Dave Hansen , "ak@linux.intel.com" , "arnd@arndb.de" , "bp@alien8.de" , "brijesh.singh@amd.com" , "dan.j.williams@intel.com" , "dave.hansen@linux.intel.com" , Haiyang Zhang , "hpa@zytor.com" , "jane.chu@oracle.com" , "kirill.shutemov@linux.intel.com" , KY Srinivasan , "linux-arch@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "luto@kernel.org" , "mingo@redhat.com" , "peterz@infradead.org" , "rostedt@goodmis.org" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "seanjc@google.com" , "tglx@linutronix.de" , "tony.luck@intel.com" , "wei.liu@kernel.org" , "x86@kernel.org" , "Michael Kelley (LINUX)" CC: "linux-kernel@vger.kernel.org" , Tianyu Lan Subject: RE: [PATCH v6 1/6] x86/tdx: Retry TDVMCALL_MAP_GPA() when needed Thread-Topic: [PATCH v6 1/6] x86/tdx: Retry TDVMCALL_MAP_GPA() when needed Thread-Index: AQHZjbtoOY6hB4AsVEWN3dq4K3z1Ba9qK53Q Date: Thu, 25 May 2023 02:06:20 +0000 Message-ID: References: <20230504225351.10765-1-decui@microsoft.com> <20230504225351.10765-2-decui@microsoft.com> <949f953c-f36c-b421-5132-353e2d373413@intel.com> In-Reply-To: <949f953c-f36c-b421-5132-353e2d373413@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=4177fe5b-59eb-4b83-8e9b-b75f8465b2a1;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-05-25T00:55:03Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR21MB1335:EE_|DS7PR21MB3340:EE_ x-ms-office365-filtering-correlation-id: 0291f7d0-5f03-4a58-274d-08db5cc4a1d9 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l0U0fD/nAdDye2rkZWT238jutAjwo0FQxj1A1VI8dIYyMG4TpxBtia8i94c8CBruYwl1N3hgLTF8BdXNcE2p91c4j9CyGKOUpqtkYor7Y8TYH5rBtrdrtjNqdG+wk1yeKDtbiNYKoPmHdkfgFOA8C9Saach6LnnEvlUmWjkENIVtc3vNbChXIV7k0GN27I5jhIBmA9K4vQnucBwOJw10tS9FMFbpod3eaWr/hh8oq2fv8Dr5QRSjFZOi/mmB2PfdqCtfk7nFc130K111K5OFPvNfagua57L08wpeDOBUFoPoRKg04FOUz60mBtZSUKVpySI7mCL9LTAkJqI9QvSuZvG3f46MzbOsjV8B6jbyPkca9QVvdR+tA7LDyDdOMy67006Orm85WWfWLs/LXK8stWxdSjFkjKo3aFymVaI8IeiIpGaRBVfIrmJU6nfUGUknqAYCG+DMmMmQ2B/dwDRYWJ14vGOzZe0tvUaUEiErlASVYIUafJOR5qviHd1KPklUHphbB7AkfqKwTLCXXGIDY7+CmW+hqI7GTrCWvITu9ABBNiE0Z96qVU1XXkFV3wY7MEegzphpkH8OP/9krxVBwK0Dt6WLCq5z2UfggLkVnHZrErZjF9bOlKiL7SwzSkdDqVoFSLij1ELXyOeJaSMMnzV2zxWynsKvv/BjgAdpOUE/7Kk4WESl/a2j/VT073Qz x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA1PR21MB1335.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(136003)(346002)(39860400002)(396003)(451199021)(86362001)(54906003)(921005)(122000001)(110136005)(83380400001)(10290500003)(8990500004)(7696005)(478600001)(66476007)(66946007)(82960400001)(66556008)(64756008)(76116006)(66446008)(82950400001)(38100700002)(4326008)(6636002)(71200400001)(316002)(786003)(6506007)(41300700001)(8936002)(2906002)(186003)(26005)(7416002)(8676002)(9686003)(38070700005)(53546011)(107886003)(5660300002)(33656002)(55016003)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?M045YWdMdWM1dF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=?utf-8?B?OTVSRjZXY0o0VFZzS09iT2o0aTIvVExtNTl3NHRoV0xYc0ZSekV6Umc2cVY1?= =?utf-8?B?SlJBMVNNMFIva25LRkI4bDcvdE5paVNKL2VYdWhINWhJRnVOVHk2a3NvNW9t?= =?utf-8?B?M2lNekY0dTFFNHBqQUVablBRQmxqcFFoYnE3d21tVTRxbThoVk9mY0U0ajZI?= =?utf-8?B?bWpCTUxmOE03enBjc0NibENtaEhHMklJQTc3VDRvWEVWYWZGa2c0U3FwVDN2?= =?utf-8?B?S0IycUEwR21PMGx2TUlhOTUzT2k0b1V4K0hLQWprVkU4b2RVTHQ0cXFKa3pR?= =?utf-8?Q?IoiapqbYn64NHPMWjeFdLt7BM?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR21MB1335.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0291f7d0-5f03-4a58-274d-08db5cc4a1d9 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 May 2023 02:06:20.1709 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RW36V7bxpahZrGRF48H32Kq2G7nLl09Ku9qp0gQydxEBvBP7udaFrO+cAni2LvEesrJ4ijKGXwlwH/1kHO9GYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR21MB3340 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 PiBGcm9tOiBEYXZlIEhhbnNlbiA8ZGF2ZS5oYW5zZW5AaW50ZWwuY29tPg0KPiBTZW50OiBUdWVz ZGF5LCBNYXkgMjMsIDIwMjMgMjoxMyBQTQ0KPiAuLi4NCj4gT24gNS80LzIzIDE1OjUzLCBEZXh1 YW4gQ3VpIHdyb3RlOg0KPiA+IC0JaWYgKF90ZHhfaHlwZXJjYWxsKFREVk1DQUxMX01BUF9HUEEs IHN0YXJ0LCBlbmQgLSBzdGFydCwgMCwgMCkpDQo+ID4gKwl3aGlsZSAoMSkgew0KPiA+ICsJCW1l bXNldCgmYXJncywgMCwgc2l6ZW9mKGFyZ3MpKTsNCj4gPiArCQlhcmdzLnIxMCA9IFREWF9IWVBF UkNBTExfU1RBTkRBUkQ7DQo+ID4gKwkJYXJncy5yMTEgPSBURFZNQ0FMTF9NQVBfR1BBOw0KPiA+ ICsJCWFyZ3MucjEyID0gc3RhcnQ7DQo+ID4gKwkJYXJncy5yMTMgPSBlbmQgLSBzdGFydDsNCj4g PiArDQo+ID4gKwkJcmV0ID0gX190ZHhfaHlwZXJjYWxsX3JldCgmYXJncyk7DQo+ID4gKwkJaWYg KHJldCAhPSBURFZNQ0FMTF9TVEFUVVNfUkVUUlkpDQo+ID4gKwkJCWJyZWFrOw0KPiA+ICsJCS8q DQo+ID4gKwkJICogVGhlIGd1ZXN0IG11c3QgcmV0cnkgdGhlIG9wZXJhdGlvbiBmb3IgdGhlIHBh Z2VzIGluIHRoZQ0KPiA+ICsJCSAqIHJlZ2lvbiBzdGFydGluZyBhdCB0aGUgR1BBIHNwZWNpZmll ZCBpbiBSMTEuIE1ha2Ugc3VyZSBSMTENCj4gPiArCQkgKiBjb250YWlucyBhIHNhbmUgdmFsdWUu DQo+ID4gKwkJICovDQ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