From patchwork Tue Aug 1 15:20:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13336931 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 051CEC001DF for ; Tue, 1 Aug 2023 15:20:59 +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=zwoNCEgywFwVRv1/Nf0c0XfNYndmSRe9qI++UX8Rpg8=; b=JOEpGZhVOZeYUhp58q/D7zPpiO MLOqTRUab216uQ9mAOY82eOmca4V1uSJEXL/AfyoF8eof+5zob7QhX32+xUf2LWg3c/LIeuiL8NIc zHo5kjnc5pQpTPdBdqRpoyq21il0uz8QekwcI4rNiWzeaNjqlFDRSaezqScaz2sLJtsh060BZa6r9 svs5slx+FyWuTOT5/UH54F35o9cu7wpDbFttygRJb8J4bcK3OYML2Jcmwgs0M9svgDlW0n33P7DWM k96/U8c9xo9xPkms5CiueqCrFYZPMNGoOUpqN5QcOnhKZeJ3/AJBjHSqNADVtsYJJ4psw3/x+7HWU i2cPgLTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQrAh-002hdl-0l; Tue, 01 Aug 2023 15:20:27 +0000 Received: from mail-pf1-x449.google.com ([2607:f8b0:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQrAe-002hbi-1Z for linux-arm-kernel@lists.infradead.org; Tue, 01 Aug 2023 15:20:25 +0000 Received: by mail-pf1-x449.google.com with SMTP id d2e1a72fcca58-68732996d32so2401614b3a.3 for ; Tue, 01 Aug 2023 08:20:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690903223; x=1691508023; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=6FyTW1VsL4amGRSIg6wJqneP5gVog8VOaALdC61uAQM=; b=C0ZfPq3efOpnuDcjVLErVLMbvOkEBdQvbm4wQodeYlarW1FXMlMZid16hWYooPNHQg FySrGsafcV+pPcCeKbUiDJXzjc+1S4iffzB2PNPF7P3pEZ3/wA5J+oaXkexLLPEDBUTL 4EbZMcSnQSuQmvmJ6DxOhJX+twsw+aZlzTQC9E+KUFYuYNTgTVQW5bHIrFlpSZD2kjZ5 av1L2nNW80E8q9U4tCNyRXzWHt6OcoUQIt2DkunjdDA1YmF5bZUXBsYOnM4bsG7d7J2p OG0u8sL+1JVv9F0pgL21R5NOmzp+v1VmtztLqjLVQiyX4m33EH5jpctaIwsxb62NEABX /P6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690903223; x=1691508023; 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=6FyTW1VsL4amGRSIg6wJqneP5gVog8VOaALdC61uAQM=; b=Mu9NOfmKogXBfw/Jnot10s68Esz7aUU3c61E6FTOnzEJd90TuCnFn5M7Zo2r+kGzt7 MsG4B/jPdzp+uJCwRgHyl+MKma/BJfVKdUQVw4Y4rWaQUvmUafCWO6RaP/bpnHs4LzG+ SKm2mS1ru40X/8GbRX9LvtoLntIe0xiTVMYyamhPVrgekOzQZqoMSGBFNbIhQPhzZdmw d3EBl5wZAb01mAMnX5JEN3QKFip6jW8gCjJ0eNJ0S9e/hC2c+KRPmfND2kBN/+DTxaqk y0Q0tV51Qo7QQC5X5nzcwN6NhCZXjVv0HI56Gav2eJBAzg/iRxSL6lJw1/WgL0z/w4KI D4bA== X-Gm-Message-State: ABy/qLaIlmXW4YP4Cm98i11yrILBdWwJPiSeekz5qi3VQk9dESCsWKK2 yiSnuR8AzPGDo6T0SNHl6Bet2NtdGAvOKgOKSQ== X-Google-Smtp-Source: APBJJlEL3UUpI4AI77yIqdcAOJwFOq1i8j3nPTDlAWpLoDzAvhrkuZEeOT3azEun/jvOMdCuFYFKd2z4TNq9i2f2Qg== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a05:6a00:80a:b0:682:f33:fa97 with SMTP id m10-20020a056a00080a00b006820f33fa97mr109865pfk.6.1690903222997; Tue, 01 Aug 2023 08:20:22 -0700 (PDT) Date: Tue, 1 Aug 2023 08:20:02 -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-7-jingzhangos@google.com> Subject: [PATCH v7 06/10] 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-20230801_082024_524359_2749DDC3 X-CRM114-Status: GOOD ( 12.43 ) 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 2183cd3af472..5a886ccb33fa 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; }