Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3695919pxv; Mon, 19 Jul 2021 06:40:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOBXW1Xrp6s4sC/8z56SstppwPIGPfPpmu3Mhi0ArrPg6WSrAe9kSBJCUbiQsI2W4qB2Is X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr34780733edd.66.1626702031009; Mon, 19 Jul 2021 06:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626702031; cv=none; d=google.com; s=arc-20160816; b=v3nRnMhJwPlFaIaux+CNSUI0regmh8UofSJRUb9SzUXYGptwQg9NUt4n1a23yOUxd8 ZIqDMl4g0MkLTK2gCKPQ2xdj8jcPRQztwLBDx0UtaI+NUcMGRhadaJdrFwHhffauzRC1 tH8FNpusDu3Cqz6PqfWq3AeMsVybK+sgmoDaBuJ44MpmU2osRGI7s/qpXUI2h5Zx/GLb fVqjK3EU03/kkR9tAtuMWlX/NYLvgOxcvSYJs8CgK0xr9tWOk0uz0qJ5FqXrhgC6ZPtr yjz0Q/bwWAZ6cFiMY0v8nNBQ7XbT9MuRvMBsajPpEi267Q6md4SA52ckh4mchQmTHAXO cHBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YWipcSLEOaheP07xex9veQfZl0Z1vV0LQN+2n8cjKsA=; b=KE8q2A5/uAJbcy8s+UhkMc3WK1kf4zgyT/iL09OcA9FQEsO4juZgtAi9q93QbyhTKM cG3VsCR7oWCqu5G0DGvJ2LTnWTPaqXO4lp8RmJ3OoLSI6Eih2I55qsyAwcBwXBWp7JXG cur5zEVqc16wcR9FSF04wfNkoOcKNdb5FKvzd7mI86oyQY+9x5L1Rxk9R3FJKKFEW7+2 N/14GEfyWAHf+NAMaDsk/hKX91bq0oDX1/vGqhSJuZYYne6wknNsLdPHzIpNWeDN0vS5 v5QCFXdxwNVCCsWgbs78fxcbAyXyAu2WLaqw/tPyd/DmCOrFmlg7FnX1sbjhJK/4Lhjo X4Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CNm1BBIQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si25811495ejr.456.2021.07.19.06.40.07; Mon, 19 Jul 2021 06:40:30 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=CNm1BBIQ; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239118AbhGSM6c (ORCPT + 99 others); Mon, 19 Jul 2021 08:58:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239117AbhGSM6b (ORCPT ); Mon, 19 Jul 2021 08:58:31 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 240C7C061574 for ; Mon, 19 Jul 2021 06:01:22 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id a23-20020a05600c2257b0290236ec98bebaso1137wmm.1 for ; Mon, 19 Jul 2021 06:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YWipcSLEOaheP07xex9veQfZl0Z1vV0LQN+2n8cjKsA=; b=CNm1BBIQqcgx6zX/dXg0WWmp1MmRgupG3sxzggKPJQJmBNC9naFQbjh7hAKRFoMuT4 N6kmjOrM7TwVZCUS3ViuT7cilOVw5TUGEk1JvtpcX+dZ0jnr6+P3n3UElg/7Yk+n3cqR 5dcFbsGLReIGqlwZiYSSUIstzppYHr8STNug0C2hdG9JWZvk3H7aHe69G35165bLgXfF Wz/7jDi77m+ARzTOT/sUN9Tp7PXBNcS7I0LYMPtOUhStGhqNAuqTdAxMBDMsPJS+AU5y Wf7LifU3sZdwHZPUOhG5v5/ykSoXjkBecRidb642zpacSEv20rn8IkVcf3hUDWKXGZES 5owA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YWipcSLEOaheP07xex9veQfZl0Z1vV0LQN+2n8cjKsA=; b=j12McohOkEcvjoLBt04dMJWMNpAkgsJzLwSilVVYHMI/KYy1CBs66owXwDSUQMZCRc MH76nYe+64ec3qpTk0vLcInvn70yDJ1Ehe6TpkIn6gHa1FzCeUIbqHoBZN/IEEP/NINS /tiVZ+yMrV8hezwtXGgftMqmiBW7EXePYi3P3VRd74YxN5/NnPZ/gYTIli23zRzk8MkH k0m/WoK+hlxw+Zquo7W6yjRIgEzmD2XiAZQDUAR7IApjmneaP1XCLFhcQuJMcugcHVY9 knnUTHrfZFMFAiomDSL0Sepb2sVU0F+j9gDR6AUlgA28Ah8fbZ817QmLDu/AW8CWvOU7 M3NA== X-Gm-Message-State: AOAM533Mb9HVdK6SYFnGd0K66zI3AlfMGJ/xh/2CY3o+uA4vPAWoJXWS 3d08s3b7VcmA6MZ4q6+4XEY3ug== X-Received: by 2002:a7b:c251:: with SMTP id b17mr11503607wmj.83.1626701949064; Mon, 19 Jul 2021 06:39:09 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:83e0:11ac:c870:2b97]) by smtp.gmail.com with ESMTPSA id p9sm8224430wrj.54.2021.07.19.06.39.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 06:39:08 -0700 (PDT) Date: Mon, 19 Jul 2021 14:39:05 +0100 From: Quentin Perret To: Marc Zyngier 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 Message-ID: References: <20210719104735.3681732-1-qperret@google.com> <20210719104735.3681732-6-qperret@google.com> <87im16jwe6.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87im16jwe6.wl-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thanks, Quentin