From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19ABE250FA for ; Tue, 9 Jan 2024 07:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="jwUqrDO8" Date: Tue, 9 Jan 2024 16:50:05 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704786616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jC0LcHQAj5sU6xwMTRYWTxbuyexf66+yJ6ABxO0uBs8=; b=jwUqrDO82RRuyPdvS0rbiSFrAaCsnr36tatZfwTSAjpYXF/JsXX4ArfR4ppv7ySIAWpAWJ FVLMSBY8knAInm+HUW82uHpkXvVGvy6W3kgyNYyeKGazDmf+7NKAuNLfaYPmxbfgwEKX5M McDblqfMjuevQgCN5Hz1rstUOV5CBuk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Itaru Kitayama To: Oliver Upton Cc: Zenghui Yu , Eric Auger , kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, Mark Brown , Jing Zhang , Suzuki K Poulose , James Morse , Marc Zyngier , Paolo Bonzini , Adrian Hunter , Ian Rogers , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH v3 5/5] KVM: arm64: selftests: Test for setting ID register from usersapce Message-ID: References: <20231011195740.3349631-1-oliver.upton@linux.dev> <20231011195740.3349631-6-oliver.upton@linux.dev> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Mon, Jan 08, 2024 at 10:40:11PM +0000, Oliver Upton wrote: > Hi Zenghui, > > On Fri, Jan 05, 2024 at 05:07:08PM +0800, Zenghui Yu wrote: > > On 2023/10/19 16:38, Eric Auger wrote: > > > > > > +static const struct reg_ftr_bits ftr_id_aa64dfr0_el1[] = { > > > > + S_REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64DFR0_EL1, PMUVer, 0), > > > > > > Strictly speaking this is not always safe to have a lower value. For > > > instance: From Armv8.1, if FEAT_PMUv3 is implemented, the value 0b0001 > > > is not permitted. But I guess this consistency is to be taken into > > > account by the user space. But may be wort a comment. Here and below > > > > > > You may at least clarify what does mean 'safe' > > > > > > > + REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64DFR0_EL1, DebugVer, 0), > > > > I've seen the following failure on Cortex A72 where > > ID_AA64DFR0_EL1.DebugVer is 6. > > Ah, yes, the test is wrong. KVM enforces a minimum value of 0x6 on this > field, yet get_safe_value() returns 0x5 for the field. This is observed with the RevC AEM FVP as well. Thanks, Itaru. > > Jing, do you have time to check this test for similar failures and send > out a fix for Zenghui's observations? > > > # ./aarch64/set_id_regs > > TAP version 13 > > 1..79 > > ok 1 ID_AA64DFR0_EL1_PMUVer > > ==== Test Assertion Failure ==== > > include/kvm_util_base.h:553: !ret > > pid=2288505 tid=2288505 errno=22 - Invalid argument > > 1 0x0000000000402787: vcpu_set_reg at kvm_util_base.h:553 > > (discriminator 6) > > 2 (inlined by) test_reg_set_success at set_id_regs.c:342 > > (discriminator 6) > > 3 (inlined by) test_user_set_reg at set_id_regs.c:413 (discriminator > > 6) > > 4 0x0000000000401943: main at set_id_regs.c:475 > > 5 0x0000ffffbdd5d03b: ?? ??:0 > > 6 0x0000ffffbdd5d113: ?? ??:0 > > 7 0x0000000000401a2f: _start at ??:? > > KVM_SET_ONE_REG failed, rc: -1 errno: 22 (Invalid argument) > > -- > Thanks, > Oliver 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 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 A9AA2C46CD2 for ; Tue, 9 Jan 2024 07:50:58 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Z2KBirbCrJME/7v1PtppcNHG6MAGNsgaPKsPLHk+IcQ=; b=zfbHaTXoVt1SuE V/o0f3i+Xg6eNdwQf9gmKAeyTB/x6O0sWH4exXQVQcshmTOhLRRMI2+/c5xKlG75u8KtgqO7Yp3s/ Y4xe/86H83TmqRTsoT2I+BlLppCs9YxuJP/XKy9Y2xOn+arE0Vr+nJ5TcPDbC17vbJYdxBnb9ehYl qDrJGQYErQ5hZk4rpmN5CBUVDV2s6w7isbOht/soKmmvhT3FlILGggaQhR9QwIPfii/1oaTf8YhUe x7AtB14bHV89XkIoNr3mxwvPNtbeLN0QTBt+ZuwLfDjnCcYTtELYBND18B8G1qURoy0wMEXgo0/T+ 1eUPMLZRktDZmGmXoBJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rN6sY-007D3s-0E; Tue, 09 Jan 2024 07:50:30 +0000 Received: from out-180.mta0.migadu.com ([91.218.175.180]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rN6sU-007D2H-25 for linux-arm-kernel@lists.infradead.org; Tue, 09 Jan 2024 07:50:28 +0000 Date: Tue, 9 Jan 2024 16:50:05 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1704786616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jC0LcHQAj5sU6xwMTRYWTxbuyexf66+yJ6ABxO0uBs8=; b=jwUqrDO82RRuyPdvS0rbiSFrAaCsnr36tatZfwTSAjpYXF/JsXX4ArfR4ppv7ySIAWpAWJ FVLMSBY8knAInm+HUW82uHpkXvVGvy6W3kgyNYyeKGazDmf+7NKAuNLfaYPmxbfgwEKX5M McDblqfMjuevQgCN5Hz1rstUOV5CBuk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Itaru Kitayama To: Oliver Upton Cc: Zenghui Yu , Eric Auger , kvm@vger.kernel.org, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, Mark Brown , Jing Zhang , Suzuki K Poulose , James Morse , Marc Zyngier , Paolo Bonzini , Adrian Hunter , Ian Rogers , Namhyung Kim , Jiri Olsa , Alexander Shishkin , Mark Rutland , Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra Subject: Re: [PATCH v3 5/5] KVM: arm64: selftests: Test for setting ID register from usersapce Message-ID: References: <20231011195740.3349631-1-oliver.upton@linux.dev> <20231011195740.3349631-6-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_235027_122396_9BF821FA X-CRM114-Status: GOOD ( 20.86 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 08, 2024 at 10:40:11PM +0000, Oliver Upton wrote: > Hi Zenghui, > > On Fri, Jan 05, 2024 at 05:07:08PM +0800, Zenghui Yu wrote: > > On 2023/10/19 16:38, Eric Auger wrote: > > > > > > +static const struct reg_ftr_bits ftr_id_aa64dfr0_el1[] = { > > > > + S_REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64DFR0_EL1, PMUVer, 0), > > > > > > Strictly speaking this is not always safe to have a lower value. For > > > instance: From Armv8.1, if FEAT_PMUv3 is implemented, the value 0b0001 > > > is not permitted. But I guess this consistency is to be taken into > > > account by the user space. But may be wort a comment. Here and below > > > > > > You may at least clarify what does mean 'safe' > > > > > > > + REG_FTR_BITS(FTR_LOWER_SAFE, ID_AA64DFR0_EL1, DebugVer, 0), > > > > I've seen the following failure on Cortex A72 where > > ID_AA64DFR0_EL1.DebugVer is 6. > > Ah, yes, the test is wrong. KVM enforces a minimum value of 0x6 on this > field, yet get_safe_value() returns 0x5 for the field. This is observed with the RevC AEM FVP as well. Thanks, Itaru. > > Jing, do you have time to check this test for similar failures and send > out a fix for Zenghui's observations? > > > # ./aarch64/set_id_regs > > TAP version 13 > > 1..79 > > ok 1 ID_AA64DFR0_EL1_PMUVer > > ==== Test Assertion Failure ==== > > include/kvm_util_base.h:553: !ret > > pid=2288505 tid=2288505 errno=22 - Invalid argument > > 1 0x0000000000402787: vcpu_set_reg at kvm_util_base.h:553 > > (discriminator 6) > > 2 (inlined by) test_reg_set_success at set_id_regs.c:342 > > (discriminator 6) > > 3 (inlined by) test_user_set_reg at set_id_regs.c:413 (discriminator > > 6) > > 4 0x0000000000401943: main at set_id_regs.c:475 > > 5 0x0000ffffbdd5d03b: ?? ??:0 > > 6 0x0000ffffbdd5d113: ?? ??:0 > > 7 0x0000000000401a2f: _start at ??:? > > KVM_SET_ONE_REG failed, rc: -1 errno: 22 (Invalid argument) > > -- > Thanks, > Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel