From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Martin Subject: Re: [RFC PATCH v2 20/23] KVM: arm64: Add arch vm ioctl hook Date: Tue, 20 Nov 2018 14:19:12 +0000 Message-ID: <20181120141911.GA3505@e103592.cambridge.arm.com> References: <1538141967-15375-1-git-send-email-Dave.Martin@arm.com> <1538141967-15375-21-git-send-email-Dave.Martin@arm.com> <20181102083227.GU12057@e113682-lin.lund.arm.com> <20181115180421.GS3505@e103592.cambridge.arm.com> <20181120105852.GJ3835@e113682-lin.lund.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 DCCEC4A2E7 for ; Tue, 20 Nov 2018 09:19:17 -0500 (EST) 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 7RiirDls0EAw for ; Tue, 20 Nov 2018 09:19:16 -0500 (EST) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C7C5F4A2BB for ; Tue, 20 Nov 2018 09:19:16 -0500 (EST) Content-Disposition: inline In-Reply-To: <20181120105852.GJ3835@e113682-lin.lund.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: Christoffer Dall Cc: Okamoto Takayuki , Christoffer Dall , Ard Biesheuvel , Marc Zyngier , Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org List-Id: kvmarm@lists.cs.columbia.edu On Tue, Nov 20, 2018 at 11:58:52AM +0100, Christoffer Dall wrote: > On Thu, Nov 15, 2018 at 06:04:22PM +0000, Dave Martin wrote: > > On Fri, Nov 02, 2018 at 09:32:27AM +0100, Christoffer Dall wrote: > > > On Fri, Sep 28, 2018 at 02:39:24PM +0100, Dave Martin wrote: > > > > To enable arm64-specific vm ioctls to be added cleanly, this patch > > > > adds a kvm_arm_arch_vm_ioctl() hook so that these don't pollute the > > > > common code. > > > > > > Hmmm, I don't really see the strenght of that argument, and have the > > > same concern as before. I'd like to avoid the additional indirection > > > and instead just follow the existing pattern with a dummy implementation > > > on the 32-bit side that returns an error. > > > > So for this and the similar comment on patch 18, this was premature (or > > at least, overzealous) factoring on my part. > > > > I'm happy to merge this back together for arm and arm64 as you prefer. > > > > Do we have a nice way of writing the arch check, e.g. > > > > case KVM_ARM_SVE_CONFIG: > > if (!IS_ENABLED(ARM64)) > > return -EINVAL; > > else > > return kvm_vcpu_sve_config(NULL, userp); > > > > should work, but looks a bit strange. Maybe I'm just being fussy. > > I prefer just doing: > > case KVM_ARM_SVE_CONFIG: > return kvm_vcpu_sve_config(NULL, userp); > > > And having this in arch/arm/include/asm/kvm_foo.h: > > static inline int kvm_vcpu_sve_config(...) > { > return -EINVAL; > } Sure, I can do that if you prefer. I was a little uneasy about littering arm64 junk all over the arch/arm headers, but we already have precedent for this and it keeps the call sites clean. Cheers ---Dave