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 DDC7AC001E0 for ; Thu, 27 Jul 2023 09:35:32 +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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z/CUCaSBRd0vizmAfv0EOCvlvXaV13f4rvaiFyaBjCc=; b=W2Ly4qcfyi4Gg6 a/Ye8WpiRawvcjmmVw1jDPSQffn97Rqm+dGUuO2j86BhIErDFGod8Nf56lomWu05/KS/P7lvQhASr T559U4Pzno/SWI8Cx/E/1feOfrAdtOAr9l4s+f/usk0kn3myXsznRH4xJh6rN60fovQh+JOj+qWNz SV/01MGWfX3Tjh4tuI4KTSmGYaNWsjYNVbYSS2Rnvdd4PqM/GZa2JZTYiWGZwqMovUlAtcGLi3WjE +vGIqe3dRDuNVK8QogLZE0a4i/cci61Qw+B1D2VHmWp6gicGt9AmTcmnzou4rzgBaciTK3G3QmHOS fX/s974YOEoxtkQFK98A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qOxOm-00CqlQ-2N; Thu, 27 Jul 2023 09:35:08 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qOxOj-00Cqkb-24 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jul 2023 09:35:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1690450503; 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: in-reply-to:in-reply-to:references:references; bh=XF4EWqeO3utKlZb4GqfyDhkUV3gjNXvAr/jtDDNki8Y=; b=HDtLxpk7jzwDVpiQvdg7/d9EB+5DLMSR63t4MJjCMc5oxaz1XuPw2O4NFhealFhEl3coxA /pWLKqADUn8iz70W/bGvoVPnEfpDSXj9fsfuMalKtw5b91+EtpkK+dwZ5VScP+84nWOmNO FJUo/sZFdXLOUcWqZIk8CNn8V2id0YU= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-54-fEa3c2g0MEWOSi8fD0qHcw-1; Thu, 27 Jul 2023 05:35:01 -0400 X-MC-Unique: fEa3c2g0MEWOSi8fD0qHcw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 084A91C2BD66; Thu, 27 Jul 2023 09:35:01 +0000 (UTC) Received: from localhost (dhcp-192-239.str.redhat.com [10.33.192.239]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA940414A80D; Thu, 27 Jul 2023 09:35:00 +0000 (UTC) From: Cornelia Huck To: Oliver Upton Cc: Jing Zhang , Marc Zyngier , 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 In-Reply-To: Organization: Red Hat GmbH 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> <87edkxg0jr.fsf@redhat.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 27 Jul 2023 11:34:57 +0200 Message-ID: <878rb166ke.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230727_023505_755302_FD690DFA X-CRM114-Status: GOOD ( 23.11 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 26 2023, Oliver Upton wrote: > Hi Cornelia, > > On Mon, Jul 24, 2023 at 10:45:44AM +0200, Cornelia Huck wrote: >> On Fri, Jul 21 2023, Oliver Upton wrote: >> > 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. >> >> Hm... for userspace it might be easier to get one big list and then >> parse it afterwards? Similar to what GET_REG_LIST does today. > > Possibly, but I felt like it was a bit different from GET_REG_LIST since > this would actually be a list of key-value pairs (reg_id, mask) instead > of a pure enumeration of IDs. My worry is that if/when we wind up describing > more registers in this list-based ioctl then userspace is going to wind > up traversing that structure a lot to find the register masks it actually > cares about. Depends on how userspace actually digests it, but point taken. > >> Are you thinking more of a KVM_GET_REG_INFO or so ioctl, that could >> support different kinds of extra info (and might also make sense for >> other architectures?) If we end up with something more versatile, it >> might make sense going that route. > > TBH, I hadn't considered the extensibililty of a per-register ioctl, but > that does seem like a good point. Maybe smth like /* available with KVM_CAP_GET_REG_INFO */ struct kvm_reg_info { __u64 id; __u32 op; __u32 len; __u8 data[]; }; /* operations for kvm_reg_info->op */ #define KVM_REG_INFO_ARM_ID_REG 0 #define KVM_GET_REG_INFO _IOW(KVMIO, 0xd2, struct kvm_reg_info) and returning sys_reg_desc->val in data if id points to a valid id reg. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel