Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4373346pxv; Tue, 20 Jul 2021 02:10:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoChCHd7a/MTBgQPCH9VFv2BYUAtAvW6fpzUT455DSqeIlNoEfSJW7tzQaW0XcPKAxZW6G X-Received: by 2002:a6b:dd02:: with SMTP id f2mr16570090ioc.11.1626772205543; Tue, 20 Jul 2021 02:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626772205; cv=none; d=google.com; s=arc-20160816; b=zX269UKnSVdKO71ZwROrAwB0yDEvvuy2D3bxC/M1N6UUNuPBzmQq+Oz7RQa3xV+Gm9 qT9FWWKk88tY6djmxSHueisaHQuLa5dE5tiExo33XhXGHGT/z7mSU9O9TmP+uxwLP9aA jnUI0ACE+6v8pM2JZPxvXIq3dGVSkm0AnOcWD1zrOqNnpQNZS5f3DL5uHn9zD0Bu3x+g RhZXVtzofoa/gMdkvnZ0tvCyj1m7ijYVnQN2b8VMqkQ9hPJEGK5RiI5mLc2HzPbhRYx/ Uo7eEWCcYtBrAhI0/+YHdBXp22YhBOPDAZjZD/FGsS2pKW/mxXTJoBIzfz2Pv/T+ByeQ qkFw== 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=K4hUZx8dTDdMoepjemlAjM3MV62aU8XOhfljEcN+5tQ=; b=RnDYG6LbUT2XMkS3/RlUUoxsRt5Tw2lKWZ6UGHvO/gNj2yiEF/h5B6tavm0xLWNORW 4SrRL/ZE61Gv02AsLPSx2szy86ziWk/ian4buPKxOnJypYlzoT8mUqzmhRyngBKZuYue ZJOO9lIXrP5rI0ThEWuDHo212laauSkAK4qgeFeSLpBbOB5ieuY5hHNSqpeWwjiItyG3 h4ykwpjSzt5ME+dqcdG9Wva5wg8zlfcYE6/zGaTxjkxbwnONSOa7OGTvDEIPizlb9enX p5RbSKA3okDxf3M2hbn+v1oid6L7V+LjgxucUof8Dwl5EYrnLUyHprO46DlLoD3H7oKM NnfA== 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 az3si13609006jab.111.2021.07.20.02.09.55; Tue, 20 Jul 2021 02:10:05 -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 S235178AbhGTI2R (ORCPT + 99 others); Tue, 20 Jul 2021 04:28:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:42884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235466AbhGTIXq (ORCPT ); Tue, 20 Jul 2021 04:23:46 -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 8EFC8611F2; Tue, 20 Jul 2021 08:46:53 +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 1m5lOt-00ETCj-Lq; Tue, 20 Jul 2021 09:46:51 +0100 Date: Tue, 20 Jul 2021 09:46:51 +0100 Message-ID: <874kcp9xtw.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: References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> <87im16jwe6.wl-maz@kernel.org> 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 14:39:05 +0100, Quentin Perret wrote: > > On Monday 19 Jul 2021 at 13:55:29 (+0100), Marc Zyngier wrote: > > 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? > > Yes, this is really just forward looking, but I think it might be useful > to allow annotating invalid mappings with both an owner id _and_ > additional flags for e.g. shared pages and such. And using bits [58-55] > to store those flags just like we do for valid mappings should make > things easier, but no big deal. Right, so maybe worth calling that out. > I see how this is going to conflict with kvm_pgtable_stage2_annotate() > from your series though, so maybe I should just drop this patch and > leave the encoding 'issue' to the caller -- the rest of the series > doesn't depend on this anyway, this was just small cleanup. I'm not too worried about that for now. We can always rewrite one in terms of the other, but I wanted to understand exactly this change was about. Thanks, M. -- Without deviation from the norm, progress is not possible.