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 A9E42C46467 for ; Wed, 11 Jan 2023 08:54:38 +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:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EZDoqZXN+UJOkTFUHqlO1xwKtJgWnBmn3KQt3h9Iu3M=; b=xrmClbryB9MWOz uD/TW6/htXLa88njcYfBmqholNac6Y3TaKRncp1cc2XDJSnhPMnR9aAqFCIck4MiaZbBgzKaZmaFH fI34VyYXht9BxPcYQSCw+zhakAo2I7z7ol34tdo26LKsLtcqiXR+OpehBZbFrJUBrzYq0mlbbAFRc HTIwYFkDh3F3yNt0UPBee6IGNWKOjrQ2Lxk8Wc3QLG3HqozazikRqQp166NRFDixhFye3HAhZ7ZVD Y47aQL3yaFHE7rUTxQhdqRG1iwSUx2c9SOT6LrmNgurr1a3XpJ6Ek4B1myyROoWn14bmcpWQN0Gp/ jOW4BSzyCeEi4YNJhGQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFWre-00AQ23-Mh; Wed, 11 Jan 2023 08:53:42 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFWrb-00AQ12-Na for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2023 08:53:40 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1E11661AF8; Wed, 11 Jan 2023 08:53:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BA65C433F1; Wed, 11 Jan 2023 08:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673427218; bh=IXxJG9ipM42iBUZnVRNV18q69R6WGwfRGQvbXoWI510=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ahvzAyvtPhLPvkCFhVmQMywf75xYDOv13guUAfPbuvzOtQWOGrzuXdqr8289HjS5u QCLo3fvD+GgfR2mdBHbH3RaiDsaYpvHLN9pWdhDV9U2cvbeXVsjrcI2lhITJBTg18A bCulW0QQgv2bEPnO9GP2ttq0Z7ppLRnHEGspVNw/9XUVfGE+w26OhBHJ+jPPa/H3iJ QYlAqc4FHBVK4cnR5Q0PKJIAnY1T4FachcA86AWNPCcBvjhqPc8hTgwJxOn5QSInbY 4atLXqNF3gr3uPQD96zCBVm1Hu4kKjYtUbedAMmnvZG3AjAt3BjTA8BQ6IJm2h+BeF z1+CO6iX0M7TA== Received: from ip-185-104-136-29.ptr.icomera.net ([185.104.136.29] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pFWrY-000oRY-1c; Wed, 11 Jan 2023 08:53:36 +0000 Date: Wed, 11 Jan 2023 08:52:25 +0000 Message-ID: <87ilhde9me.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: James Morse , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, Quentin Perret , Will Deacon , Reiji Watanabe , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH 3/5] KVM: arm64: Only return attributes from stage2_update_leaf_attrs() In-Reply-To: <20230111000300.2034799-4-oliver.upton@linux.dev> References: <20230111000300.2034799-1-oliver.upton@linux.dev> <20230111000300.2034799-4-oliver.upton@linux.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.104.136.29 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, qperret@google.com, will@kernel.org, reijiw@google.com, suzuki.poulose@arm.com, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230111_005339_825697_CA74147B X-CRM114-Status: GOOD ( 17.36 ) 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 [+ Suzuki and Zenghui who are missing from the Cc list] On Wed, 11 Jan 2023 00:02:58 +0000, Oliver Upton wrote: > > Returning a single PTE from stage2_update_leaf_attrs() doesn't make a > great deal of sense given that the function could be used to apply a > change to a range of PTEs. Instead, return a bitwise OR of attributes > from all the visited PTEs. I find this amalgamation of attributes quite confusing, and I have a hard time attaching semantics to the resulting collection of bits. It also means that you cannot reason about a particular attribute being 0 if any of the neighbour PTEs has this bit set. > > As the walker is no longer returning the full PTE, drop the check for a > valid PTE in kvm_age_gfn(). But then what does it mean to check for a potentially invalid PTE? The helpers explicitly say: /* * The following only work if pte_present(). Undefined behaviour otherwise. */ #define pte_present(pte) (!!(pte_val(pte) & (PTE_VALID | PTE_PROT_NONE))) #define pte_young(pte) (!!(pte_val(pte) & PTE_AF)) and you seem to be violating this requirement. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel