From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation Date: Thu, 4 Apr 2019 16:25:28 +0200 Message-ID: <20190404142528.pxo3vrnk6mfsgmyq@kamzik.brq.redhat.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-22-git-send-email-Dave.Martin@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 8E2E94A452 for ; Thu, 4 Apr 2019 10:25:36 -0400 (EDT) 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 N73tTbPud+9j for ; Thu, 4 Apr 2019 10:25:35 -0400 (EDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 87C8D4A34E for ; Thu, 4 Apr 2019 10:25:35 -0400 (EDT) Content-Disposition: inline In-Reply-To: <1553864452-15080-22-git-send-email-Dave.Martin@arm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: Dave Martin Cc: Okamoto Takayuki , Christoffer Dall , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Will Deacon , Zhang Lei , Julien Grall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org List-Id: kvmarm@lists.cs.columbia.edu On Fri, Mar 29, 2019 at 01:00:46PM +0000, Dave Martin wrote: > This patch adds a kvm_arm_init_arch_resources() hook to perform > subarch-specific initialisation when starting up KVM. > > This will be used in a subsequent patch for global SVE-related > setup on arm64. > > No functional change. > > Signed-off-by: Dave Martin > Reviewed-by: Julien Thierry > Tested-by: zhang.lei > --- > arch/arm/include/asm/kvm_host.h | 2 ++ > arch/arm64/include/asm/kvm_host.h | 2 ++ > virt/kvm/arm/arm.c | 4 ++++ > 3 files changed, 8 insertions(+) > > diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h > index 770d732..a49ee01 100644 > --- a/arch/arm/include/asm/kvm_host.h > +++ b/arch/arm/include/asm/kvm_host.h > @@ -53,6 +53,8 @@ > > DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); > > +static inline int kvm_arm_init_arch_resources(void) { return 0; } > + > u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); > int __attribute_const__ kvm_target_cpu(void); > int kvm_reset_vcpu(struct kvm_vcpu *vcpu); > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 205438a..3e89509 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -58,6 +58,8 @@ > > DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); > > +static inline int kvm_arm_init_arch_resources(void) { return 0; } > + > int __attribute_const__ kvm_target_cpu(void); > int kvm_reset_vcpu(struct kvm_vcpu *vcpu); > int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext); > diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c > index 99c3738..c69e137 100644 > --- a/virt/kvm/arm/arm.c > +++ b/virt/kvm/arm/arm.c > @@ -1664,6 +1664,10 @@ int kvm_arch_init(void *opaque) > if (err) > return err; > > + err = kvm_arm_init_arch_resources(); > + if (err) > + return err; > + > if (!in_hyp_mode) { > err = init_hyp_mode(); > if (err) > -- > 2.1.4 > It's not clear to me from the commit message why init_common_resources() won't work for this. Maybe it'll be more clear as I continue the review. drew 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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8B27C4360F for ; Thu, 4 Apr 2019 14:25:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8CF0A20882 for ; Thu, 4 Apr 2019 14:25:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TboMalZc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CF0A20882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=P+zm8s9YQigBiRYmH1IAc1CXgaReoXljzvKLdJ3A9E0=; b=TboMalZcujPMZV hDQoa3oTWq50Eb5/Ekd2aMBCHs98GwuJcsqlcrVsZiiGyFb5kCGD5K8RlBTFEuHvN5PmvpjRyQqzy Qj31fuCPchz7GGxYisNtUdhN6t0smKRZLrG/+5gmMAu7qFSO/nh8JarH8HzO/u+3qx5L4+PXM28Y/ a9aZfNb2RwIouZYhYV4PPhcT21pvEC25X/gvrCi+v9F9A3WkS408Ayw4jBYCRKWss9XZXewwzCwwC tE7vTJba3TdsrZMKqqScjrFUnlVymdsG457vpYFZj4DYS+8V3eLfykxkhtsS/lCpWYb1cCMIhvlk/ nPz1taZf3Q8nA1vzo6Zg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hC3JB-0007j9-Th; Thu, 04 Apr 2019 14:25:37 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hC3J8-0007io-Sb for linux-arm-kernel@lists.infradead.org; Thu, 04 Apr 2019 14:25:36 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3A6D911B771; Thu, 4 Apr 2019 14:25:34 +0000 (UTC) Received: from kamzik.brq.redhat.com (unknown [10.43.2.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D471C838D4; Thu, 4 Apr 2019 14:25:30 +0000 (UTC) Date: Thu, 4 Apr 2019 16:25:28 +0200 From: Andrew Jones To: Dave Martin Subject: Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation Message-ID: <20190404142528.pxo3vrnk6mfsgmyq@kamzik.brq.redhat.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-22-git-send-email-Dave.Martin@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1553864452-15080-22-git-send-email-Dave.Martin@arm.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 04 Apr 2019 14:25:34 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190404_072534_946141_F1FE720E X-CRM114-Status: GOOD ( 20.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Okamoto Takayuki , Christoffer Dall , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Will Deacon , Zhang Lei , Julien Grall , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 29, 2019 at 01:00:46PM +0000, Dave Martin wrote: > This patch adds a kvm_arm_init_arch_resources() hook to perform > subarch-specific initialisation when starting up KVM. > > This will be used in a subsequent patch for global SVE-related > setup on arm64. > > No functional change. > > Signed-off-by: Dave Martin > Reviewed-by: Julien Thierry > Tested-by: zhang.lei > --- > arch/arm/include/asm/kvm_host.h | 2 ++ > arch/arm64/include/asm/kvm_host.h | 2 ++ > virt/kvm/arm/arm.c | 4 ++++ > 3 files changed, 8 insertions(+) > > diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h > index 770d732..a49ee01 100644 > --- a/arch/arm/include/asm/kvm_host.h > +++ b/arch/arm/include/asm/kvm_host.h > @@ -53,6 +53,8 @@ > > DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); > > +static inline int kvm_arm_init_arch_resources(void) { return 0; } > + > u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); > int __attribute_const__ kvm_target_cpu(void); > int kvm_reset_vcpu(struct kvm_vcpu *vcpu); > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 205438a..3e89509 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -58,6 +58,8 @@ > > DECLARE_STATIC_KEY_FALSE(userspace_irqchip_in_use); > > +static inline int kvm_arm_init_arch_resources(void) { return 0; } > + > int __attribute_const__ kvm_target_cpu(void); > int kvm_reset_vcpu(struct kvm_vcpu *vcpu); > int kvm_arch_vm_ioctl_check_extension(struct kvm *kvm, long ext); > diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c > index 99c3738..c69e137 100644 > --- a/virt/kvm/arm/arm.c > +++ b/virt/kvm/arm/arm.c > @@ -1664,6 +1664,10 @@ int kvm_arch_init(void *opaque) > if (err) > return err; > > + err = kvm_arm_init_arch_resources(); > + if (err) > + return err; > + > if (!in_hyp_mode) { > err = init_hyp_mode(); > if (err) > -- > 2.1.4 > It's not clear to me from the commit message why init_common_resources() won't work for this. Maybe it'll be more clear as I continue the review. drew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel