From patchwork Mon Aug 21 21:22:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13359830 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 E91A8EE49A5 for ; Mon, 21 Aug 2023 21:23:45 +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=LKCbGkpdGiEL1R8+5IashZ/q4fBHxrLZG9wMg7lmysg=; b=t82qFmMdyCt1j9uQMGJI3IEB1e KOqHUxoRFXg+pSz8oDm2gqSUDTEu9LEzxofmDr0JllZK1KOZPMm/S0lUTXI6VoibZ6gnlg9c3jwRR XJ30dCCN7TrvoBVy4e441F+KuMOh4eL94tpivvbJuuOTJvBQIOCWJkPUia/knYDNwgNTAEdGiKrnY PrA1i8P5WdPGCpquFMI7T0r4iGYnn8kzyEvTOxFia8cI1qzAVrvaBw4Xi3FnMtLkeGt9ZRKFuB4Rj 4G+YkC67cgnbq7g1TN09UqEgAYnVJMRCcnacdyTcw1j0qyFjKvVHDE9j0phkFfZVMGcheXYSqEcsd 4TSI2jcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYCMq-00EiPl-08; Mon, 21 Aug 2023 21:23:20 +0000 Received: from mail-pl1-x64a.google.com ([2607:f8b0:4864:20::64a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYCMX-00EiG8-2G for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2023 21:23:02 +0000 Received: by mail-pl1-x64a.google.com with SMTP id d9443c01a7336-1bde9b69158so42216175ad.2 for ; Mon, 21 Aug 2023 14:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692652978; x=1693257778; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=0Gl7xTSJXiv4/axuMn6kp2mV+4Fk1KiUUIgvbh7eheo=; b=K3Pwq0bXvrKKoxq17uKY6PPEy//Kahe1n6Kr2lkLQP0YejL8SYoTG+LL2ToHaaOzD3 5/iaDGVN1sWGM48ozuRhey0SXURdcbdrZuB9mvXdtHAawWbjw56KAFNIDDoE6TulFdHt Kvy6nakQh8f4YV3k2MqPK3nDtSnbsLnNr1cdkrDZbMgUc/L/s+fVl/NfAkZfmQI1N1G4 kBLL8To++3JN811vCM7jRuR3/SJdoPJ2vfi/pDICuViL8SGSkDiT4UBX7QZj755h6Zzg Cx8bZQKE7clKxDIVCEjjVLIwxqJij61DSDL/qMQAiobSjl08atjsyw1R5SypNcZBFvR6 yq3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692652978; x=1693257778; 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=0Gl7xTSJXiv4/axuMn6kp2mV+4Fk1KiUUIgvbh7eheo=; b=RzZx7E5sAW7/Bezh9t1k9zcjf/OYZkuopAugRVRXJNEEzP8S+6Baik2HC/lHVFdsRl vmykn8MIb1I1Bn0bNaxzPDJ6SKKXBdWXKDRKntaedv5ojnHdfdT+EKTLdYfFhUSr70hr uINtzslPxZSQsaNLVEuQ2fXoZP+hb8eNn0vJ+B3k/YEUGn1f1qYpDZMAm80Gt+6UQ/+w E/P5ryncqRm92Ujw+TY3vmQsAQhwSaB72PcZTRqez+AJRjnhlbj0SNJ1hRByGFHdDiMI D5aNScawxm49aen9PTqeiH2Z39hUcME+3rf4saVOXvI1ZJXZzLBkhYCKG914bK7JftrI AVEw== X-Gm-Message-State: AOJu0YwYh5lPNL18gKsDyQCeLBl2Q92IQORMpTbXITq82Gl2FWGu76/z Xk+4kWh3oWlT3tLXJ8YAc9QbB9hQCLV7tI+uFw== X-Google-Smtp-Source: AGHT+IF9FbTQRPdiHLCbnz33sY6UbDj9S6Y26IR0MYTkI5YWtozk6eb4WUf0X+aSfF3eceyT5iizkkBpkhREQrbrwA== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:a17:903:41d0:b0:1bb:c7c6:3462 with SMTP id u16-20020a17090341d000b001bbc7c63462mr3891383ple.8.1692652978227; Mon, 21 Aug 2023 14:22:58 -0700 (PDT) Date: Mon, 21 Aug 2023 14:22:38 -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-7-jingzhangos@google.com> Subject: [PATCH v9 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 , Shaoqin Huang , Jing Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230821_142301_736044_2114CC5F X-CRM114-Status: GOOD ( 11.55 ) 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 20fc38bad4e8..cee5f879df19 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; }