From patchwork Tue Aug 1 15:20:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13336934 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 2F05DC0015E for ; Tue, 1 Aug 2023 15:21:02 +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=UIK/LPjv07abhq11Zcmzmk3PFyh6Ys8TF8C9rhc9DKw=; b=Tfn2c8i0hm0yLGc+kuPXj0kHqT rrm6B4pLfVKUH6ga3Pe4BE4MKUN2bwg9GQxJM5vzSmELYfZIDIqU0f0nSxgsQ+hkgqqp2onD7QZNM 7dH3KqgUknLFHzkcS8FWiKwaVy8ohE6A+/WUceEdalCBB1BsEmDgjZqMrwDPoSK9qS5J3OsZ7C4ZP f6zbIoTKHbpXtjfjTty60N/mCbVi38AwzB3VHeEiN9P/gwZyLdBvNUKEZPcOe3combJzu69SY8xim j4qWT/P/I94aloenr3dav5Zr/Lubmz8ifO9VlKiGv/wqylbb6SQFuy2Ah7aNY04KEg4r3DvwPq+Jp t/qZLKzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQrAo-002hjv-0E; Tue, 01 Aug 2023 15:20:34 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQrAj-002hal-2i for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 15:20:31 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1bbb97d27d6so40522225ad.1 for ; Tue, 01 Aug 2023 08:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690903221; x=1691508021; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=5CnHym/u4lCc+2ZRHUcKoPxTfNqi1z6j2L8Et7c5ypg=; b=ITQmxLoYmO8h9hfwALbwL2rbBiAv0WLTDqVVXqQ68Kx3CrRI2YuJDvikKqxD98orlv asBoUJOWDE/bC378g+AcV7451TxIqgjUWQoongTCjB6tBtusYCGinPnTxb8547akp1iy 7xfjc5EQNTUSFk/UM3dVuwC9GH3YS8wLhgVdHaJ1rj+9Z0dOK9ZsPNHXPZkaJ+wIm1zI pflTA6JfCQ5Cn1EKiIj4ULclDADFcWUGls/+h1FWcEC574Su2y04w9J8m81XMUW0eBGx whjUwbBD1KqWHEUQm8NzZIKN4o6U5CQYuyrnQnuU87g9I+ZajU9x2fLC8hsIjBTegaEa FOvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690903221; x=1691508021; 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=5CnHym/u4lCc+2ZRHUcKoPxTfNqi1z6j2L8Et7c5ypg=; b=HbxMq9hzrtVM5Kg/G2DzwZANg+dwx15LZz7o2PBb7bJjP+M8EVjWAk5SfwJXy2ouEh 7hogyUjZBPfmGtXbVr4Sy4qHpJTC8SpkYZwFPlBtRhMK2QdGj9vZFlyH6w48X/qRCADc EUVsoLOREv5X7DakkvgIoE3IEYJ0kwVqMWJIxnIfMesEs8HQQn1HVALA/jn1/LfEtNzI rgR5ivCfz4r0gChrip0WopbVRTt8ZKLNz0R/IMJOWAlZ37MZstZWPGXABfV1ebqDmVM2 3WS5fuRMk9TWMrgKtKkcfFDf9hBTDanM4KLOagXDEWn/IAVeQ8txggZs2/ls6WzY6Gke 2MWA== X-Gm-Message-State: ABy/qLa/K+VJ5YSRS6KJA9vxFY9kgKiZ0B9PTgciL90p1XBUXY5SgilT wF9WlnNg00pL3yRTDkW+7W/2CtXbud09x0sa8w== X-Google-Smtp-Source: APBJJlEnPwgkTgMCnI54ZmtyPE3ZmqrSTb8N+c2ZmA4uLAPIPk28sPLKkYPRVyGSa7M9V2JcblPYsgrU4Lh3MjT/iQ== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:902:da83:b0:1b3:c62d:71b5 with SMTP id j3-20020a170902da8300b001b3c62d71b5mr60476plx.0.1690903221091; Tue, 01 Aug 2023 08:20:21 -0700 (PDT) Date: Tue, 1 Aug 2023 08:20:01 -0700 In-Reply-To: <20230801152007.337272-1-jingzhangos@google.com> Mime-Version: 1.0 References: <20230801152007.337272-1-jingzhangos@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230801152007.337272-6-jingzhangos@google.com> Subject: [PATCH v7 05/10] 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-20230801_082029_877511_A71DA234 X-CRM114-Status: GOOD ( 12.17 ) 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 7fcbc317f100..2183cd3af472 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2006,7 +2006,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), @@ -2055,7 +2055,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),