Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8957612rwd; Wed, 21 Jun 2023 00:47:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4LBmWJlzgLwaMzhCp08NK++LoxfyUIZsrcksT9ltDEBbCG+jO+3hZaUhKTpx4x/O4vjQC0 X-Received: by 2002:a05:622a:1ca:b0:3f9:adf9:a708 with SMTP id t10-20020a05622a01ca00b003f9adf9a708mr18802049qtw.44.1687333626992; Wed, 21 Jun 2023 00:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687333626; cv=none; d=google.com; s=arc-20160816; b=jXpzMB5irmjGnAolyE0BYOrbdI07Aa4WlClKGkenYaGFVLhWeBAz39TIvlC16ZLvQ0 91fODYjdGMjkuN+QxrQgp0y0vytIYORnpErVjKzfL7AhhRoNYdL+CPE6sRZy8OWdFLO7 aQn2v+0CaYUCu11bxERuHE2cmAXfHq5bmxkeKQPguCwVhIU6cF6keNC/Dm3dxmyQ2tVs AeT4ePiYfadFoE0caYLT/u27Gj5+NH+hRLMU4I6Y89A1gwUdW5Rd1KQL9UDtLYo1xRSU +6IZAhA0WNvK7mEl7J31/JdTSrR3E41eGiEz92jDBJL2sC4nEynQEk8YGBGtJDUQJzo9 /dXw== 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=ZmyDfnK9tJh8eswYvjmWTei7tQJVIfXBxXoVL4SG7R8=; b=IjaqEPUG2Kv4BjA/M2VmMREUoa5U2VzGPRUTRtfvEZ8agOlxVUy2/4IKcAUY63b24R 6sNrUtjAu/i4UbFICXqYDBPydx1fUvNHDWMtPjrsfl55gq3OBFkndpOokFwI/iVMTb7z UBwSHdM0Rea/YHCZfmJvWIJOhMA75pAHb7jBAxf/0/BlJxymNzOz8IJLeszNwWa3L0CU F3wQI7uuaVfjhH9Ikb2hh1KeVTXB43uVYHhNWgqyQZyq3QGrtzdDPnKJy+iebze6+JhR oaiGiRLf6zqv3NaV9Eo9leBiGQhmgctlZ8Zlr8bIZqJLSamV6E1OCWXGPNUXzLcaq2jm kNqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=AErp9BkT; 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 u11-20020a6540cb000000b0053f2551834esi3338542pgp.735.2023.06.21.00.46.48; Wed, 21 Jun 2023 00:47:06 -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=AErp9BkT; 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 S229944AbjFUHaL (ORCPT + 99 others); Wed, 21 Jun 2023 03:30:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbjFUHaI (ORCPT ); Wed, 21 Jun 2023 03:30:08 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41033170C for ; Wed, 21 Jun 2023 00:30:06 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-98cd280cf94so30409966b.1 for ; Wed, 21 Jun 2023 00:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1687332604; x=1689924604; 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=ZmyDfnK9tJh8eswYvjmWTei7tQJVIfXBxXoVL4SG7R8=; b=AErp9BkT1HOnQXLDaZG2ZhhgiFqoujRXuDRZ6mNMc66uo4iADPH8ND6vVT11LgrTTL AylPEuDYLAbzHcWd6s9RIjOsgstMtxC5b9BLtSsAOyK2HGqgHC3fff3Y4oZ7Y6VrxRlb xSE2jauM8NDE34EUg1l7tNFFj85RKWqV6X4jlUmegTW9fKm1MGIzqBLlvT7Dk2psnP4Y 8HbScXfthtVm8E5V+taPq0gF55iLE02AnUSQSRYRIhOz37xoTjciAU4olKLgmAwzKjUw VAxO82NHkTCDWNCuSI/RyrXR9+cfwhF5scfDxoKd+zT2dCML+89Tp+fKPi19rwUbwudh B7nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687332604; x=1689924604; 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=ZmyDfnK9tJh8eswYvjmWTei7tQJVIfXBxXoVL4SG7R8=; b=dFWFoq3dtWvGI9PzmmKxhggqcNLfZi9SJMBks50RCaNSQsDEvQoOLZO9qfLpWjx5Zj vM9s4Zsfc8s9R15cAvajAiIxZbiZ/y2+p20vEw0Z21GivSUL/6OjlGYaZZUWj9MLDW98 bj5rx0h0CK+myRy3QTnLbgMN+kimuIEW1dXqoYsJ4gO1vZiVYlo9TWFP6JXsvJXAht0S BCtV5xS2u6CKTJGmi76evwbt1agQzHJt9Ik2RvZzqXqWt8hPBRDf9PwlopDWg7imZz2f E8+86/+ErNZ2vHqYXsT/3Gi1vm33RGgg2mHKPQg4nHwqUEzbJWWHt0+w2oDLY6OZOXgm KjaA== X-Gm-Message-State: AC+VfDwNX/tpnFw6s53dBrMUq73MykP2rCFx/hVpWafMIyVA1uFMKO6p lNeuE2fpwlPJXe5Gv7M5Cp8h4w== X-Received: by 2002:a17:906:9b88:b0:988:8fed:8ae9 with SMTP id dd8-20020a1709069b8800b009888fed8ae9mr7743704ejc.37.1687332604526; Wed, 21 Jun 2023 00:30:04 -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 n17-20020a17090625d100b00988c6ac6b86sm2631710ejb.186.2023.06.21.00.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 00:30:03 -0700 (PDT) Date: Wed, 21 Jun 2023 09:30:02 +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 , Ben Gardon , David Matlack , 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 v3 10/10] KVM: riscv: selftests: Add get-reg-list test Message-ID: <20230621-37ea9461250036cc2ec8c544@orel> References: <8cd4ce50f5f4a639f4508085959aae222d4d4386.1686275310.git.haibo1.xu@intel.com> <20230609-fba04b424a4d46574e04e587@orel> <20230620-95ce8ab70956a72b9da3a31a@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,URIBL_BLOCKED autolearn=ham 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 Wed, Jun 21, 2023 at 09:55:13AM +0800, Haibo Xu wrote: > On Tue, Jun 20, 2023 at 6:44 PM Andrew Jones wrote: > > > > On Tue, Jun 20, 2023 at 06:05:59PM +0800, Haibo Xu wrote: > > > On Fri, Jun 9, 2023 at 9:35 PM Andrew Jones wrote: > > > > > > > > On Fri, Jun 09, 2023 at 10:12:18AM +0800, Haibo Xu wrote: > > > > > +static struct vcpu_reg_list aia_config = { > > > > > + .sublists = { > > > > > + BASE_SUBLIST, > > > > > + AIA_REGS_SUBLIST, > > > > > + {0}, > > > > > + }, > > > > > +}; > > > > > + > > > > > +static struct vcpu_reg_list fp_f_d_config = { > > > > > + .sublists = { > > > > > + BASE_SUBLIST, > > > > > + FP_F_REGS_SUBLIST, > > > > > + FP_D_REGS_SUBLIST, > > > > > + {0}, > > > > > + }, > > > > > +}; > > > > > + > > > > > +struct vcpu_reg_list *vcpu_configs[] = { > > > > > + &zicbo_config, > > > > > + &aia_config, > > > > > + &fp_f_d_config, > > > > > +}; > > > > > +int vcpu_configs_n = ARRAY_SIZE(vcpu_configs); > > > > > -- > > > > > 2.34.1 > > > > > > > > > > > > > I see we have a bit of a problem with the configs for riscv. Since we > > > > don't disable anything we're not testing, then for any test that is > > > > missing, for example, the f and d registers, we'll get output like > > > > "There are 66 new registers. Consider adding them to the blessed reg > > > > list with the following lines:" and then a dump of all the f and d > > > > registers. The test doesn't fail, but it's messy and confusing. Ideally > > > > we'd disable all registers of all sublists not in the config, probably > > > > by starting by disabling everything and then only reenabling the ones > > > > in the config. > > > > > > > > Anything that can't be disabled is either a KVM bug, i.e. we should > > > > be able to disable it, because we can't expect every host to have it, > > > > or it needs to be in the base register sublist (meaning every host > > > > will always have it). > > > > > > > > > > HI Andrew, > > > > > > I found several multi-letters ISA EXT(AIA/SSTC etc) were not allowed > > > to be disabled. > > > Is it a bug? shall we fix it? > > > > Extensions that a guest could use (regardless of whether or not the host > > described it in the guest's isa string), because the instructions or CSR > > accesses don't trap, can't truly be disabled. So, it's not a bug to > > prohibit disabling them and indeed the test cases should actually ensure > > disabling them fails. > > > > So these kinds of ISA_EXT_* regs should be in the base reg list, right? > Ah, this is getting a bit messy. We don't want all these extensions in a "base", which represents extensions for all possible hosts, because the extensions are optional, but, we can't remove them from get-reg-list output by disabling them, since they can't be disabled. It seems we need the concept of "base", which is the common set expected on all hosts, and also the concept of "this host's base". I'm struggling to think of a nice way to deal with that. A first thought is to both add these types of registers to their own extension-specific sublists and to filter_reg(). I think that will keep them from being reported as new registers in every test, but also allow detection of them going missing when they're extension is present. Thanks, drew