From patchwork Mon Aug 7 16:22:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13344524 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 1DD42C001DB for ; Mon, 7 Aug 2023 16:22:55 +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=jmgmoTLXzUq9TUNDVRc6SZBh3uszZiwXzlchYayaVng=; b=pfiGF650RshCxIwkaFkEK1bh29 LV/4oHOGH7RHBv/T6qdG1C2zGvl2cRs3EYqW7mDA/Ro6rV1UTxVUNlpCDzeqwcl+gRppnGcQGsORn FojeflkxP7ipXwYjCm8uKRl9MgJwbmQT7La48poV9hw9OLXLEZiGhGDZA+FnG67chYn+lxbpbqs3i EMkdrngzCNVvVACqwbfkWuZuAASivw5EppQQUqOHpV7trClruK8IJlRB7xhJWTPOe6K9hcOhbB9NB w4j5L4gMK1cstbodnvDWs31mUGPI80RFkT5b2r3c8Lp/tnZV1whnQU4iEfoVmmGuIaGqdD9kHWPqQ u5RI4W2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qT305-000AUo-29; Mon, 07 Aug 2023 16:22:33 +0000 Received: from mail-pg1-x54a.google.com ([2607:f8b0:4864:20::54a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qT2zz-000APo-00 for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 16:22:28 +0000 Received: by mail-pg1-x54a.google.com with SMTP id 41be03b00d2f7-5646868b9e7so2640753a12.3 for ; Mon, 07 Aug 2023 09:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691425345; x=1692030145; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=zvko96XhFtpYYidvZOJTCgoG3opZmvwlh1PYr9fTkkI=; b=jaMmpyvd6ihZ06+wE8AlrhnE1qPFQoCnq+e0opFsICAtC3WVl+O4TUJ+k01tMVQm5z L8YyZk2p1e1UUxT5Ir40iF256pReWqm38iiNRDL5vLoukvqOiR9GrVum8fK4WfahG8f5 QWZ6HRbnpFx6UQUaxWMTKdcfV1qrLBQf10u9merYlRbtmrgforr4lnVp0/W7w7sCnAbt 9jax0nr7qlx8M+YJpbXqQsWa6+eqJ4jwyCgLG3q5+Cg5CAohUn/bYnUgi+/IR3LIcsk8 KTUBLJcc3Rslkj61Lrur7GagaijK8lASUHDDnw5QCAOYnPcD5hX1Jux2aeuGmk83vat+ xy8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691425345; x=1692030145; 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=zvko96XhFtpYYidvZOJTCgoG3opZmvwlh1PYr9fTkkI=; b=NMLnGNSDkrIQdODUbvDJb+K6MaC7laXXWLcC1108zRsP7phXllcvE41uFZPOcMvAf0 gK2vFRMICKqYhMi8tIT+PiUyQ/CoVJEaaWdRiSexzYwaWDXGdfAjByGwHGRsIXd7PNtf cA3vpzEswWYKo0Uo6jRuX7W1Y2Q19xE80Mcf7A9DA9kLvYFX3loG6QuogZIT/AaVv5LU Idk19cIPRXaaChJyzL4LDgluuoO3hJUwGtd9ZBgjUyWwrOuHPedLglpZpvZcE/pIW5do TM4tADcLVwFjnc996J993KNGNOxneTiF9rsohUy8fwgHU/Hw8pdNJeixQ+KWu8wr2NIZ xMvQ== X-Gm-Message-State: AOJu0YxiPyybLjyIxkGiynj85r3k+hS+zSMGbmpSDgwtx1h1Rxs3Q40W HrX67ZEi60ifL8NNJ1dkBY7IXj9LweTCWSXLlA== X-Google-Smtp-Source: AGHT+IF0luikMERZ5n3CMp2yFSmVcfgwmELbpWdGVUJ7uHnLdJhIRB6jZe3Nzpwz9XCDsQ4vNxF9J7MobIwiMfhDew== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a63:790e:0:b0:55b:c42d:e454 with SMTP id u14-20020a63790e000000b0055bc42de454mr44303pgc.11.1691425345621; Mon, 07 Aug 2023 09:22:25 -0700 (PDT) Date: Mon, 7 Aug 2023 09:22:04 -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-7-jingzhangos@google.com> Subject: [PATCH v8 06/11] KVM: arm64: Bump up the default KVM sanitised debug version to v8p8 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_092227_044468_A61CD0A6 X-CRM114-Status: GOOD ( 11.90 ) 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 From: Oliver Upton Since ID_AA64DFR0_EL1 and ID_DFR0_EL1 are now writable from userspace, it is safe to bump up the default KVM sanitised debug version to v8p8. Signed-off-by: Oliver Upton Signed-off-by: Jing Zhang --- arch/arm64/kvm/sys_regs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 5f6c2be12e44..879004fd37e5 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1489,8 +1489,7 @@ static u64 read_sanitised_id_aa64dfr0_el1(struct kvm_vcpu *vcpu, { u64 val = read_sanitised_ftr_reg(SYS_ID_AA64DFR0_EL1); - /* Limit debug to ARMv8.0 */ - val = ID_REG_LIMIT_FIELD_ENUM(val, ID_AA64DFR0_EL1, DebugVer, IMP); + val = ID_REG_LIMIT_FIELD_ENUM(val, ID_AA64DFR0_EL1, DebugVer, V8P8); /* * Only initialize the PMU version if the vCPU was configured with one. @@ -1550,6 +1549,8 @@ static u64 read_sanitised_id_dfr0_el1(struct kvm_vcpu *vcpu, if (kvm_vcpu_has_pmu(vcpu)) val |= SYS_FIELD_PREP(ID_DFR0_EL1, PerfMon, perfmon); + val = ID_REG_LIMIT_FIELD_ENUM(val, ID_DFR0_EL1, CopDbg, Debugv8p8); + return val; }