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 82800C4360F for ; Fri, 5 Apr 2019 09:52:05 +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 3E1FF21850 for ; Fri, 5 Apr 2019 09:52:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BebG2Ihu"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Udobw2VS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E1FF21850 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=uGmx/VqbM6tw9kcbRP077xi8LMr5BS8IrfQuTs0I2nw=; b=BebG2IhuQLQJPF VWFA9CFhmJGbfKL6fJE35dWavaS7gSX7qVEz0E5vjsWkfHslXZ6Ks/UHjOQ4M3W5Zq3nKFdkwvT7h FBxx62In3lKl8IShbuDfu/l892Fnp4QvXgo4zsx1XgeyNXoY+2REfUPpjLONbAJj33UA/R6IKUI/h jmBcsBqw6PwS9YjXvvjN6nLrYJ4yZtvQirDRmCPHZKkWq27KVn4wr84SBCJLuxMzqMtHO9ECCPg1z zFVsUCvRDGLB4G5z/f8zJBqU7XZitJxUFB+WUrQIxJQdjegnwalq7lDUzsJSpiig+K0Lsv0+qWQhj ZthXc43QyzFjAzEMfdYQ==; 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 1hCLVw-00032v-6q; Fri, 05 Apr 2019 09:52:00 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCLVr-0002jn-VA for linux-arm-kernel@bombadil.infradead.org; Fri, 05 Apr 2019 09:51:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C9Fh8Ao44ODU/cZtRTXXpo5QTcer0ig68PcJJXFwzOc=; b=Udobw2VSJFo0eAIGAFHgdZhfv bg6fJdVSRLTc7Znn/pFF7feGhZU1xSKfYamMS1NLBvuWb69tNVbg3gctze1Hh+wp33HfZrJfk3cmM RmYEFhpX/PNYB8eJIseeE5dOTTjOilH8TZ4ykGNZ1N5tafDte/2snlINgO8cC16tA2CFbEzopWaPD SShkSe+1WeMuGXHjw0ekDqRbaHjld/C1FDNIyE5O/LIJsWAq7sgAgGFT08AnF8erEW13HeRWIQ1nN 3pDnTvffWXrErC+637Uvz8dAJc68frPQ00Oj0jc1hogOAji3hXy3vVY2R59FbiEbh7skFCXTJRH2Z gc+H5/D9Q==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hCLGw-0006ym-Gf for linux-arm-kernel@lists.infradead.org; Fri, 05 Apr 2019 09:36:32 +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 092D61993; Fri, 5 Apr 2019 02:36:29 -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 E80FF3F73B; Fri, 5 Apr 2019 02:36:26 -0700 (PDT) Date: Fri, 5 Apr 2019 10:36:24 +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: <20190405093624.GP3567@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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190404163308.2aaauxituh6rfffu@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_103630_865882_4B9006C4 X-CRM114-Status: GOOD ( 24.21 ) 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, Dave Martin , 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 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? Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel