Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3661409pxv; Mon, 19 Jul 2021 05:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeb8eTQfXjuuSN6s1V0rx+hbecmf83K9I6GB4QlextxPzQQXNDg7vs/cYjUMmCCPsKPW7E X-Received: by 2002:a05:6638:2416:: with SMTP id z22mr14829534jat.57.1626699395504; Mon, 19 Jul 2021 05:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626699395; cv=none; d=google.com; s=arc-20160816; b=sDBkd2IUQah99C8uXj904/uR5OhV50QqN9FAj8IkWDTVeRCUoQ14nXx6IjzC5mNRrW k71WCcOTvAjsvqQREgh6w/Y5kfBnbACsIVhnnHVOv8OMTSu4w3I13Gz0oMRb+V3Go0Fp kCrka8ptIFXs+JLIQ+wezYhUgPLNe/mjOZEgw8Lz8MXks/jvrzG7T+u7AWCBdrM3GJ2m RqLvNutMZgv7Lh9ZLm/hFtDKLal3jxER2VO0svQSKsl8Bp8jVVJN4yMGxp0jqFywIWOd NpDqI9ZHVw1rg4Iwk7Y5Z1UgZs0WzxJvLGJkpDqZLZX5oOyVBlxX3eGRjBQWt93RdcAB w44g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=WKHNL0cgqstCp6SEyYx7jhuI7sWwkFTDnSpolQ0wAvc=; b=sxHm+kASuCyM9nyI1IKJX1ek4F+IJcWhRzV0D0VXDzdWyER7Do/kCbHP+/UBQ+/2zx Rkq94QwxdQy0Jc49qaPvE4REPOL+WD1EVC4n7wjy8/s83M3UrXm2Pl8Fxr5BA/9n5vb+ /vbOgnmBNDqSP9e5tgFUNzJmh7cZBrIfui5zfI8GhVREtkVuFNdSaKH2yK3sF/2bCdsx +DCHT9pI4FVEudCnK3bvb3ddVHCm+mF5KjMt1q5MB6YGKwm0dAbEpDB7vXlokFgQDU6Z QSiXoVTrLvXT9UrEuYlA8x+21+27Xc2t3wQ0LN5ZWTNJlfRI7EctPZnMAsIvsGhymKNL xaWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si13292878iov.66.2021.07.19.05.56.24; Mon, 19 Jul 2021 05:56:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236980AbhGSMPJ (ORCPT + 99 others); Mon, 19 Jul 2021 08:15:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:45522 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbhGSMPF (ORCPT ); Mon, 19 Jul 2021 08:15:05 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 458F56100C; Mon, 19 Jul 2021 12:55:45 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1m5SoB-00EDHx-4s; Mon, 19 Jul 2021 13:55:43 +0100 Date: Mon, 19 Jul 2021 13:55:29 +0100 Message-ID: <87im16jwe6.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com Subject: Re: [PATCH 05/14] KVM: arm64: Don't overwrite ignored bits with owner id In-Reply-To: <20210719104735.3681732-6-qperret@google.com> References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> 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") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, ardb@kernel.org, qwandor@google.com, tabba@google.com, dbrazdil@google.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Jul 2021 11:47:26 +0100, Quentin Perret wrote: > > The nVHE protected mode uses invalid mappings in the host stage-2 > page-table to track the owner of each page in the system. In order to > allow the usage of ignored bits (a.k.a. software bits) in these > mappings, move the owner encoding away from the top bits. But that's exactly what the current situation is allowing: the use of the SW bits. I am guessing that what you really mean is that you want to *preserve* the SW bits from an existing mapping and use other bits when the mapping is invalid? Thanks, M. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/hyp/pgtable.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > index a60653cbd8e5..a0ac8c2bc174 100644 > --- a/arch/arm64/kvm/hyp/pgtable.c > +++ b/arch/arm64/kvm/hyp/pgtable.c > @@ -50,7 +50,7 @@ > KVM_PTE_LEAF_ATTR_LO_S2_S2AP_W | \ > KVM_PTE_LEAF_ATTR_HI_S2_XN) > > -#define KVM_INVALID_PTE_OWNER_MASK GENMASK(63, 56) > +#define KVM_INVALID_PTE_OWNER_MASK GENMASK(9, 2) > #define KVM_MAX_OWNER_ID 1 > > struct kvm_pgtable_walk_data { > -- > 2.32.0.402.g57bb445576-goog > > -- Without deviation from the norm, progress is not possible.