From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FF8CC48297 for ; Mon, 5 Feb 2024 16:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=E69fmLks0g9VZ2UEQDeDMtbU5L0SmaWCRPgrNt0+nKs=; b=ExQHxw3t7D1t8b l4lAlbjqxUUTe1RPGPzy8hDei2Ii/gdFBIHV7m4C82NOrYD/Llio1LxE/hUDOofTprT1jlDILuFln OXcwlAvaUpx5ARtVqksq9o8F16u6T3FeAA9VQJt5Dh4pwrC9O0JTKZd5eeAZA2DTxtI5l4X6L/osy ODZgUXZ/SP+10m7sICLbTmvlqY50IEFxjLBEk8ueA2JRoSzRmkPYWq99swtTp5QNFKZl8jLEb2tYV dYIlgaV6CpwtEAPogszFl3pb1kEdsr87IztbLKidL/7u3P0PUUz1uSoRt8ax//BRREWrnRQaXUhdF g5vs4NpZhFMLIg1VS1cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rX1TY-00000003wam-19sF; Mon, 05 Feb 2024 16:05:40 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rX1TN-00000003wWB-1wVw for linux-arm-kernel@lists.infradead.org; Mon, 05 Feb 2024 16:05:38 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-40f00adacfeso88065e9.1 for ; Mon, 05 Feb 2024 08:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1707149124; x=1707753924; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CYZyNjIxlDFPhWyjksZUxS6xmnfxwnVZbORSM0gvtHE=; b=GMUXOGtP+Kl/63aAIBdS4TAs134L6eGBj8xoBB30Ytujqu/yUwjSPkgNgzjIwLUa8V iDMnzHRP85r02HB4W4iS/kDI76W+RjxUinhydvSlC7icEEdmSf06t4ifSTurQ9GCn47J 9Y20q9V65loB21xD6gcM1VkWKrkuthzv1VDo7WYWu9bMViBqXtkCP14ID4RIBJRlmVlu es3E6Cp7xQ5Qxo5bPGJr582KwDjJn782APcrVlUjm+XNa42P2pojw9oGiHy5c58f7RBZ VCw75ynexwWmIQtQUMH7O9NFzou6U9qVsQ6NOFKDW01u9gUVonGoASciKkOFtaf7SSPW GkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707149124; x=1707753924; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CYZyNjIxlDFPhWyjksZUxS6xmnfxwnVZbORSM0gvtHE=; b=gehGsISr5/Y1cS6cNft+8lTzSjUH1ElbWwQSt2u531MPKaFXhPMHC6pu7yAy8VnEUE aWzg3ltEl3NnMSwquClM7tCWByhUvftpfUuUwH5zynyMilW4mxGI+fFpkaXplm82Lg8T j0kBkMbgjH7ovfbzjMAdOP+xfCG3kGHQb80zynd9qMpOk03DTHnLzk4c3ZMuxybCf7X0 BJsxVyQC/YsmPKBmYGmnlXTH5Q+bC0KQ+v1eZu4Bi+/oVzpom3sixL0AovqGFzJIP7HY 9xG+fsisphh/Px6gvZ8bGAxObyBhae3g9Wgm+W9BdLyjXmiCitl0lW3ln51RAVZkrVh7 HzYg== X-Gm-Message-State: AOJu0YxPj2f24g4DIkSYTbnLtx00ViUr/5Vy6BNK+kojKQMalSQ4GAD8 47mWzcTjwE5KGxYjW4eA3BEdfotah8RsBgOiMpMhb3wpDAA3kbArITc22PpL5yWB24QwdZQHow2 oGzlC X-Google-Smtp-Source: AGHT+IFbUog5YW+R34dfZwqpeAWaXbXS7kqTE+M1tcTJHXAI7hpcjA6iAanTUc4hznRPTVUGW1SHQQ== X-Received: by 2002:a05:600c:5187:b0:40f:dd8f:152c with SMTP id fa7-20020a05600c518700b0040fdd8f152cmr113764wmb.4.1707149123951; Mon, 05 Feb 2024 08:05:23 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXeaO7j728zekDuQdzDKwJj2UOXOnTcpuMyB6C4+Q/i3YYe48qy8m5wOt1VAn4vSM36Of0JOYedLRDhCezQCi9WSzqvziZN9Mcz+RWLUtL0W8QqzxtnX04pfT9/tnXCV5gCJ/M4fiV+bkF8tx6qEmYqYNNFRnYaJg0H/jhAb/3EHAidNkEd5nIvEaOQ7b1cGd+IoqPAyayKCaa5VABEicjCg3Asnx1c7M14Ut0q8OOJUaXZ/u06rAKoDL6pohqagXPpCy2OtI8wR4UbRVo08w7sWzp41yLno0GCkQvP3UtkEXhdMBixOShYUnV4lxo2iw53PjjnwyhKHlMW42EQOoDmLgXrDZc1w9M4ehA0O2RYTsLi+SBRkvuXnLbBPQrnIktEGrdaxCl7YDZUHlF3Ba5yuOqDtG1fGi0RruYyz1hh/DMCoXh1eOlrjOgq0cqoRZPLv5IJwUgjHnZaJM4G23i2rfovFO6ruRQNeXxm8m96KGETgu0gU89j23IBhUo801E= Received: from google.com (161.126.77.34.bc.googleusercontent.com. [34.77.126.161]) by smtp.gmail.com with ESMTPSA id w15-20020a05600c474f00b0040fc26183e8sm259274wmo.8.2024.02.05.08.05.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:05:23 -0800 (PST) Date: Mon, 5 Feb 2024 16:05:21 +0000 From: Sebastian Ene To: Oliver Upton Cc: will@kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu , catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, maz@kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, vdonnefort@google.com, qperret@google.com, smostafa@google.com Subject: Re: [PATCH v4 02/10] KVM: arm64: Add ptdump registration with debugfs for the stage-2 pagetables Message-ID: References: <20231218135859.2513568-2-sebastianene@google.com> <20231218135859.2513568-4-sebastianene@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240205_080537_339138_B5227258 X-CRM114-Status: GOOD ( 37.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 05, 2024 at 01:14:27PM +0000, Oliver Upton wrote: > On Thu, Feb 01, 2024 at 11:20:53AM +0000, Sebastian Ene wrote: > > On Thu, Dec 21, 2023 at 06:14:20PM +0000, Oliver Upton wrote: > > > > Hi Oliver, > > > > I am planning to split the series based on your suggestion and I > > wanted to make sure that I understand your feedback. > > > > > On Mon, Dec 18, 2023 at 01:58:52PM +0000, Sebastian Ene wrote: > > > > +config PTDUMP_STAGE2_DEBUGFS > > > > + bool "Present the stage-2 pagetables to debugfs" > > > > + depends on PTDUMP_DEBUGFS && KVM > > > > + default n > > > > + help > > > > + Say Y here if you want to show the stage-2 kernel pagetables > > > > + layout in a debugfs file. This information is only useful for kernel developers > > > > + who are working in architecture specific areas of the kernel. > > > > + It is probably not a good idea to enable this feature in a production > > > > + kernel. > > > > > > It isn't really a good idea to mount debugfs at all in a production > > > system. There are already plenty worse interfaces lurking in that > > > filesystem. The pKVM portions already depend on CONFIG_NVHE_EL2_DEBUG, > > > so I don't see a need for this Kconfig option. > > > > > > > I created a separate option because I wanted to re-use the parsing > > functionality from the already existing ptdump code for EL1. This option > > is turned off in production and only enabled for debug. > > > > I was thinking to make use of the `CONFIG_NVHE_EL2_DEBUG` but then I abandoned > > this ideea as one can use ptdump for vHE as well. > > Fair enough. I was going to say we could just have KVM follow > CONFIG_PTDUMP_DEBUGFS, but it doesn't matter either way. > > > > > +void kvm_ptdump_register_host(void) > > > > +{ > > > > + if (!is_protected_kvm_enabled()) > > > > + return; > > > > + > > > > + kvm_ptdump_debugfs_register(&host_reg, "host_page_tables", > > > > + kvm_debugfs_dir); > > > > +} > > > > + > > > > +static int __init kvm_host_ptdump_init(void) > > > > +{ > > > > + host_reg.priv = (void *)host_s2_pgtable_pages(); > > > > + return 0; > > > > +} > > > > + > > > > +device_initcall(kvm_host_ptdump_init); > > > > > > Why can't all of this be called from finalize_pkvm()? > > > > > > > I guess it can be called from finalize_pkvm before the is_protected_kvm_enabled > > check. This should work for nvhe & vhe as well. > > What does nvhe and vhe modes have to do with it? I thought this was for > hooking up the host's S2, which does not exist outside protected mode. > True I guess there is no other need for the initialization portion in this function. I will split the series to address the non-protected support first. Thanks, Seb > -- > Thanks, > Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel