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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A26E9C001DC for ; Wed, 26 Jul 2023 17:24:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbjGZRYP (ORCPT ); Wed, 26 Jul 2023 13:24:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjGZRYN (ORCPT ); Wed, 26 Jul 2023 13:24:13 -0400 Received: from out-56.mta1.migadu.com (out-56.mta1.migadu.com [95.215.58.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F97319BE for ; Wed, 26 Jul 2023 10:24:12 -0700 (PDT) Date: Wed, 26 Jul 2023 10:24:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1690392250; 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=DigPotkusHKdDC5GOWfYwMjN1u+1mEU4Mjxveaa/3Ac=; b=NUhEjdglmOcIFXTyEMvE7e4uyhdKEhThMDece/htE+ar+2gMIivKBd6kBTpGsKNI5ZO4XP kH3MdJRqC0AFdZHa3IaZB536jcnV5Lt3vjKkXBuczWp1sD/v4dQ+jntudkdZo74Yb9rxsO GoeJaFD9McHX1wBq49zcaFJw1IlUEkc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Cornelia Huck 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 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> <87edkxg0jr.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87edkxg0jr.fsf@redhat.com> X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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. > 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. -- Thanks, Oliver