Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4418724pxv; Tue, 20 Jul 2021 03:24:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP6Pb+LM7kY2AGz2Pp2GOtCdLizy3Fm24jarr2PipJdVdFJsPply/8WFS8mUbVUANCY0bM X-Received: by 2002:a92:c5c2:: with SMTP id s2mr20765866ilt.180.1626776670387; Tue, 20 Jul 2021 03:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626776670; cv=none; d=google.com; s=arc-20160816; b=bBXtXLKEaNc7Ec0EFGE+Ws3lVox0WiH9UhuOaJFd+ojTTh0GBVIWFYUD7JM/3noTuX 5YX1bwXkNbcu12tmowS9IJtzFRJwAYrFcsDQmegZp7ziGUzyHssvk/ZPOaMXCSEMnut1 NluDuTI88t4Y7omKw8n0B82rIXAtyL42CURI3/0CZs62zrW5WQJr7OwTgeQJWuMr9miC wXkrIzd7l69fNq457ERHJJyNMq5uNOlHuUYwGdFac6dElHJPjjyoEmnNBR86XRSZenHe KuHvWxp2adBpSdA8hTys13PAh7O4yenojMCvK72rlM1KcE1JxmvCLiEaW2CGkve5lhUk VWxg== 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=nCQb0+pVaZjd6FzCGmAp0ZnCmLgVNR+8yvu07Yw0ZtQ=; b=DtKmBHKCjoPGYJsarxxXbHVeLtbEC6dRwnFOrHBse5E3OlR+vPHutkGgRPoa8PrpSn I6M8edZJ6JMFJ2HA72olHRp5c0tw7WtfkKmLn7K9KOV8BTxQiyxhb1vzJU3ZsUf4DW9q PILwpinHgID/wlozbhslYd1gT/3YwTP63hSsvXDGHIAFRbjhiTQeypK1ieyUw7l1Gs4U /8vaReUFZa2Q/rrIEyNXlmy7XT6CASArCaySS3lLxu2Vl+u05GmK1fb7VjxLjvb3peMT DCSecxKVqgsVkQS+9++Wejw80rJidXhnpsc5oSAAitPrNtyGjpNluHvLH/cGSORqJh3z t38w== 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 x10si511638ilu.80.2021.07.20.03.24.19; Tue, 20 Jul 2021 03:24: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; 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 S236729AbhGTJlW (ORCPT + 99 others); Tue, 20 Jul 2021 05:41:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:58464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236692AbhGTJkl (ORCPT ); Tue, 20 Jul 2021 05:40:41 -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 03C7E60FE9; Tue, 20 Jul 2021 10:21:20 +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 1m5msI-00EU7S-5b; Tue, 20 Jul 2021 11:21:18 +0100 Date: Tue, 20 Jul 2021 11:21:17 +0100 Message-ID: <871r7t9tgi.wl-maz@kernel.org> From: Marc Zyngier To: Quentin Perret Cc: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, dbrazdil@google.com, Srivatsa Vaddagiri , Shanker R Donthineni , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH 03/16] KVM: arm64: Turn kvm_pgtable_stage2_set_owner into kvm_pgtable_stage2_annotate In-Reply-To: References: <20210715163159.1480168-1-maz@kernel.org> <20210715163159.1480168-4-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, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, will@kernel.org, dbrazdil@google.com, vatsa@codeaurora.org, sdonthineni@nvidia.com, james.morse@arm.com, suzuki.poulose@arm.com, alexandru.elisei@arm.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 Tue, 20 Jul 2021 11:09:21 +0100, Quentin Perret wrote: > > On Thursday 15 Jul 2021 at 17:31:46 (+0100), Marc Zyngier wrote: > > @@ -815,7 +807,7 @@ int kvm_pgtable_stage2_set_owner(struct kvm_pgtable *pgt, u64 addr, u64 size, > > .arg = &map_data, > > }; > > > > - if (owner_id > KVM_MAX_OWNER_ID) > > + if (!annotation || (annotation & PTE_VALID)) > > return -EINVAL; > > Why do you consider annotation==0 invalid? The assumption so far has > been that the owner_id for the host is 0, so annotating a range with 0s > should be a valid operation -- this will be required when e.g. > transferring ownership of a page back to the host. How do you then distinguish it from an empty entry that doesn't map to anything at all? M. -- Without deviation from the norm, progress is not possible.