From patchwork Mon Aug 21 21:22:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13359832 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 B1131EE49A0 for ; Mon, 21 Aug 2023 21:23:50 +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=TXZjJ13f3wvq9WyoT/hEUYgc2gB9qEtYurG2YUhkxuU=; b=ycB6/9qkxt+vSm59x+Syw3xGvh ZxOr/0UZq2Qt358BkwHrWNiOyd1KKISik4xbatQJKFYU/u8dDmL87LBPt5muY7iGZK6pEGxoHRQvU boCCoaYgJ3IFXPc+rgFhLqlzfhPPZ0+urysVtZXuRGr+NDno8H1AGzZIXoIg+wXKlk5lmrrhQNXqS n6sAzaxyWhMPDEh5DKOrHHhgQfXF89VPpYG11WdWWt7Y/1eMFz0aIgvcTUNNnki1Sv33/kHEBUfov YhC4jferUSGIHXIyCS/BoEkvGMJeFquLMjIDSB9cUkCBwPb/IqFV+I8LkCMTo/7gCB0thdZYc6UYa V1jemLgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYCMq-00EiQ9-2F; Mon, 21 Aug 2023 21:23:20 +0000 Received: from mail-pj1-x1049.google.com ([2607:f8b0:4864:20::1049]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYCMa-00EiHu-1i for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2023 21:23:05 +0000 Received: by mail-pj1-x1049.google.com with SMTP id 98e67ed59e1d1-26f49625bffso1805928a91.1 for ; Mon, 21 Aug 2023 14:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692652980; x=1693257780; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=hGowuOdlgc/g3u8U9EhceRoch6MKJG6leI2ZQ+fj9oY=; b=03bvAlvTUehe1uNIygFjSACoQV5XNjS+eQzJfURH/Y0uyMFVuiLMbXKLjkwJv+5c2y wO6ojiA3clpunb2gqxUvlqlsCSexjofZ/Eyspj/EnKYXhP5Ma4lHumDpsDRNxnnpQlkI lt7Tg4JU7TYDwCJPTiUatOnoVNZqNRnGgFVSJm4dWtkyQOpTqHxQa/FFhmoqQo85Y4Xq udROwtOJlZWZ3tfB5vAYhbPCRzypEQRSHtiBB6SNL4T2gt0cobUvf3KCC5UdtX6AM1Nm ghYVmJ3bglWMB0njGTHNPz6RQO2iWWyfQIVCbU49tN/fmZPPDffPoOwUbtWR/MZQ6blm 549A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692652980; x=1693257780; 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=hGowuOdlgc/g3u8U9EhceRoch6MKJG6leI2ZQ+fj9oY=; b=f71yc2qrNc3RHyKXmkjzwNj7AqsmD1A7lT8TZ90RObBnzYa8Wdz6umLknD5/x0afsp 7l10dEBIPTuVxhB1Q9o96I3eWjYXwVdfhbRQMpvng2U9Nd7SmpM5oyzsqrgNGyi6cnLa zU3qeQoQ03xwEfYrsjwCNUQQpKwUyxTciNXvULsDBfIGV8/THJCrlHMnz8PjafsGPW7H eeBDCkCvxEcg7ESd8WEoavDoefqRrnz0bVaDR3AN9LnSni1WEl/Gh08htZxv2pYrqH+C TlnOJaMWZEMmMkZZjZtnvObrOS3kZWAbzVQwP5AMOy7r6uLNQ7u22ouuWvsXY7SQMp05 MhcQ== X-Gm-Message-State: AOJu0YzPt9xW3cmdXYBUgAXuqCweCA6b47GntCJSp7ol+/sgVu4p8Fat haJfB5eolpbDtkwF/cx1Va76zcFhNo+dIyaDMA== X-Google-Smtp-Source: AGHT+IHWAYCWcuqlky3Jlh/tA/tztTBvpOQ6Ky5fN+7+GItW2NvM/yxfZvHjSk78Kd9MgfkgDAvMSeqcrtbGplRwbQ== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:90a:c690:b0:268:1dd8:33f0 with SMTP id n16-20020a17090ac69000b002681dd833f0mr1930362pjt.1.1692652980138; Mon, 21 Aug 2023 14:23:00 -0700 (PDT) Date: Mon, 21 Aug 2023 14:22:39 -0700 In-Reply-To: <20230821212243.491660-1-jingzhangos@google.com> Mime-Version: 1.0 References: <20230821212243.491660-1-jingzhangos@google.com> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog Message-ID: <20230821212243.491660-8-jingzhangos@google.com> Subject: [PATCH v9 07/11] KVM: arm64: Enable writable for ID_AA64PFR0_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 , Shaoqin Huang , Jing Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230821_142304_567201_4B7A8CF5 X-CRM114-Status: GOOD ( 11.67 ) 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_AA64PFR0_EL1 are writable from userspace with this change except AMU field which isn't exposed by KVM. Signed-off-by: Jing Zhang --- arch/arm64/kvm/sys_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index cee5f879df19..bf716f646872 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -2043,7 +2043,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { .get_user = get_id_reg, .set_user = set_id_reg, .reset = read_sanitised_id_aa64pfr0_el1, - .val = ID_AA64PFR0_EL1_CSV2_MASK | ID_AA64PFR0_EL1_CSV3_MASK, }, + .val = ~ID_AA64PFR0_EL1_AMU_MASK, }, ID_SANITISED(ID_AA64PFR1_EL1), ID_UNALLOCATED(4,2), ID_UNALLOCATED(4,3),