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 A96F5C52D6D for ; Tue, 6 Aug 2024 08:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ha85jh06ju2ec3M6eRrZItHlhVDmC4EM/7NItagZQ6A=; b=3Me8TrhJ6oDDdbizQip+nnS0qA HxQJoCvJ6skYn6QaPW5twPImhP3o02oVCTRKbqN/znx9mDjGas1/6ULzC+fBCZWjT28BINwgESsGS FmvD5rw4hYDiEbYZtJxun5tmXI1e2MDj/S5OCU35ZC0Q9o+5kkaLjrPcrfu4iLFAochJIhFB12BZ7 ZpjQ5U86gv0kEFztVCYLCnbvda/fOKHs5t6u00QwQBx0hvQdjOdlNhDKikr+qdj0Ttgnl3Weo9lfh 5eMoVk99i1Ba3UfKHDVk4wTCbAz//Shnu+tJw0AfjwSXppy0ZCkIZOPvzOgs0X/L+yP5TI0drdGBZ fVjZJDdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbFAz-00000000sCL-0rJ5; Tue, 06 Aug 2024 08:04:13 +0000 Received: from out-174.mta1.migadu.com ([95.215.58.174]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbFAE-00000000s0f-39MK for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 08:03:28 +0000 Date: Tue, 6 Aug 2024 10:03:20 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1722931404; 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=Ha85jh06ju2ec3M6eRrZItHlhVDmC4EM/7NItagZQ6A=; b=WRrQzINO6/pcFc2X+Qn0D1xCm1LCIlAS5BXaDHH2iAtz0z/gvuY+2/qdve+Fbxt/fwK0az k1cQHSnhbB6EU/BXNUoulEpY9YvGeSD4GUzwN27LHJ5AqFFKgjU/cRDeWEOS8Eqg9iLBLR 9mYk9u14+hQJfRS4q7iO9UeeQNj1XCY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Andrew Jones To: Mark Brown Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Paolo Bonzini , Shuah Khan , Catalin Marinas , Joey Gouly , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] KVM: selftests: arm64: Use generated defines for named system registers Message-ID: <20240806-7d137744fa04e05689efac71@orel> References: <20240802-kvm-arm64-get-reg-list-v1-0-3a5bf8f80765@kernel.org> <20240802-kvm-arm64-get-reg-list-v1-2-3a5bf8f80765@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240802-kvm-arm64-get-reg-list-v1-2-3a5bf8f80765@kernel.org> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240806_010327_256334_C1F528F9 X-CRM114-Status: GOOD ( 15.61 ) 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 On Fri, Aug 02, 2024 at 10:57:54PM GMT, Mark Brown wrote: > Currently the get-reg-list test uses directly specified numeric values to > define system registers to validate. Since we already have a macro which > allows us to use the generated system register definitions from the main > kernel easily let's update all the registers where we have specified the > name in a comment to just use that macro. This reduces the number of > places where we need to validate the name to number mapping. > > This conversion was done with the sed command: > > sed -i -E 's-ARM64_SYS_REG.*/\* (.*) \*/-KVM_ARM64_SYS_REG(SYS_\1),-' tools/testing/selftests/kvm/aarch64/get-reg-list.c > > We still have a number of numerically specified registers, some of these > are reserved registers without defined names (eg, unallocated ID registers) > and others don't have kernel macro definitions yet. FWIW, the "ARM64_SYS_REG(...encoding...), /* NAME */" format was intentional. The idea was that when get-reg-list outputs new or missing registers it discovers, or the user lists registers with --list, the best it can do is output "ARM64_SYS_REG(...encoding...)". Putting that format directly into the test enabled copy+paste of the list output into a test case. However, the lack of names did lead to scripting the generation of the name comments, which means it wasn't a direct copy+paste anyway. The other benefit of the format was being able to directly grep the test for the 'missing' registers. Anyway, maybe always going through asm/sysreg.h with greps of '...encoding...' is the better approach. Thanks, drew