From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Martin Subject: Re: [PATCH v7 11/27] KVM: arm64: Support runtime sysreg visibility filtering Date: Wed, 24 Apr 2019 14:47:18 +0100 Message-ID: <20190424134717.GY3567@e103592.cambridge.arm.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-12-git-send-email-Dave.Martin@arm.com> <87h8anwxm4.fsf@zen.linaroharston> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5BB574A48D for ; Wed, 24 Apr 2019 09:47:24 -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 cGCnO43QDNHd for ; Wed, 24 Apr 2019 09:47:23 -0400 (EDT) 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 29D414A4B0 for ; Wed, 24 Apr 2019 09:47:23 -0400 (EDT) Content-Disposition: inline In-Reply-To: <87h8anwxm4.fsf@zen.linaroharston> 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: Alex =?iso-8859-1?Q?Benn=E9e?= 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 Wed, Apr 24, 2019 at 09:39:31AM +0000, Alex Benn=E9e wrote: > = > Dave Martin writes: > = > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optional for the guest, the visibility of > > these registers may need to depend on some runtime configuration, > > such as a flag passed to KVM_ARM_VCPU_INIT. > = > This combined with... > > --- a/arch/arm64/kvm/sys_regs.h > > +++ b/arch/arm64/kvm/sys_regs.h > > @@ -64,8 +64,15 @@ struct sys_reg_desc { > > const struct kvm_one_reg *reg, void __user *uaddr); > > int (*set_user)(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, > > const struct kvm_one_reg *reg, void __user *uaddr); > > + > > + /* Return mask of REG_* runtime visibility overrides */ > > + unsigned int (*visibility)(const struct kvm_vcpu *vcpu, > > + const struct sys_reg_desc *rd); > > }; > = > this makes me wonder what sort of machines will see different register > visibility depending on which vcpu you are running on? Userspace can consciously set KVM_ARM_VCPU_SVE in vcpu_init.features[0] for some vcpus and not for others. For one thing, this is useful for testing how the guest responds to that configuration. This will for example allow Linux's handling of these weird configurations to be tested directly rather than by hacking the guest kernel to fake it up -- which is what I've had to do up to now. > Reviewed-by: Alex Benn=E9e Thanks! (Note, Marc already picked the patches into kvmarm/next, so new tags won't be applied. But the review is still appreciated, and if you spot any issues I'd certainly like to know :) Cheers ---Dave 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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, 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 A27EAC10F11 for ; Wed, 24 Apr 2019 13:47:27 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 35BE2218D2 for ; Wed, 24 Apr 2019 13:47:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35BE2218D2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id BE5C64A4B0; Wed, 24 Apr 2019 09:47:26 -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 aorb6nRQtNCn; Wed, 24 Apr 2019 09:47:25 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7E0A24A4CF; Wed, 24 Apr 2019 09:47:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 5BB574A48D for ; Wed, 24 Apr 2019 09:47:24 -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 cGCnO43QDNHd for ; Wed, 24 Apr 2019 09:47:23 -0400 (EDT) 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 29D414A4B0 for ; Wed, 24 Apr 2019 09:47:23 -0400 (EDT) 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 98DF080D; Wed, 24 Apr 2019 06:47:22 -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 93B1A3F5C1; Wed, 24 Apr 2019 06:47:20 -0700 (PDT) Date: Wed, 24 Apr 2019 14:47:18 +0100 From: Dave Martin To: Alex =?iso-8859-1?Q?Benn=E9e?= Subject: Re: [PATCH v7 11/27] KVM: arm64: Support runtime sysreg visibility filtering Message-ID: <20190424134717.GY3567@e103592.cambridge.arm.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-12-git-send-email-Dave.Martin@arm.com> <87h8anwxm4.fsf@zen.linaroharston> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87h8anwxm4.fsf@zen.linaroharston> User-Agent: Mutt/1.5.23 (2014-03-12) 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 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="UTF-8" Content-Transfer-Encoding: quoted-printable Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Message-ID: <20190424134718.o0J7pmLZ3llns2NPUD27gV6DfnFkNF_cBJ-Ch8rbeKQ@z> On Wed, Apr 24, 2019 at 09:39:31AM +0000, Alex Benn=E9e wrote: > = > Dave Martin writes: > = > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optional for the guest, the visibility of > > these registers may need to depend on some runtime configuration, > > such as a flag passed to KVM_ARM_VCPU_INIT. > = > This combined with... > > --- a/arch/arm64/kvm/sys_regs.h > > +++ b/arch/arm64/kvm/sys_regs.h > > @@ -64,8 +64,15 @@ struct sys_reg_desc { > > const struct kvm_one_reg *reg, void __user *uaddr); > > int (*set_user)(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, > > const struct kvm_one_reg *reg, void __user *uaddr); > > + > > + /* Return mask of REG_* runtime visibility overrides */ > > + unsigned int (*visibility)(const struct kvm_vcpu *vcpu, > > + const struct sys_reg_desc *rd); > > }; > = > this makes me wonder what sort of machines will see different register > visibility depending on which vcpu you are running on? Userspace can consciously set KVM_ARM_VCPU_SVE in vcpu_init.features[0] for some vcpus and not for others. For one thing, this is useful for testing how the guest responds to that configuration. This will for example allow Linux's handling of these weird configurations to be tested directly rather than by hacking the guest kernel to fake it up -- which is what I've had to do up to now. > Reviewed-by: Alex Benn=E9e Thanks! (Note, Marc already picked the patches into kvmarm/next, so new tags won't be applied. But the review is still appreciated, and if you spot any issues I'd certainly like to know :) Cheers ---Dave _______________________________________________ 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 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, 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 32126C10F11 for ; Wed, 24 Apr 2019 13:47:33 +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 040E5218D2 for ; Wed, 24 Apr 2019 13:47:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="emGHx9QP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 040E5218D2 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=UHYeb1mncH8sYD0aBLvMnuJyPV62vjfZdU+zVzNyhcw=; b=emGHx9QPfAhHsW ULQ7J9SKgGhactCmNAfi+3LG5o7kr8RpIGruknIj4UQ6C63365anTFI9VRuAx0iziWIKFHNvafOak yNnsguR3CNETlJiatwIcuL7nTA7heailBWcdIY6vzJQz2uzfnbeg2B6JgXuaVzRJoA2mIc1+OgQdS 0q43HhXjxraqCTi9IAlQB+asKtLPydtSx5tgKp2t8TgZMMIr/+BkquSQdrdDP77A3gZOzrPyEKzrb Gs32NCDeXZNx8xmIXrC/DkJKvmDfVPGABFnMAiIXILVfRkfuv2r15pxDg32z35YNN1crJYo6DdJdw INVph2zbL+U/YXt4XWtQ==; 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 1hJIFD-0004lU-5r; Wed, 24 Apr 2019 13:47:27 +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 1hJIF9-0004l8-KP for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2019 13:47:24 +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 98DF080D; Wed, 24 Apr 2019 06:47:22 -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 93B1A3F5C1; Wed, 24 Apr 2019 06:47:20 -0700 (PDT) Date: Wed, 24 Apr 2019 14:47:18 +0100 From: Dave Martin To: Alex =?iso-8859-1?Q?Benn=E9e?= Subject: Re: [PATCH v7 11/27] KVM: arm64: Support runtime sysreg visibility filtering Message-ID: <20190424134717.GY3567@e103592.cambridge.arm.com> References: <1553864452-15080-1-git-send-email-Dave.Martin@arm.com> <1553864452-15080-12-git-send-email-Dave.Martin@arm.com> <87h8anwxm4.fsf@zen.linaroharston> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87h8anwxm4.fsf@zen.linaroharston> 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-20190424_064723_670890_8DEF545F X-CRM114-Status: GOOD ( 19.14 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 24, 2019 at 09:39:31AM +0000, Alex Benn=E9e wrote: > = > Dave Martin writes: > = > > Some optional features of the Arm architecture add new system > > registers that are not present in the base architecture. > > > > Where these features are optional for the guest, the visibility of > > these registers may need to depend on some runtime configuration, > > such as a flag passed to KVM_ARM_VCPU_INIT. > = > This combined with... > > --- a/arch/arm64/kvm/sys_regs.h > > +++ b/arch/arm64/kvm/sys_regs.h > > @@ -64,8 +64,15 @@ struct sys_reg_desc { > > const struct kvm_one_reg *reg, void __user *uaddr); > > int (*set_user)(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, > > const struct kvm_one_reg *reg, void __user *uaddr); > > + > > + /* Return mask of REG_* runtime visibility overrides */ > > + unsigned int (*visibility)(const struct kvm_vcpu *vcpu, > > + const struct sys_reg_desc *rd); > > }; > = > this makes me wonder what sort of machines will see different register > visibility depending on which vcpu you are running on? Userspace can consciously set KVM_ARM_VCPU_SVE in vcpu_init.features[0] for some vcpus and not for others. For one thing, this is useful for testing how the guest responds to that configuration. This will for example allow Linux's handling of these weird configurations to be tested directly rather than by hacking the guest kernel to fake it up -- which is what I've had to do up to now. > Reviewed-by: Alex Benn=E9e Thanks! (Note, Marc already picked the patches into kvmarm/next, so new tags won't be applied. But the review is still appreciated, and if you spot any issues I'd certainly like to know :) Cheers ---Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel