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=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 5CAB3C4360F for ; Fri, 5 Apr 2019 11:14:26 +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 200E821738 for ; Fri, 5 Apr 2019 11:14:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HHPF7Wgs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 200E821738 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.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=G1/kHiiZlaaDlSjsdZnfpMnripqekSYFcOruIAxvPlA=; b=HHPF7WgsIa+9r7 Iiw9ECGTZaDFDc5pDCjes9lDAc68d7nuIjztpum9SW+hF33i+l6fiY7SM8wBjp2ICdV4SZ/0YO2Il YzoIG3Wqx19QVIWBrd4GuRgc8Ja9TERipPotQZxyV2DzT5G5vSgkpUUCbreeSPJ7H1j9GK/0sTo7Z nkEB4ksDSHIt9BCAHKii3AHCM/Age/A6QWNaDGiVy3ibcPs3qX4TgsBYqTC3HDauqqmPs18cvQEah bZO0INVzssg0CeV22Z+S9aD0viUzEXAkTAuQue9zGPfYXne1PI1mqCdRjK7VByCSr6DLI7wZikc2r 2vIYFGEG1seUSeSxF7EA==; 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 1hCMnb-0005vm-LH; Fri, 05 Apr 2019 11:14:19 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCMnX-0005vC-Vo for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2019 11:14:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90029168F; Fri, 5 Apr 2019 04:14:15 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C0F33F557; Fri, 5 Apr 2019 04:14:13 -0700 (PDT) Date: Fri, 5 Apr 2019 12:14:11 +0100 From: Dave Martin To: Andrew Jones Subject: Re: [PATCH v7 21/27] KVM: arm/arm64: Add hook for arch-specific KVM initialisation Message-ID: <20190405111410.GZ3567@e103592.cambridge.arm.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-22-git-send-email-Dave.Martin@arm.com> <20190404142528.pxo3vrnk6mfsgmyq@kamzik.brq.redhat.com> <20190404145354.GG3567@e103592.cambridge.arm.com> <20190404163308.2aaauxituh6rfffu@kamzik.brq.redhat.com> <20190405093624.GP3567@e103592.cambridge.arm.com> <20190405104057.tonyqmskty62yw4v@kamzik.brq.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190405104057.tonyqmskty62yw4v@kamzik.brq.redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190405_041416_028884_478AD84D X-CRM114-Status: GOOD ( 24.18 ) 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, Apr 05, 2019 at 12:40:57PM +0200, Andrew Jones wrote: > On Fri, Apr 05, 2019 at 10:36:24AM +0100, Dave Martin wrote: > > On Thu, Apr 04, 2019 at 06:33:08PM +0200, Andrew Jones wrote: > > > On Thu, Apr 04, 2019 at 03:53:55PM +0100, Dave Martin wrote: > > > > On Thu, Apr 04, 2019 at 04:25:28PM +0200, Andrew Jones wrote: > > > > > On Fri, Mar 29, 2019 at 01:00:46PM +0000, Dave Martin wrote: > > > > [...] > > > > > > > > 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. > > > > > > > > init_common_resources() is for stuff common to arm and arm64. > > > > > > Well currently init_common_resources() only calls kvm_set_ipa_limit(), > > > which isn't implemented for arm. So if there was a plan to only use > > > that function for init that actually does something on both, it doesn't. > > > > Hmmm, perhaps I was wishfully interpreting the word "common" to mean > > what I would like it to mean... > > > > > > kvm_arm_init_arch_resources() is intended for stuff specific to the > > > > particular arch backend. > > > > > > I'm not sure we need that yet. We just need an arm setup sve stub like > > > arm's kvm_set_ipa_limit() stub. OTOH, if we have to keep adding stubs > > > to arm we should probably have something like > > > kvm_arm_init_arch_resources() instead, and kvm_set_ipa_limit() should > > > be moved inside the arm64 one and the arm ipa limit stub can go. Then > > > since init_common_resources() would no longer be used, it could just > > > be deleted. > > > > OK, for simplicity I may call the sve setup directly as you suggest, and > > make an arm stub for it: that feels a bit weird, but there is precedent. > > > > If we end up accumulating a lot of these, we can revisit it and maybe > > invent something like kvm_arm_init_arch_resources() at that point. > > > > Does that sound reasonable? > > Yup. Sounds good to me. OK, can do Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel