Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp706752lqo; Thu, 16 May 2024 21:27:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGnIiPPIDTARzTxY6SSKKooD1JOIGWKhwSAl9z0bNOwSR1rBDe04W1yaZmnF7zxoOLEQPo1azuxGmilquiImTsY3BbNelxPDmRR4JbOQ== X-Google-Smtp-Source: AGHT+IG3gWuQtl+5XwsXRHecwp4iNAt+qNf8HSv1t0OYkdAkTCIUCPFzB2YVYkCKor16tzG40G8b X-Received: by 2002:a17:907:7d8b:b0:a5a:669c:286b with SMTP id a640c23a62f3a-a5a669c290emr1069882266b.19.1715920049810; Thu, 16 May 2024 21:27:29 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a1793c101si1002382166b.134.2024.05.16.21.27.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 21:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181729-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HIvlcR4J; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-181729-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181729-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 60EAA1F21532 for ; Fri, 17 May 2024 04:27:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7347D28D; Fri, 17 May 2024 04:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HIvlcR4J" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC014BA39; Fri, 17 May 2024 04:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=192.198.163.7 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715920035; cv=fail; b=bzIamCo2+2eba1Luo7Egm/9KKGFY//hkks9qInmFAafSb0tWquEcg/xTubE4PgYuRwevHaPLWGJ5IdEVcALvT4Fw6jlCFLdHlqBVVmFmsJOrGc2+sg5MzUEbe9I/5TF6lPY6eUc5Qy7cJRHktxUXNRiBk8xBxggO7hDyYsvvHvA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715920035; c=relaxed/simple; bh=9ikC6Q6CdOnMg/JlWeUuyEnE+reWQ3uQWw/OqeGdM4k=; h=Message-ID:Date:Subject:To:CC:References:From:In-Reply-To: Content-Type:MIME-Version; b=JPTvrozu6xsU+vGsICPUOWTZg7LCa41x6YeYVuZShtd6ATFIPCUtYuXUEZqQQwkyUaIeL1kz7yKxt67nuygqrZi8TW+ct+reVZyJa0o7W+E8DRV0VL3IMX83drRjObuN7v1gWgb0xwEp8Xo40qWnt8LUNttqIV54F4ggMbftDz4= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HIvlcR4J; arc=fail smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715920034; x=1747456034; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=9ikC6Q6CdOnMg/JlWeUuyEnE+reWQ3uQWw/OqeGdM4k=; b=HIvlcR4JQ6XtZlVHcIN38bkUkVBBv93XxXDgtQDbNBei3RafDx6eC1EX SeRdsGySqtxtdheiMeGQph+i8cr12joNPgVXunZqOVBHHZKgIaGAVChbw cd+XN4C00b5fdQIBUlbLEnS0iJzdw4bL8U0GQL1zIqgNQKIz0BLv5DnbX 6h7K8aFf27GUeFAJ1/gilmHT33l/j7VygyocoLS/nvbdRdqwTNN0F6laV nv3QX7M71oj3r9rljNVt+f/CBaTDiHwlIUMjzN7/zqVicxDmy0HicZbge KvPs2JovUUUtiKU+43xXE2OVA5h/4ZOHqzuAJNlWHTT73Ei6JJv938M+5 A==; X-CSE-ConnectionGUID: qOttc9ZlTHmyof7809Zo+Q== X-CSE-MsgGUID: nn2TaDYYQnu7jPvjOFbjAQ== X-IronPort-AV: E=McAfee;i="6600,9927,11074"; a="37456978" X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="37456978" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2024 21:27:13 -0700 X-CSE-ConnectionGUID: yrChIIs+RGSbuDU06j+LUQ== X-CSE-MsgGUID: qyqjt6zzQomef/wotS3Nwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,166,1712646000"; d="scan'208";a="31667509" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 16 May 2024 21:27:13 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 16 May 2024 21:27:13 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 16 May 2024 21:27:12 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 16 May 2024 21:27:12 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 16 May 2024 21:27:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cESND1nvbSzdvql0hZfWDp4QZxi9A2iDedavxQCCuXbDppl7CcarZVzcbsTrWkPJ747u4CppHb3g60U+YhYl6sjodnaCJ2bSEk1joX8t4mJLYgknyvKjtjlOP6Ltv5sidb4PpFsomYpOdZ1QeRhpc0pJD5CMeQk9jSdJGpwSHRLfwfyiMyqgbCiTHmEs+q80T6ddSBsnRneAKTEBt3kLRcFdK/2LdGhG5qCaomQH6Rmfe+8qkBLB8nOwP9losSAPd2Pn7Ar+dPN9HrdKcmqem4m/kO9KK5Pp30H/9J8HlA+0J2rETYWP8/sgjI8/gIm89oREOnzs0YiMP7T12FqX8A== 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=Fk3hjIV96zTIgtSmuAzXPooxlUoPHnfDfuEyVZDsfrg=; b=ObcOWvxqKl3xHfLC+1KtRHX0Enzy5LhqqF2vuD6wA5crQpbnwpvYigQiq2fKVhEtDyHR5gtCCwcdXekTub+QMer6NddPz/Vrlbb165y9kYiSPkT/YqaXo7M6LJrbZfHl2vT/e6wfiXGanMKm6ybBnNsSA/LSqaGMQQXa4htnaVyAN2GL1pb6/diL3HVw/yFNmXUJ8vAIVEgRK4O/fvPV3s6AVJKoe9Xs6+a1fU0V51CMbcKDP57zA1t70fY9lhvrF7/vx9EwPpDirXnFhZLY0z/K5E1Il9nYawJbUeQABhq5WJ12k3ywYrE5XZQBXbMxH8klDQdmZP00p0iUXcAA6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BL1PR11MB5978.namprd11.prod.outlook.com (2603:10b6:208:385::18) by DS7PR11MB7783.namprd11.prod.outlook.com (2603:10b6:8:e1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.30; Fri, 17 May 2024 04:27:07 +0000 Received: from BL1PR11MB5978.namprd11.prod.outlook.com ([fe80::fdb:309:3df9:a06b]) by BL1PR11MB5978.namprd11.prod.outlook.com ([fe80::fdb:309:3df9:a06b%4]) with mapi id 15.20.7587.028; Fri, 17 May 2024 04:27:07 +0000 Message-ID: Date: Fri, 17 May 2024 16:26:51 +1200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 04/16] KVM: x86/mmu: Add address conversion functions for TDX shared bit of GPA To: "Edgecombe, Rick P" , "kvm@vger.kernel.org" , "pbonzini@redhat.com" , "seanjc@google.com" CC: "sagis@google.com" , "dmatlack@google.com" , "linux-kernel@vger.kernel.org" , "Zhao, Yan Y" , "isaku.yamahata@gmail.com" , "Aktas, Erdem" References: <20240515005952.3410568-1-rick.p.edgecombe@intel.com> <20240515005952.3410568-5-rick.p.edgecombe@intel.com> <9f315b56-7da8-428d-bc19-224e19f557e0@intel.com> <307f2360707e5c7377a898b544fabc7d72421572.camel@intel.com> <465b8cb0-4ce1-4c9b-8c31-64e4a503e5f2@intel.com> <4e0968ae-11db-426a-b3a4-afbd4b8e9a49@intel.com> <0a168cbcd8e500452f3b6603cc53d088b5073535.camel@intel.com> <6df62046-aa3b-42bd-b5d6-e44349332c73@intel.com> <1270d9237ba8891098fb52f7abe61b0f5d02c8ad.camel@intel.com> <0a1afee57c955775bef99d6cf34fd70a18edb869.camel@intel.com> <9556a9a426af155ee12533166ed3b8ee86fa88fe.camel@intel.com> <240f61b5da5015a8205de414a87c3c433b1c09a0.camel@intel.com> Content-Language: en-US From: "Huang, Kai" In-Reply-To: <240f61b5da5015a8205de414a87c3c433b1c09a0.camel@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR06CA0229.apcprd06.prod.outlook.com (2603:1096:4:ac::13) To BL1PR11MB5978.namprd11.prod.outlook.com (2603:10b6:208:385::18) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR11MB5978:EE_|DS7PR11MB7783:EE_ X-MS-Office365-Filtering-Correlation-Id: 0919bd50-c268-4dfd-bbd3-08dc76299cbc X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-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FTlhmKzE3d05jY3pmcVRnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR11MB5978.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WHk1NUoyd3lRaElraFZiSXBPd1hDQU5iMWhTR2JPL3ZDY2RwY3FtOGQxMU1B?= =?utf-8?B?Tm8za0ZvRFd6T0wwaUlNQjB4cWtSY09iTTlCdUxQM0tYWHc5MlE2QVpleVVs?= =?utf-8?B?WHIrdExDMWY3aXV5QzR6VUhBY2NOckl4cHFGdEdJc1N3bGs1VEtGdlFURDJF?= =?utf-8?B?K0RMSDBMWjlMSHFBS3lkd0I3ZzZwKyt2cWNJbXpuSjRXbnEvdkM3VkNhZ0hm?= =?utf-8?B?Z1U3YmpKTysrRUxEa2xtaVY0Y2pkdC9xZ2VMNnNtMFFhc25zUnpJMUhCVGs1?= =?utf-8?B?VStNUmJGVmpoM0pKaVJsRTlEaVVyeFI1d1o5U044UjEyTWd0RHoxUVVLckhx?= =?utf-8?B?TEpXeVBOaXRucFBvMVhzZi96RE52N1NHeXhuT3gra3d3dSt0OGtMSFR1cXh3?= =?utf-8?B?OXQ2djE2dUhzenpubFQ5aUZHQTA3b3NFUGZGNllxWVVxV0ZOUm84dHlvM1JF?= =?utf-8?B?bG44NERuUmpwSnJaWCtVVkYxUUhRaEJ1WHY3eVNUUGNraTNhMGNZRlYyUXlt?= =?utf-8?B?VDkvc2haeUU0bCtQMDZWT1Z5ejR0VW1UWDBKKzdDZkh6NVpoZ09yM0Ftbjkw?= =?utf-8?B?Q1BuSnRpTk51OWpHUEFDQWozb2JvZ2hZVkYyanR2VnFpL1ZidVdkdjJQSmls?= =?utf-8?B?VHBsVFRabDJKZUhRNmhOckNh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YldJUXJlTXBiK3U0bWVhMHdYN3ZGbmxOY3hCVXlENXBtb2ZL?= =?utf-8?B?T0ZUY3NxYVJ4bldNcStkWk44eGRFMWFCYnM3aW5oT042RE00dWNaSUhGQXR2?= =?utf-8?B?VEFseGtoNVRtK3hybFE1dWJycmh2cEF6UEtVSzdIaWZJcURGK2lORndCQ2ZT?= =?utf-8?B?NmR5YTRRb2xadUppMHF1dDErd0JKOG5ZWUlvenpTYnVHeVRPdjhkTXY5Zzcw?= =?utf-8?B?SGdxdXpzS014SCtjUlY2Q1M1WEFVK0gyeVFBdmoyRlErT01GeXBvRkVZeEJE?= =?utf-8?B?NkxMdDA5MnR5UVV5T0tLSGZkYkF2UWprY2hSZUMrR3FDN2lGZ3RJc1dQcDZZ?= =?utf-8?B?ajVDQkJUczk3RTVsOWx1d2ZLQVFpRVZyMVBCaVFNWUlDdC9rSVpvMklVSmp5?= =?utf-8?B?TGhGbWY4MHRlN0ZQd2JtcUhoU09VeGlYbkY0RGN2NzQzYXgrbG12VjlpT2FK?= =?utf-8?B?Znp6SXFOTXowMzBEUFlRalEySzFobmVhZncyb0JsejZoZ3M3U1ZkblNHV25G?= =?utf-8?Q?yp9YEfsIr89LoRFNlYFMyTPfQ?= X-MS-Exchange-CrossTenant-Network-Message-Id: 0919bd50-c268-4dfd-bbd3-08dc76299cbc X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5978.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 04:27:07.6268 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rbRyvmY/QJ4xveG6/8xYFi1rH/t49SWfw4biFw7zVuBGJ0IUCoQJuH9O99miXmY9UY5lkMK1BfUetEqxx0jdKA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7783 X-OriginatorOrg: intel.com >> E.g,  why we cannot do: >> >>         static bool kvm_use_private_root(struct kvm *kvm) >>         { >>                 return kvm->arch.vm_type == VM_TYPE_TDX; >>         } >> >> Or, >>         static bool kvm_use_private_root(struct kvm *kvm) >>         { >>                 return kvm->arch.use_private_root; >>         } >> >> Or, assuming we would love to keep the kvm_gfn_shared_mask(): >> >>         static bool kvm_use_private_root(struct kvm *kvm) >>         { >>                 return !!kvm_gfn_shared_mask(kvm); >>         } >> >> And then: >> >> In fault handler: >> >>         if (fault->is_private && kvm_use_private_root(kvm)) >>                 // use private root >>         else >>                 // use shared/normal root >> >> When you zap: >> >>         bool private_gpa = kvm_mem_is_private(kvm, gfn); >> >>         if (private_gpa && kvm_use_private_root(kvm)) >>                 // zap private root >>         else >>                 // zap shared/normal root. >> > > I think you are trying to say not to abuse kvm_gfn_shared_mask() as is currently > done in this logic. But we already agreed on this. So not sure. To be clear: We agreed on this in general, but not on this kvm_on_private_root(). It's obvious that you still want to "use kvm_gfn_shared_mask() to determine whether a GPA is private" for this helper but I don't like it. In fact I don't see why we even need this helper. I think I am just too obsessed on avoiding using kvm_gfn_shared_mask() so I'll stop commenting/replying on this. [...] > > I don't think we can get rid of the shared mask. Even if we relied on > kvm_mem_is_private() to determine if a GPA is private or shared, at absolute > minimum we need to add the shared bit when we are zapping a GFN or mapping it. No we cannot, but we can avoid using it here. > > Let's table the discussion until we have some code to look again. 100% agreed.