From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 678D4C34047 for ; Wed, 19 Feb 2020 09:46:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3E59C2465D for ; Wed, 19 Feb 2020 09:46:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nHA+fSeC"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jy8hMAFn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E59C2465D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=K30FDe9vAkBOtH1UJe+Q+GMeH3gdSKEBfVH3eGHzbCU=; b=nHA+fSeCJ7PRb5LHjwEan8rak xHosdETZM/IqnuRlIJK560MIq8lS/pdNFbDZ0IlFU+IYRm2dR09APbAaGMZ7o/Y7VnSsTt8Ot6jcv YtGGc5loxZf0LkutewNGMP42smOGi4V1BiZixb6jL8Vvok7yUmb/aqN2yBkirVLSpGP14SQxBwJms ulAaW2urnkm9DW7K2fo5Od9OzQx8cKAwnOP9sQbsaZTamqrZoO9AtFrgvjN4PyhYfXQ6TU1Mk1pCt D0A4+AJgTrG31iwPIB95/PoKfddhn0cLDMyh2KCyhu7pTYFlwKJx9xDrx2tEosGI9+3A6qzy2g/2v CKLVQR+JA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4Lvu-00053c-Lp; Wed, 19 Feb 2020 09:46:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j4Lvq-0004zd-B9 for linux-arm-kernel@lists.infradead.org; Wed, 19 Feb 2020 09:46:15 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 827582465D; Wed, 19 Feb 2020 09:46:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582105573; bh=l2TiWhrUXaBuX2+2Pq1CuvcDwByg8tH8hEVRAgq5hpQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Jy8hMAFnB3XFRvcNLvZhdJXbWEmXZdU7Unqf0eGMIV144a2MOFvhbu9venyIdOvj2 rkgtkUGH02+MrcibimIvj0Kz6a78iEs0Xqp7hHDVaUNJnek0JfdS6VAMHSotnFhp4n zhlGK8eUbxmurWOYi8DySyeD13APjhPpWQ2NSYgc= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j4Lvn-006TMB-TE; Wed, 19 Feb 2020 09:46:11 +0000 MIME-Version: 1.0 Date: Wed, 19 Feb 2020 09:46:11 +0000 From: Marc Zyngier To: James Morse Subject: Re: [PATCH 3/5] kvm: arm64: Limit PMU version to ARMv8.1 In-Reply-To: References: <20200216185324.32596-1-maz@kernel.org> <20200216185324.32596-4-maz@kernel.org> Message-ID: X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.10 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: james.morse@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, peter.maydell@linaro.org, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200219_014614_449933_43CCF1B8 X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , kvm@vger.kernel.org, Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-02-18 17:43, James Morse wrote: > Hi Marc, > > On 16/02/2020 18:53, Marc Zyngier wrote: >> Our PMU code is only implementing the ARMv8.1 features, so let's >> stick to this when reporting the feature set to the guest. > >> diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c >> index 682fedd7700f..06b2d0dc6c73 100644 >> --- a/arch/arm64/kvm/sys_regs.c >> +++ b/arch/arm64/kvm/sys_regs.c >> @@ -1093,6 +1093,11 @@ static u64 read_id_reg(const struct kvm_vcpu >> *vcpu, >> FEATURE(ID_AA64ISAR1_GPA) | >> FEATURE(ID_AA64ISAR1_GPI)); >> break; >> + case SYS_ID_AA64DFR0_EL1: >> + /* Limit PMU to ARMv8.1 */ > > Not just limit, but upgrade too! (force?) > This looks safe because ARMV8_PMU_EVTYPE_EVENT always includes the > extra bits this added, and the register is always trapped. That's definitely not what I intended! Let me fix that one. > The PMU version is also readable via ID_DFR0_EL1.PerfMon, should that > be sanitised to be the same? (I don't think we've hidden an aarch64 > feature that also existed in aarch32 before). Indeed, yet another oversight. I'll fix that too. > Regardless: > Reviewed-by: James Morse You're way too kind! ;-) M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel