From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-17.mta0.migadu.com (out-17.mta0.migadu.com [91.218.175.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA894DDD4 for ; Fri, 21 Jul 2023 21:10:12 +0000 (UTC) Date: Fri, 21 Jul 2023 21:10:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689973810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qX7D7IfSV6pjjnY7PqLth1+9ew15naXT3J3p5h8PUhE=; b=OpHiX5u6iaM3e6PagcHSpi7Wh9Zs4H409/6i1SdDX9zv7DCg6Anj17LFaPPjrStp/HmcNy ODSAytlH+GK2yPfEVeE+ulvUSOwFX0ytQ+Os4rLmmxhHh6sNWIvKA3GjbHyToGbrt/CVFE /Rb6NxQ6OvcV0kznkEhN6npa8YhSJ7A= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Jing Zhang Cc: Marc Zyngier , Cornelia Huck , KVM , KVMARM , ARMLinux , Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh Subject: Re: [PATCH v6 3/6] KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1 Message-ID: References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-4-jingzhangos@google.com> <87o7k77yn5.fsf@redhat.com> <87sf9h8xs0.fsf@redhat.com> <86r0p1txun.wl-maz@kernel.org> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT On Fri, Jul 21, 2023 at 11:22:35AM -0700, Jing Zhang wrote: > On Fri, Jul 21, 2023 at 2:31 AM Marc Zyngier wrote: > > My preference would be a single ioctl that returns the full list of > > writeable masks in the ID reg range. It is big, but not crazy big > > (1536 bytes, if I haven't messed up), and includes the non ID_*_EL1 > > sysreg such as MPIDR_EL1, CTR_EL1, SMIDR_EL1. > Just want to double confirm that would the ioclt return the list of > only writable masks, not the list of {idreg_name, mask} pair? So, the > VMM will need to index idreg's writable mask by op1, CRm, op2? I generally agree with the approach Marc is proposing, but I wonder if it makes sense to have userspace ask the kernel for this information on a per-register basis. What I had in mind was something similar to the KVM_GET_ONE_REG ioctl, but instead of returning the register value it'd return the mask of the register. This would keep the kernel implementation dead simple (I'm lazy) and more easily allow for future expansion in case we want to start describing more registers this way. Userspace would iterate the ID register space and ask the kernel for the mask of registers it wants to change. Thoughts? -- Thanks, Oliver 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 03278C0015E for ; Fri, 21 Jul 2023 21:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=07KRqmna9ayfcILW6FVAPnle44okZL1Md1poTE9RTMU=; b=MzUd9hZNyTmsbl t4QQinD9SKkL9uVekNpnkeQ0cHpkOSct3WADfWdjM3ixgdsdj/e4Cm1ibxf/g2synsNdHvTtZco3K vzViNuAjMxZfIjhDMqGuPfQH8y8k9HJtkqtG+P23Fk1bCCZCvaUIke6j58TdCXI3KbFM0UweWvzLy 55pq5HngZKteCQQILlsnxoSopyLsiE6SHVvCF3znyP0fJAx7YEwBD9ZmyTwSDZLH6akuH0ug5kwTT NZOKXdkYx/7dijPzya7+obo5eSjO9JZZnK+calGcrMdhGiS794pEObRli+7QpMfFHyIxFHuv1aSwr 4u3bBCpV7MtMmBErebrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMxOJ-00F86t-20; Fri, 21 Jul 2023 21:10:23 +0000 Received: from out-54.mta0.migadu.com ([2001:41d0:1004:224b::36]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMxOG-00F85M-1t for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2023 21:10:22 +0000 Date: Fri, 21 Jul 2023 21:10:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1689973810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qX7D7IfSV6pjjnY7PqLth1+9ew15naXT3J3p5h8PUhE=; b=OpHiX5u6iaM3e6PagcHSpi7Wh9Zs4H409/6i1SdDX9zv7DCg6Anj17LFaPPjrStp/HmcNy ODSAytlH+GK2yPfEVeE+ulvUSOwFX0ytQ+Os4rLmmxhHh6sNWIvKA3GjbHyToGbrt/CVFE /Rb6NxQ6OvcV0kznkEhN6npa8YhSJ7A= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Jing Zhang Cc: Marc Zyngier , Cornelia Huck , KVM , KVMARM , ARMLinux , Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh Subject: Re: [PATCH v6 3/6] KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1 Message-ID: References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-4-jingzhangos@google.com> <87o7k77yn5.fsf@redhat.com> <87sf9h8xs0.fsf@redhat.com> <86r0p1txun.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230721_141020_780674_39247F63 X-CRM114-Status: GOOD ( 14.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org T24gRnJpLCBKdWwgMjEsIDIwMjMgYXQgMTE6MjI6MzVBTSAtMDcwMCwgSmluZyBaaGFuZyB3cm90 ZToKPiBPbiBGcmksIEp1bCAyMSwgMjAyMyBhdCAyOjMx4oCvQU0gTWFyYyBaeW5naWVyIDxtYXpA a2VybmVsLm9yZz4gd3JvdGU6Cj4gPiBNeSBwcmVmZXJlbmNlIHdvdWxkIGJlIGEgc2luZ2xlIGlv Y3RsIHRoYXQgcmV0dXJucyB0aGUgZnVsbCBsaXN0IG9mCj4gPiB3cml0ZWFibGUgbWFza3MgaW4g dGhlIElEIHJlZyByYW5nZS4gSXQgaXMgYmlnLCBidXQgbm90IGNyYXp5IGJpZwo+ID4gKDE1MzY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