From patchwork Mon Aug 7 16:22:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13344527 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 3BEEAC04A94 for ; Mon, 7 Aug 2023 16:23:00 +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=6tJ1fTY1zQcA3r6E5DLEASa/ausvaA0AZdkURp6ptxI=; b=kxd7KSR3pzRXIjNfMgyQXn6tMF HSM/5pOvvvYh4qq8p73y6FUt1W0YUKhSO8ANMISmQkpk4jlLEwdyL4X2pbF0Q6WW+vaB8CVCv3mzM nBPnK3o/RoPi+zEAXEiVuFIeTnYyq3aGsuyE1d1G7vzavPC05eUY0ARHdFSqEiNJFbgaIPyxafqPd b7ngUD2r3NAnDwht2/TdRZwTEsyw2vClA9lTRKHXQwfA9JU6Afso7mZ2EjYjm7AMNLIAPLka9uRvk E7PE8PKJX8jIIBVr5DADOM7D5xGuG0FSHUgOnt+YYsZWM5AUa8/BgDv8gwV8I4O/soxBXc5jADUVJ 7y/Mwq4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT304-000AU9-2c; Mon, 07 Aug 2023 16:22:32 +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 1qT2zw-000AO8-2Y for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 16:22:26 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1bbf8cb6250so36813935ad.2 for ; Mon, 07 Aug 2023 09:22:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691425343; x=1692030143; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xxutBbfGAJNlYXBOxeWHmgbZQPEyXZB54Uqq0kRAHGs=; b=eEeluUifPz1M9tVSAEOgeKTv2NRp0MPldGadBVLWH/1lhBXDgQmYbzuZJHMpExY2Ko 8zql+LqyGqEE6iXv4QmtPmy13ZM278jyBqh8jaITa82qbrl1pDuwXovMpYjPyAaED6xg XswWphpTe0Y153oTV+cUmV1aFqExLDudWao2L4EOlgJ+eF0h4XooUr9fZXsoTL3EqM72 V2zY1K8l/FSq/H1ct34ti6unDBX0pRqM1gVtZvaofWJ5mONF0a3c2idyA+c91/P5y3b5 mhN6vF2ZmhTBaag9UtqC3WRZ0g77PsGOh6hNVvEbGA7UkbOyHMw02W/Ow4vV2eRxJoCp nphw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425343; x=1692030143; 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=xxutBbfGAJNlYXBOxeWHmgbZQPEyXZB54Uqq0kRAHGs=; b=OvV+tBeD6gMPPz0KOZyhkd3nBQ5ubZ3E6lfVZ0B/l/6I6i+21ydrw07/idhwFdJkOd DHwKeSQub4F5/l3BOriRODFS+fDbgRTe2pHiNXMenGt1pLXesbYCBlkfNRJ65RHn4P3z X49f+5oBe5u9MWcVM7bDgRJs8Q4fxQZSwkkBWpdQ9bQuoA2JAsSRC4p3WEz0DXn0duCA gF000M3lO5fPVVbc2NCZpLZAF0E1GWcc8Pa3ZBmSl4LYMVs700U8QA+Qq4fc1N+pUT2o K9UY6FZLUaMjjJrFIIrVhdv77uwo7dSM1kbev1DepHBvBuoRCnWFgTNPr7EkAS5vZ0Hb FxUg== X-Gm-Message-State: AOJu0Yx6i+2yuyfa/wk7qRyTNrXMwPNOVjvg4w4JcpPtIRw4Yk4NZiEP NGtKz0QqUHXP1vnDxNq8DczPCUYqfZ6wduh0Eg== X-Google-Smtp-Source: AGHT+IG89VBNktN7XA1gkTE5xVbgGz8iasHHKTacDRwZZyNk+t4M2tS4x4zckgIQ/EwT9AkYrTdbks6AEBAQCcWudg== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:903:22c2:b0:1b9:e338:a8b7 with SMTP id y2-20020a17090322c200b001b9e338a8b7mr41785plg.5.1691425343669; Mon, 07 Aug 2023 09:22:23 -0700 (PDT) Date: Mon, 7 Aug 2023 09:22:03 -0700 In-Reply-To: <20230807162210.2528230-1-jingzhangos@google.com> Mime-Version: 1.0 References: <20230807162210.2528230-1-jingzhangos@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230807162210.2528230-6-jingzhangos@google.com> Subject: [PATCH v8 05/11] 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-20230807_092224_851699_7554165F X-CRM114-Status: GOOD ( 11.65 ) 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 afade7186675..5f6c2be12e44 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),