From patchwork Mon Jul 10 19:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13307532 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 84AEDEB64DA for ; Mon, 10 Jul 2023 19:25:12 +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=IX23sUhXGhdJaW7yswsvTsbJrGXCoufM/ohQQG/zGaU=; b=gtNOHfedn9z2iQHiYLcW8f74uB 7SHKv0Kge25hPB/Mt0XHKvUuDTy5EdoJzWFlUrkBK82VBwszDmJvLUfpCAjS5O6DYfXeRdVgaFMqt +Sr+5PS8wuvvc9pEVZ/uUDLKNGE5LAWoOTnfUAflVg+gBbkuXHpuBQWTyHbwa/90bH0cZhjblZ1Gg PG+w7zj7DITDPTM/XI7w2FPDhMPTGbC3JT6tPOhgiwsAbL6axuwNSafOwSlFxNGrhvpay06CBeFSx Ga5VP6O0H+1iVYaKal3Da3A6GFcgwfbygFq+2T5RmUlo+3ooAf55W+nu+1v5CnEVudVIhKgjHPbBV zmRJAX3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qIwUz-00CYJm-39; Mon, 10 Jul 2023 19:24:41 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qIwUw-00CYHj-1y for linux-arm-kernel@lists.infradead.org; Mon, 10 Jul 2023 19:24:39 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-c361777c7f7so9072675276.0 for ; Mon, 10 Jul 2023 12:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689017077; x=1691609077; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=NjXGqinFg6JbUCcCuD1314VDCv679WJcMyQaO6pNuqI=; b=riWsju77MCgLxcyPUA5zvABoTX1/n+uRhqXiNScFzay1HPX99z0tc697bB4UPgxFup v6vjFDK+OpdAh+ZfjD+AN7l24j6yRvX3XtBvROnruXBLFl2kWNA8PHx/58YzuBVEhk5A tzoGrsxzCwHBrSrfUBwlAu5r1zF87t1cTryo+Ov3gX8k5EDIk63Rk7uqhpoTmNfHtVXW iB6XkV+A/4mmcFig5KzmD1Tjd2NkDPiTGmGTlD/9MwaZtYufwCgye+a0Yei9/XK5XQg8 xopGAsDxQTs9dWPaMe8zfQxyD4pigDfKPNFKYllHwZX0MpFq1iOzO70eUexC7njvYRQ6 kegg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689017077; x=1691609077; 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=NjXGqinFg6JbUCcCuD1314VDCv679WJcMyQaO6pNuqI=; b=gSZ8TZUGDBmxObx6NOzVTjtY8EhGkKioHO1gXOXtTfiDA7CQRxdkHJG2gw73pxCGkd C2MbQ8CG6DWP4BcBAHNw+l+ydTf7bkUBd8dGofh78j/1tdUUF3YtOOlXDG+CZIq3n3vK WBuPbkbw79N/1IaBkBTqR7y+0CLT/Q7RNIV2KYqNfDNjTBvieJLAwJOUt20n37NANeK8 qRf90iXSUeueewS7PJcn/AQjpX1p145LD0ec9sq8TEFPGSQvlfb45XSX5F/WFbWjMJwR WuRezO/zhOMZ9dFts5Hm6gpwI4EJST/CgniW8pSk43BKRIRC+2Tdk27Cd19f35jtnIiv Eh5g== X-Gm-Message-State: ABy/qLYRqJbuv2YXUYtp57ex+KkPz1ZOOAJvs67797m6oV/2Ty+7UHaa YQp+X/7ff6T+ccwMQ3WJXX41L1zXJHagSsbY7g== X-Google-Smtp-Source: APBJJlFU/3p3XZytGnnz4g0xxHNMZggWlz1mMLZ78y9fLOkMhIqS/5mIom3amLly/wcRCruQ7qwxSVnY/RznFpLozw== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a25:ab90:0:b0:bc4:a660:528f with SMTP id v16-20020a25ab90000000b00bc4a660528fmr143365ybi.5.1689017077178; Mon, 10 Jul 2023 12:24:37 -0700 (PDT) Date: Mon, 10 Jul 2023 19:24:25 +0000 In-Reply-To: <20230710192430.1992246-1-jingzhangos@google.com> Mime-Version: 1.0 References: <20230710192430.1992246-1-jingzhangos@google.com> X-Mailer: git-send-email 2.41.0.255.g8b1d071c50-goog Message-ID: <20230710192430.1992246-3-jingzhangos@google.com> Subject: [PATCH v5 2/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-20230710_122438_655294_9A7972E9 X-CRM114-Status: GOOD ( 11.01 ) 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 c1a5ec1a016e..0160ef9cfe18 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1980,7 +1980,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), @@ -2029,7 +2029,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),