Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp434962rdb; Mon, 15 Jan 2024 02:00:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGLjmwy3cn9lDYH5MYKDTSFsKJGkRAUTe5WVZpshi9IRgstaFbCrqrRxHAVfXTl4DUDq5rJ X-Received: by 2002:a17:907:c709:b0:a2d:221c:f644 with SMTP id ty9-20020a170907c70900b00a2d221cf644mr1736094ejc.154.1705312830199; Mon, 15 Jan 2024 02:00:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705312830; cv=none; d=google.com; s=arc-20160816; b=lEzOKLj5pqi3X/Ng+4p5REwS9eBA6nsB/TzIpxaIrk8TzwDTKA/b3Nc0j3fjc1krXv TfSNCFenlMEkMhaFy4FpbEnZTwzUovCEYy1+RGhycILykMqP4vfuAu03kiSzjUyCwcGu deaPzSGF3UjPyi6AzDAp0R8awVk728DZNlA49awt2EvQ2WE/4yk+zHbrg6c0hc0cw0z6 ic29qUDqGhsbRhVhzUD/cyNr9noQAvAShsFN0A26bryMvPZQ+7fGLSH2giBPv6qf2Dnt j/W78ciqpALjS+E8ivYMehWASll5vjbwvSG4t1Ma1hss/WQpvnKVse3jJwzreP7y1hHH tkdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=K+DcUhsmE3yzl9AXIdclJlqN2xluup6VicHIXuP3l3g=; fh=//xY/5WyWI40VTWIuKRi5N7K0SfvTfMl0EjVPkaXG4c=; b=h0qgBz3icQIW4I4pr3D0G94QFanx8Wkz2vUi/v8Qg3kQIYFooieup4wleAu7yR3RPI d5BlwiiHkUpnATgU6dzuy1X/bZHl+KrA+0bBJP6dKwDpm4r+rtO2VKtcA0mUB319Z25A gP1dxYq/wD590x94gOg/jT02srVhdotx0PK2UtNI9iICr2fCoZCjH86i/NOnokPCHJjP 9kFzEeJmJ3a5AvGdcUqy5tBVYJgTA5AlV3AUoDKmRqddB49NlfkddEPgw9c4utYrhTzD nEbJyRNCmvBSBrAW5Tbt2LcVRzzJdtu6JOSxivqGtW49yvcryD251D5Uef+6061ZI5yu yZGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kBi7HhCv; spf=pass (google.com: domain of linux-kernel+bounces-25840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25840-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bt11-20020a170906b14b00b00a2a92286094si3676513ejb.25.2024.01.15.02.00.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 02:00:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25840-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=kBi7HhCv; spf=pass (google.com: domain of linux-kernel+bounces-25840-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25840-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 C26D11F2351C for ; Mon, 15 Jan 2024 10:00:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23C29EAFE; Mon, 15 Jan 2024 10:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kBi7HhCv" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (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 19F0BF9C2; Mon, 15 Jan 2024 10:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705312820; x=1736848820; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=utTJkdiQ3vnztSPGEHcOmRJIWy6d/oKeObynN8qfOUs=; b=kBi7HhCvaH2leHxkZOeIvjOfVwHdwNNYUngjOw7zARJXm/5kxKNJeKjF PJitXnGRVV7DZrVMyVjxufPs8hpZa9DMi71Xd8yo47V2e6oLu8EoYX7/G 5WnHP2mSrax/oP+9NCMJOQJuQ0a7y2ZeWR1zrMm6LFhMkB5wV5Lp4EKin 9mLhO890duRfe4fu6mt516h2Xo0TGJDXFy5jkldqeFo2KYwGenmvV/Y+N OhDOzpshOgOzCTwXIJ2r1/wkyJqEt6zLfTvpzP6DUBMarXJlEZgrU74I3 k2JwYilFMb0qgrXpjys8Xj9S/wmuE8isxxyYLltrPwvRAbwQONKKeKI+K A==; X-IronPort-AV: E=McAfee;i="6600,9927,10953"; a="18182459" X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="18182459" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 02:00:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10953"; a="874059378" X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="874059378" Received: from jeroenke-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.55.160]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 02:00:13 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 44E2E10A58F; Mon, 15 Jan 2024 13:00:11 +0300 (+03) Date: Mon, 15 Jan 2024 13:00:11 +0300 From: "kirill.shutemov@linux.intel.com" To: Michael Kelley Cc: "Edgecombe, Rick P" , "linux-coco@lists.linux.dev" , "ardb@kernel.org" , "Lutomirski, Andy" , "hch@infradead.org" , "dave.hansen@linux.intel.com" , "thomas.lendacky@amd.com" , "haiyangz@microsoft.com" , "akpm@linux-foundation.org" , "mingo@redhat.com" , "seanjc@google.com" , "linux-kernel@vger.kernel.org" , "tglx@linutronix.de" , "Cui, Dexuan" , "urezki@gmail.com" , "linux-mm@kvack.org" , "linux-hyperv@vger.kernel.org" , "peterz@infradead.org" , "hpa@zytor.com" , "bp@alien8.de" , "wei.liu@kernel.org" , "Rodel, Jorg" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "lstoakes@gmail.com" , "x86@kernel.org" Subject: Re: [PATCH v3 1/3] x86/hyperv: Use slow_virt_to_phys() in page transition hypervisor callback Message-ID: <20240115100011.yvecjjezrkcptnle@box.shutemov.name> References: <20240105183025.225972-1-mhklinux@outlook.com> <20240105183025.225972-2-mhklinux@outlook.com> <9dcdd088494b3fa285781cccfd35cd47a70d69c3.camel@intel.com> <3ddc237d9fbbe0aa8838babf0df790076017e9f7.camel@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Jan 12, 2024 at 07:24:35PM +0000, Michael Kelley wrote: > From: Edgecombe, Rick P Sent: Friday, January 12, 2024 9:17 AM > > > > On Fri, 2024-01-12 at 15:07 +0000, Michael Kelley wrote: > > > The comment is Kirill Shutemov's suggestion based on comments in > > > an earlier version of the patch series.? See [1].?? The intent is to > > > prevent > > > some later revision to slow_virt_to_phys() from adding a check for > > > the > > > present bit and breaking the CoCo VM hypervisor callback.? Yes, the > > > comment could get stale, but I'm not sure how else to call out the > > > implicit dependency.? The idea of creating a private version of > > > slow_virt_to_phys() for use only in the CoCo VM hypervisor callback > > > is also discussed in the thread, but that seems worse overall. > > > > Well, it's not a huge deal, but I would have just put a comment at the > > caller like: > > > > /* > > * Use slow_virt_to_phys() instead of vmalloc_to_page(), because it > > * returns the PFN even for NP PTEs. > > */ > > Yes, that comment is added in this patch. > > > > > If someone is changing slow_virt_to_phys() they should check the > > callers to make sure they won't break anything. They can see the > > comment then and have an easy time. > > > > An optional comment at slow_virt_to_phys() could explain how the > > function works in regards to the present bit, but not include details > > about CoCoO VM page transition's usage of the present bit. The proposed > > comment text looks like something more appropriate for a commit log. > > Kirill -- you originally asked for a comment in slow_virt_to_phys(). [1] > Are you OK with Rick's proposal? Yes, sounds sensible. -- Kiryl Shutsemau / Kirill A. Shutemov