Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2785057rwd; Mon, 29 May 2023 00:19:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/9RUARkItUcRL3CXl6jhbjGKGJczFyzBDGlDqb0VkNa3DxDE5Ff29PAe060EpXoW/KFDs X-Received: by 2002:a17:90a:ca84:b0:253:3f25:3d99 with SMTP id y4-20020a17090aca8400b002533f253d99mr10868819pjt.45.1685344792825; Mon, 29 May 2023 00:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685344792; cv=none; d=google.com; s=arc-20160816; b=KaKhxrm7gMjfawpnwMFPGpB3/hG/osvnPYOu0E0NE+Dx28U1gmaRSxMozm9x7LN8Yc OmVDnonxhmhzfrHu51RDZtX9PlLCev24hVZE6OmA2wntUn+BSTBNIhzerXAO4tIitO5r 4JCoXT/ZdTdJjLKeqd4uwIpZIX8L2Seq7P2RwNSmXxNCrC16HcceFnbvLIljXBPXNnOg zgqqdx/B9gwGwZvKosMweu1YCktPWt6Cgi3LqQEVo6noi6ep6/f6+bQw2hAjOw0EZKlv IOOGq8p0wtM3sW/2blOo5znZETobe3ftq7bWOGSjaZIvHlzgMxDhB7ynuEp4eSKVO9iq QVTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=J9yQZI29FBb5uk90C946uFQGVpaFZWwP+axkfkJPRmA=; b=vME16mSCJG7iGsmiquBzDAmdcoOhFeX2ukJVUVT772T8vRVEZj7211O7fX/PJsyOTs J3wX58WB2b2qTxBxMizXwL7/ZO/MU3CE+E3tt5BYDnbcjrafUwMgwSKZwl8MtqECeRCH C47G0Xog0L7285X0oHci7q7yVDm6SDoxktBjZuHL0qgoCPCxWUrjwYwDURlLz0GDb8ky Skt2yl+1gwGZ//1ChKpQ+8v1d5P3qGaHOT/jIpRnHJzDSY3a2oiePpWEg0/1wNby29jU o3h64zmTjyDxgf0pEHVUyO6PbGwSJ5FwZzD+EoEffviHhI6D8yB2jgl1fygbXVsp2t5V 9w8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OGzmkwym; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a17090aad9400b00252e51a9fbasi3123641pjq.122.2023.05.29.00.19.39; Mon, 29 May 2023 00:19:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OGzmkwym; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbjE2HI6 (ORCPT + 99 others); Mon, 29 May 2023 03:08:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229613AbjE2HIz (ORCPT ); Mon, 29 May 2023 03:08:55 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72C5DA6 for ; Mon, 29 May 2023 00:08:54 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-3f6e68cc738so19035125e9.1 for ; Mon, 29 May 2023 00:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1685344133; x=1687936133; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=J9yQZI29FBb5uk90C946uFQGVpaFZWwP+axkfkJPRmA=; b=OGzmkwym+ds5lNbK7+lHCLxUguUfy0QTJ/UI2yLcw74+JBxqixt+zmx3lNyihLZ/qW Rrl7u4zd2ZxT7qCL27Mau576RJoJ1CiSa0kWXOUmjHxKhQMPTfGNSIi0byquj1Nki8n7 cCB+xb/M+P51G/dtVskzHEkGHBRc60UcS6xABlKWzdN9VqozEbcdLXxh/0kiL9B4u4h8 S557VMaZShp76FvJQOnFzyQD/SYCQVb+/87pTopt7EtnK3a3prWQRrU/9gyxDitIX4ea 07jX2bKWoC2ai9FXbUtUjmVHAPupvol8Q7kZEcQ8Ii51pvvXXPZUzSPTvb6/hRgb3eYL SuDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685344133; x=1687936133; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J9yQZI29FBb5uk90C946uFQGVpaFZWwP+axkfkJPRmA=; b=Sx2iELosI2XafZJNMfCriFidV4drDWp4Nu4q1ipmnGHoRXhRZ1R3rLq2zTWrKeskOi mHLKK4bo5ezMinMWcskIxzHNk6d8XrFZZ9Dq62yiyN/rkYvHn/sC/h2jHOgjTznOJsmj wx1vdCgEiZn4dh1csD0OPCgcJzZcxLb/+w6FKF2lXTS9ReOlT+zx7qju8VMWm1d6hzXA bf3GU8qPg2ma2H7/Ngw6n6VmneasYsEFgI4aUTGHbnStQ7nJjNAMAi3o8PgmyvYIe4Q3 ++IwGl3vgPxUZdOv/dHLRfRgk53ZgTjMeqiiksRA1a4yxdeR8y2rizykSGS/eb/Yus4H 5djQ== X-Gm-Message-State: AC+VfDzPgeIWrVbSx+yVsBnZPKIe43VM1+HbE1AZwbIK7nIAcyisqacc qvjXuvx//crQMQT1hC++BQ36CQ== X-Received: by 2002:a1c:f616:0:b0:3f6:82a:5d1b with SMTP id w22-20020a1cf616000000b003f6082a5d1bmr9377055wmc.34.1685344132851; Mon, 29 May 2023 00:08:52 -0700 (PDT) Received: from localhost (2001-1ae9-1c2-4c00-20f-c6b4-1e57-7965.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:20f:c6b4:1e57:7965]) by smtp.gmail.com with ESMTPSA id m17-20020a056000009100b0030ae973c2e7sm3092863wrx.83.2023.05.29.00.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 May 2023 00:08:52 -0700 (PDT) Date: Mon, 29 May 2023 09:08:51 +0200 From: Andrew Jones To: Haibo Xu Cc: Haibo Xu , maz@kernel.org, oliver.upton@linux.dev, seanjc@google.com, Paolo Bonzini , Jonathan Corbet , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , James Morse , Suzuki K Poulose , Zenghui Yu , David Matlack , Ben Gardon , Vipin Sharma , Colton Lewis , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kselftest@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v2 11/11] KVM: riscv: selftests: Add get-reg-list test Message-ID: <20230529-7b3e41e6aca55f9e90dd6cd3@orel> References: <20230525-2bab5376987792eab73507ac@orel> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 27, 2023 at 12:39:57PM +0800, Haibo Xu wrote: > On Fri, May 26, 2023 at 1:18 AM Andrew Jones wrote: > > > > On Thu, May 25, 2023 at 03:38:35PM +0800, Haibo Xu wrote: ... > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.a6), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.a7), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s2), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s3), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s4), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s5), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s6), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s7), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s8), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s9), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s10), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.s11), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.t3), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.t4), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.t5), > > > + KVM_REG_RISCV | KVM_REG_SIZE_U64 | KVM_REG_RISCV_CORE | KVM_REG_RISCV_CORE_REG(regs.t6), > > > > ...all the above would just be indices rather than named registers. I > > guess that's better for these registers. > > > > You mean to show it as KVM_REG_RISCV_CORE_REG(regs.regs[0]) ... > KVM_REG_RISCV_CORE_REG(regs.regs[31])? > I'm OK with these registers using their names in this list, it does look better. However the original idea for these lists was that they would be generated from print_reg(). In this case, print_reg() is generating them with their number instead of name. Either print_reg() could learn how to generate their names by handling the offset ranges of each register type, e.g. switch (reg_off) { case 10 ... 17: strdup_printf("... KVM_REG_RISCV_CORE_REG(regs.a%d),", reg_off - 10); or we can use the numbers here in this list, or we can leave it as you have it (i.e. done manually). Thanks, drew