From patchwork Tue Jul 18 16:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13318339 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 1B761C001DC for ; Wed, 19 Jul 2023 06:32:25 +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:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=oFfJAQvWuVfI9XmKgAWsnnPfBvyDL/SYA14vn/tJdYI=; b=JYwgWjgY6iFsuywb6IhGwBZ6D7 TYZB9+RlPTO4PlbnrddD2eJmOClt8/UWIkLahkSNResQtwnOfOnybNc4YG5Rzf9rniLXzB8j1DGpr olimLgJkdHoO7gUZkITi6teVh0AK8tTZloWdmFptbCsMZv4oovfbNuJuMw3VoRLY1xZizIgrEWO2e N8Vk2Y+mlKHCfTJrlI8aFOecdhet/4UjH8icdypve+vZ/x0CZiGIBirkicj+4MYUNII4aGWCzSeem wgYQnR4P1XQyY4IrmEaSQovUAInU4/WR0c4OsypTh21sf37MS3rkL3s6okzFD5D9ahpDHxuQMscZH njGzpsTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM0jH-005lc9-1s; Wed, 19 Jul 2023 06:32:07 +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 1qM0jD-005lZY-1Z for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 06:32:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Cc:To:From:Subject: Message-ID:References:Mime-Version:In-Reply-To:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BJAEm87EHCeOWjKJA30wa69olvlB7/s8Sl9tx5zF2lQ=; b=ikL/Ve7QoVYoTOUo6fuA5NZ5V7 ++KbpKnCIA7+kmSGSE7LpucGBgkKymx/Z+g2idM5v1DGU3g/ZEka06LqbxgNNPrCCZN8QwPPLDHB4 OiJrNyhyHsg3sRqKnEAI5CTSfYPMR5eXXzZzpgzQHFSys8ODg9rOkQkO9wKyHP3WDBaDPb5HZ8F0G Zp3jDor7u6cqKksJv2pSK87WiXTCpkU17JqAaG9ulxDTsghs8B5SkA4xWSBEJtmMR0YJbdCsf+yWH XxRuxnym8qW2jbiDoQ+grBzQJZHEw6lxYX+b0EHTo9kDF3mGoeCjR9+HE5jClvbtLNXloICT77dUb ZK++cOZA==; Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLnrO-00BlUx-05 for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2023 16:47:39 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-c0d62f4487cso5154370276.0 for ; Tue, 18 Jul 2023 09:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689698733; x=1692290733; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=BJAEm87EHCeOWjKJA30wa69olvlB7/s8Sl9tx5zF2lQ=; b=tfkUfwMnUrklnQXtS24STivSqw+iQ+fA4TFwL7HBlnVEqzpPO8wCQ0LzpDSsOXDIpq x1/xbW5Lhl6F4kgls2JBqjroHcaQnRMYYJLqW0gMXBA7aLWFZfF7BOvE2ePSI4YJGRyq tywUlFjWuB1m0rig8gPtAG6ItxfiXWgZks/sD6CDikU55wFiKZseByVkSBlcnOcVegfQ +i69uPR777tzcJrLjb0dFAMyV7mgl0lLfmDOUSf99DAyjF20886gF+hjgJTC1GBY8SF/ +MkAxzuIn0PQYGkJCzAuprDebJHw1S8ISx4qq165nToNntEQ+6B/I30mZedwjS5SCiro 8iBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689698733; x=1692290733; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BJAEm87EHCeOWjKJA30wa69olvlB7/s8Sl9tx5zF2lQ=; b=P6SlwdXsgb3WIzX3yqOAytzy92WLZJQZ9F7c7nTAf44U8vsfTLot725kO5w90jUzJ+ S3pgopwha/3hzKCnb8AuBd+XHIy+dSPCkX2SSm95O65QLDpLhDEvvllJc/iLyLNGOcwR KTlIDe5r4z6DqgKwruqCD17mHw5AmZg1KK8KYvXMVGCXnWW/+LnBOkMhndN+UZntw1bA gaQnnuWkr0kYaWnpkpNroA4yqpwVGwMGn/mifkVLqgCOCZgJlnUZ7JYk0YXHrESeFrLN MKTcvIDxgIuYO3fQGTCydJxUJaejkWsMbKEBqLgZA2aCk56DVtCjfaouBjG8XCquO2OA 3GHQ== X-Gm-Message-State: ABy/qLb4WdsPwYrNo0RW5LvVnV8fhx6RzIpSvq1dplr3iG004vN7Zwcz pUGN00X9f9/QCpepMS2wMumEHfjELb/S37jY+w== X-Google-Smtp-Source: APBJJlG7+TffRkqMu2lcoVZqj2J4kwXnhwITwWw6ib/WW3uqG7zZKtjT/gjSzmWi7SNVPapr4h2k9BU/V5PlgHmjwA== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a25:9745:0:b0:ce9:4c77:bc0b with SMTP id h5-20020a259745000000b00ce94c77bc0bmr2571ybo.11.1689698732911; Tue, 18 Jul 2023 09:45:32 -0700 (PDT) Date: Tue, 18 Jul 2023 16:45:19 +0000 In-Reply-To: <20230718164522.3498236-1-jingzhangos@google.com> Mime-Version: 1.0 References: <20230718164522.3498236-1-jingzhangos@google.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230718164522.3498236-4-jingzhangos@google.com> Subject: [PATCH v6 3/6] KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1 From: Jing Zhang To: 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 , Cornelia Huck , Jing Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_174738_199260_F80F0BD3 X-CRM114-Status: GOOD ( 11.02 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org All valid fields in ID_AA64DFR0_EL1 and ID_DFR0_EL1 are writable from usrespace with this change. 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),