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 mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC0FFCCA483 for ; Wed, 20 Jul 2022 15:11:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4AD8B4D7FF; Wed, 20 Jul 2022 11:11:15 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@linux.dev Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tvbyakmR5JaF; Wed, 20 Jul 2022 11:11:13 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E2CFD4D7D4; Wed, 20 Jul 2022 11:11:13 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2666D4D771 for ; Wed, 20 Jul 2022 11:11:12 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UfEiHRFAj9Zl for ; Wed, 20 Jul 2022 11:11:11 -0400 (EDT) Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 183534D770 for ; Wed, 20 Jul 2022 11:11:11 -0400 (EDT) Date: Wed, 20 Jul 2022 15:11:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658329869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vFnDRJW8SXwUP1HZqonS92uu/YoL0Hk0zC9PiQKiK7Y=; b=t8HCSRCOircfKNTjXQPibLbkf3dGU8b1N/fhA1M+gEhIcEuOgZmaGt+wpUGulo4ywjeCfR CfOExbN2WW4kIQqeSx1m9WLPXSJyiTTWXFPeiJDwqnDhmqqqYIY4XZt7ATi+kssHAlQbJN uqeHqdXLh54XRJ759q3mn8x7G1ih978= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Subject: Re: [PATCH v2 06/24] KVM: arm64: Unify identifiers used to distinguish host and hypervisor Message-ID: References: <20220630135747.26983-1-will@kernel.org> <20220630135747.26983-7-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220630135747.26983-7-will@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Cc: Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, Andy Lutomirski , linux-arm-kernel@lists.infradead.org, Michael Roth , Catalin Marinas , Chao Peng , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Will, On Thu, Jun 30, 2022 at 02:57:29PM +0100, Will Deacon wrote: > The 'pkvm_component_id' enum type provides constants to refer to the > host and the hypervisor, yet this information is duplicated by the > 'pkvm_hyp_id' constant. > > Remove the definition of 'pkvm_hyp_id' and move the 'pkvm_component_id' > type definition to 'mem_protect.h' so that it can be used outside of > the memory protection code. > > Signed-off-by: Will Deacon > --- > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 6 +++++- > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 8 -------- > arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- > 3 files changed, 6 insertions(+), 10 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > index 80e99836eac7..f5705a1e972f 100644 > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > @@ -51,7 +51,11 @@ struct host_kvm { > }; > extern struct host_kvm host_kvm; > > -extern const u8 pkvm_hyp_id; > +/* This corresponds to page-table locking order */ > +enum pkvm_component_id { > + PKVM_ID_HOST, > + PKVM_ID_HYP, > +}; Since we have the concept of PTE ownership in pgtable.c, WDYT about moving the owner ID enumeration there? KVM_MAX_OWNER_ID should be incorporated in the enum too. -- Thanks, Oliver _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 85B67C43334 for ; Wed, 20 Jul 2022 15:12:17 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=11LC2/nn6lSCPSUHBPvzJM69xTBLiJnHMvloiNvqsZ0=; b=3FX0uFlhSXDXw4 gK0Kt6CSpRpaX+gyfoZdCH14ZRM1e5S5p17cDi9zZLhViHrF/PMN87Oekkji7J7qJX1NLP8/p3rFV wFv147QaQMOPYYN1vPGsGf/IUDKihcWbFzy/zesFXgbCvjfZQXOZRLYvwmMbmDdEspM1HVJySjboE j/L+aQG0/k9YKK0QwcW+EmVFEAt9Hd2QFsQHAe+LhMvk/9NVLlzKGbc6gpCu+KL40x6bic6EBHGxw 1ed1MSO6m0lwP2y4pGfVNsHknTdvRjHE8/SRm4nrJLbN6bXSKIYntgq/Y0Jvprc2I8iwyL8RQY7g5 JSpbrUePDzJatSt9FuWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEBM5-007NiX-8I; Wed, 20 Jul 2022 15:11:17 +0000 Received: from out2.migadu.com ([188.165.223.204]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oEBM2-007Ng8-Br for linux-arm-kernel@lists.infradead.org; Wed, 20 Jul 2022 15:11:16 +0000 Date: Wed, 20 Jul 2022 15:11:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658329869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vFnDRJW8SXwUP1HZqonS92uu/YoL0Hk0zC9PiQKiK7Y=; b=t8HCSRCOircfKNTjXQPibLbkf3dGU8b1N/fhA1M+gEhIcEuOgZmaGt+wpUGulo4ywjeCfR CfOExbN2WW4kIQqeSx1m9WLPXSJyiTTWXFPeiJDwqnDhmqqqYIY4XZt7ATi+kssHAlQbJN uqeHqdXLh54XRJ759q3mn8x7G1ih978= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , Catalin Marinas , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Fuad Tabba , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 06/24] KVM: arm64: Unify identifiers used to distinguish host and hypervisor Message-ID: References: <20220630135747.26983-1-will@kernel.org> <20220630135747.26983-7-will@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220630135747.26983-7-will@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220720_081114_872220_67B5714F X-CRM114-Status: GOOD ( 19.02 ) 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 Hi Will, On Thu, Jun 30, 2022 at 02:57:29PM +0100, Will Deacon wrote: > The 'pkvm_component_id' enum type provides constants to refer to the > host and the hypervisor, yet this information is duplicated by the > 'pkvm_hyp_id' constant. > > Remove the definition of 'pkvm_hyp_id' and move the 'pkvm_component_id' > type definition to 'mem_protect.h' so that it can be used outside of > the memory protection code. > > Signed-off-by: Will Deacon > --- > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 6 +++++- > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 8 -------- > arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- > 3 files changed, 6 insertions(+), 10 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > index 80e99836eac7..f5705a1e972f 100644 > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > @@ -51,7 +51,11 @@ struct host_kvm { > }; > extern struct host_kvm host_kvm; > > -extern const u8 pkvm_hyp_id; > +/* This corresponds to page-table locking order */ > +enum pkvm_component_id { > + PKVM_ID_HOST, > + PKVM_ID_HYP, > +}; Since we have the concept of PTE ownership in pgtable.c, WDYT about moving the owner ID enumeration there? KVM_MAX_OWNER_ID should be incorporated in the enum too. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10F15C43334 for ; Wed, 20 Jul 2022 15:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241042AbiGTPLO (ORCPT ); Wed, 20 Jul 2022 11:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239339AbiGTPLN (ORCPT ); Wed, 20 Jul 2022 11:11:13 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8658064F1 for ; Wed, 20 Jul 2022 08:11:11 -0700 (PDT) Date: Wed, 20 Jul 2022 15:11:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658329869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vFnDRJW8SXwUP1HZqonS92uu/YoL0Hk0zC9PiQKiK7Y=; b=t8HCSRCOircfKNTjXQPibLbkf3dGU8b1N/fhA1M+gEhIcEuOgZmaGt+wpUGulo4ywjeCfR CfOExbN2WW4kIQqeSx1m9WLPXSJyiTTWXFPeiJDwqnDhmqqqYIY4XZt7ATi+kssHAlQbJN uqeHqdXLh54XRJ759q3mn8x7G1ih978= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Will Deacon Cc: kvmarm@lists.cs.columbia.edu, Ard Biesheuvel , Sean Christopherson , Alexandru Elisei , Andy Lutomirski , Catalin Marinas , James Morse , Chao Peng , Quentin Perret , Suzuki K Poulose , Michael Roth , Mark Rutland , Fuad Tabba , Marc Zyngier , kernel-team@android.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 06/24] KVM: arm64: Unify identifiers used to distinguish host and hypervisor Message-ID: References: <20220630135747.26983-1-will@kernel.org> <20220630135747.26983-7-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220630135747.26983-7-will@kernel.org> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Will, On Thu, Jun 30, 2022 at 02:57:29PM +0100, Will Deacon wrote: > The 'pkvm_component_id' enum type provides constants to refer to the > host and the hypervisor, yet this information is duplicated by the > 'pkvm_hyp_id' constant. > > Remove the definition of 'pkvm_hyp_id' and move the 'pkvm_component_id' > type definition to 'mem_protect.h' so that it can be used outside of > the memory protection code. > > Signed-off-by: Will Deacon > --- > arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 6 +++++- > arch/arm64/kvm/hyp/nvhe/mem_protect.c | 8 -------- > arch/arm64/kvm/hyp/nvhe/setup.c | 2 +- > 3 files changed, 6 insertions(+), 10 deletions(-) > > diff --git a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > index 80e99836eac7..f5705a1e972f 100644 > --- a/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > +++ b/arch/arm64/kvm/hyp/include/nvhe/mem_protect.h > @@ -51,7 +51,11 @@ struct host_kvm { > }; > extern struct host_kvm host_kvm; > > -extern const u8 pkvm_hyp_id; > +/* This corresponds to page-table locking order */ > +enum pkvm_component_id { > + PKVM_ID_HOST, > + PKVM_ID_HYP, > +}; Since we have the concept of PTE ownership in pgtable.c, WDYT about moving the owner ID enumeration there? KVM_MAX_OWNER_ID should be incorporated in the enum too. -- Thanks, Oliver