From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 CBB6E199EE for ; Thu, 20 Jul 2023 08:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689843172; 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=gwK8AXz7jkXfdRTnSd9jL9yJK/TtFs99GYswlm71JSI=; b=CzCg82o5zPvU6S24XllaAilYOPKZE/Zu1ddRttTWhUTWr8y+nuRfdmxmnNjDLE9UveGwMp FqXmVdlcdCy+QbkSZh1H94hdlvIwhqslWVgchkZtDJwI6z6nV+AAk4sJKmzkrG17pGD8eL Cnc/ihFp22q7xafvn4jzxpqidC4wCFY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-3OwwNMXhMeira2AVwmr1UA-1; Thu, 20 Jul 2023 04:52:48 -0400 X-MC-Unique: 3OwwNMXhMeira2AVwmr1UA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C67FD10504C1; Thu, 20 Jul 2023 08:52:47 +0000 (UTC) Received: from localhost (dhcp-192-239.str.redhat.com [10.33.192.239]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 810D240C206F; Thu, 20 Jul 2023 08:52:47 +0000 (UTC) From: Cornelia Huck To: Jing Zhang , KVM , KVMARM , ARMLinux , Marc Zyngier , Oliver Upton Cc: Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh , Jing Zhang Subject: Re: [PATCH v6 3/6] KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1 In-Reply-To: <20230718164522.3498236-4-jingzhangos@google.com> Organization: Red Hat GmbH References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-4-jingzhangos@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 20 Jul 2023 10:52:46 +0200 Message-ID: <87o7k77yn5.fsf@redhat.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 On Tue, Jul 18 2023, Jing Zhang wrote: > All valid fields in ID_AA64DFR0_EL1 and ID_DFR0_EL1 are writable > from usrespace with this change. Typo: s/usrespace/userspace/ > > Signed-off-by: Jing Zhang > --- > arch/arm64/kvm/sys_regs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 053d8057ff1e..f33aec83f1b4 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -2008,7 +2008,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > .set_user = set_id_dfr0_el1, > .visibility = aa32_id_visibility, > .reset = read_sanitised_id_dfr0_el1, > - .val = ID_DFR0_EL1_PerfMon_MASK, }, > + .val = GENMASK(63, 0), }, > ID_HIDDEN(ID_AFR0_EL1), > AA32_ID_SANITISED(ID_MMFR0_EL1), > AA32_ID_SANITISED(ID_MMFR1_EL1), > @@ -2057,7 +2057,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > .get_user = get_id_reg, > .set_user = set_id_aa64dfr0_el1, > .reset = read_sanitised_id_aa64dfr0_el1, > - .val = ID_AA64DFR0_EL1_PMUVer_MASK, }, > + .val = GENMASK(63, 0), }, > ID_SANITISED(ID_AA64DFR1_EL1), > ID_UNALLOCATED(5,2), > ID_UNALLOCATED(5,3), How does userspace find out whether a given id reg is actually writable, other than trying to write to it? 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 9420BEB64DD for ; Thu, 20 Jul 2023 10:03:10 +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=BwJfJYN5DhMYtY/7imi0cHwGJPdFvlET4JYyky4JVsg=; b=pOXrgF2XU/ZSYr V9skL+jbVx8q34Vgx6g4ZPUQQcmP7S/rz1j9lxQcZr3RsGdgaqJSQuw9HKB8x1X31iJm10f1L2Mfj kx4iv48osY7nZQHKZURBmNGPmSUAwR7piZ06dUgm/oz0FnMZTgHtnQQ9Q3xNeKDoQJhkU7PmtKmRx ExSSfzGR2u+p86RMn085c9hyVb7Q5DFVW3EQbB568FPFnJ8RbET25dOtnZsQrj421QJX+kXRAsiEL 7wnDu7ieOIFp6ji42jHULyo6rSw2OBICklMFWqmNOPtAbTouQ9agQR3GtzqtMnEaoFmF5cJdI/PJj WVffjnL4sQLeksbZDIjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qMQUi-00AfPl-0D; Thu, 20 Jul 2023 10:02:48 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMQUg-00AfP9-2g for linux-arm-kernel@bombadil.infradead.org; Thu, 20 Jul 2023 10:02:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:Message-ID: Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gwK8AXz7jkXfdRTnSd9jL9yJK/TtFs99GYswlm71JSI=; b=GmxffqZBPL57XpGVV0Su4AiuyK 4FLommnJp7qFqH57aGhi97AtZMLqnhI9E+rD27KUOaEzwIWz8+vMGqF48vt8WbFU43IPkoH06GiLf X/GLkXD1LVEx4H+0YkvQyGCLTRXVtn3fFQ2wpZYt7v7Av8O58v8lDnFjJn4SCJnqCaPx2kGDMP0vt JtJWsKbDF3SJfFc5qQKQE4HJtIncxPq1pFYiz0GNvTMIUOJMo9AevyG6IpsAxIjn/BGS/0VZLQ/68 3QAZGv7r4s51FFyg0g/aBuG5txADErBEwLZbuo0TSEVEqNsi72ipl8YdtGhWZ6hRW2pinghlj2jF5 qqyffP9Q==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qMPQj-00FRVE-0g for linux-arm-kernel@lists.infradead.org; Thu, 20 Jul 2023 08:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689843271; 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=gwK8AXz7jkXfdRTnSd9jL9yJK/TtFs99GYswlm71JSI=; b=DHGZ7ZNHCbrYXVrgpbo6fFris5chqIsa1nC8cP5Vy8EPATb7bPY2ciskzyEY66StuDjYIW SP6NP3pj+9L/2unlQQIg3TXhZ21TrGnDaObJvLjbMOvhJTXIdqyYSnHRawFsv1ql5jjLOP fg71vJFpnos8SaebYR5EKEy4U+BZg8U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689843271; 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=gwK8AXz7jkXfdRTnSd9jL9yJK/TtFs99GYswlm71JSI=; b=DHGZ7ZNHCbrYXVrgpbo6fFris5chqIsa1nC8cP5Vy8EPATb7bPY2ciskzyEY66StuDjYIW SP6NP3pj+9L/2unlQQIg3TXhZ21TrGnDaObJvLjbMOvhJTXIdqyYSnHRawFsv1ql5jjLOP fg71vJFpnos8SaebYR5EKEy4U+BZg8U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-3OwwNMXhMeira2AVwmr1UA-1; Thu, 20 Jul 2023 04:52:48 -0400 X-MC-Unique: 3OwwNMXhMeira2AVwmr1UA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C67FD10504C1; Thu, 20 Jul 2023 08:52:47 +0000 (UTC) Received: from localhost (dhcp-192-239.str.redhat.com [10.33.192.239]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 810D240C206F; Thu, 20 Jul 2023 08:52:47 +0000 (UTC) From: Cornelia Huck To: Jing Zhang , KVM , KVMARM , ARMLinux , Marc Zyngier , Oliver Upton Cc: Will Deacon , Paolo Bonzini , James Morse , Alexandru Elisei , Suzuki K Poulose , Fuad Tabba , Reiji Watanabe , Raghavendra Rao Ananta , Suraj Jitindar Singh , Jing Zhang Subject: Re: [PATCH v6 3/6] KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1 In-Reply-To: <20230718164522.3498236-4-jingzhangos@google.com> Organization: Red Hat GmbH References: <20230718164522.3498236-1-jingzhangos@google.com> <20230718164522.3498236-4-jingzhangos@google.com> User-Agent: Notmuch/0.37 (https://notmuchmail.org) Date: Thu, 20 Jul 2023 10:52:46 +0200 Message-ID: <87o7k77yn5.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230720_095439_805178_AD5F3D21 X-CRM114-Status: GOOD ( 15.21 ) 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 Tue, Jul 18 2023, Jing Zhang wrote: > All valid fields in ID_AA64DFR0_EL1 and ID_DFR0_EL1 are writable > from usrespace with this change. Typo: s/usrespace/userspace/ > > Signed-off-by: Jing Zhang > --- > arch/arm64/kvm/sys_regs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 053d8057ff1e..f33aec83f1b4 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -2008,7 +2008,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > .set_user = set_id_dfr0_el1, > .visibility = aa32_id_visibility, > .reset = read_sanitised_id_dfr0_el1, > - .val = ID_DFR0_EL1_PerfMon_MASK, }, > + .val = GENMASK(63, 0), }, > ID_HIDDEN(ID_AFR0_EL1), > AA32_ID_SANITISED(ID_MMFR0_EL1), > AA32_ID_SANITISED(ID_MMFR1_EL1), > @@ -2057,7 +2057,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > .get_user = get_id_reg, > .set_user = set_id_aa64dfr0_el1, > .reset = read_sanitised_id_aa64dfr0_el1, > - .val = ID_AA64DFR0_EL1_PMUVer_MASK, }, > + .val = GENMASK(63, 0), }, > ID_SANITISED(ID_AA64DFR1_EL1), > ID_UNALLOCATED(5,2), > ID_UNALLOCATED(5,3), How does userspace find out whether a given id reg is actually writable, other than trying to write to it? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel