Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23874445rwd; Sat, 1 Jul 2023 08:35:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/EMvf51pEi4Cw07zUWvGLehwmd6607/zANykZKzt5/UWtT/1G7V/rJZ3jSvottJSXsVHW X-Received: by 2002:a05:6a20:258f:b0:12d:e9d6:fd26 with SMTP id k15-20020a056a20258f00b0012de9d6fd26mr913624pzd.46.1688225736577; Sat, 01 Jul 2023 08:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688225736; cv=none; d=google.com; s=arc-20160816; b=ece7sGo2Eq8jeN1Gp13qKDm+eUUqRE76bwRr9KI5Emsq/4QbsyMJXV3WnsyEzV54Rc kpiGcz1CZLK0o8HWLRquR7mVpcGBlHrAFgsbcaTXIS45FxdrxX3Un0vkD2DKeTPnNz3C zQbgWTuu5EtgvfHaVH9wNANZsyQ8RgcT0BJOdMQ5nQw2XqEkQ+k8pB4bWOxgQHesnsOy zVyH3J2BQgVhdveWIZ8XoOPeQsKwPPIxOiEvJMOz5PGQg6BJf/hmRa0NDqdFFBw3Xn4/ C+20zF9flVFtyx8LseawDUd5bZl+Pw53Z406q3J19BhXbaxDwEAZZ1NFUNThfKUsz6qM zRkw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Ltc0O996d2bJf/usVXZjvRnz8qhepirqOjCRCwuDkdg=; fh=PvxWxSZoafCkFOIfXZZ18Lxht/wo4S2gGh07wH5NSc8=; b=yUhghO6I/oDCHXwAYxRhf4YdggiRgVS6AWYhh+OlUqLnqj3QPma3YQStQb0btKobsA IElGpaKRYoGSRUhOHOvtIASvANMJwlPNFGe1ZgrRERk80zW06HKZLrvclZohGygQdR1n pdkeNoWfZTOzFeDkTpJjFWVUGDVC7IizBi1iSJJWtP+pHpnhpiafS3qiClgzbruUsl3E jXYQ1K8Q4QwPA/15Yi3hrzDS2oPdxThjLsJ7R/Px0QUKxAqAj+DGht4nlP0NxwyF7fAG 0lFs3Oeljbj6s/TwxqjiSLTzyMVu2H/THV6W6oWUqJYqWBbbP2iPJllU3auMdxKEtSLf xgNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mDa0A4ah; 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 o7-20020a635d47000000b005503f266742si14227217pgm.647.2023.07.01.08.35.23; Sat, 01 Jul 2023 08:35:36 -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=mDa0A4ah; 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 S230402AbjGAOVl (ORCPT + 99 others); Sat, 1 Jul 2023 10:21:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbjGAOVk (ORCPT ); Sat, 1 Jul 2023 10:21:40 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548C71FC0 for ; Sat, 1 Jul 2023 07:21:38 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-98e109525d6so516092666b.0 for ; Sat, 01 Jul 2023 07:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1688221297; x=1690813297; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ltc0O996d2bJf/usVXZjvRnz8qhepirqOjCRCwuDkdg=; b=mDa0A4ah1iKgzXPnYv6/44AHozwnFGGexPg+UG35lheBAs2gxqEQVUT75hMDymftsC 0fRnCqPM7tXd26//jB7kOakAX0ym5Naru8vmf0OCMxxtMl2DPXtfyxhv0KthKTTiwirZ fjsOTUpn9YXNB9lStXMEnjUnzUqC+Y62quzZNOsNN5P4wd3f/hfEtKVlDn/Gv2vX9LUl 1x1FTpGdFhG7i1ycYDHyPnKhv1v2H/eT5xE5NzuzWkAzpiNYxRcxQHbKT6WiIPMBRlEx MyyGYNFWvbX5/dR91U9v12GyQFs5eINSLn4N5xBTyAHwIkCDZXbkvJWs2m9ko7eqGUB0 JoFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688221297; x=1690813297; h=in-reply-to: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=Ltc0O996d2bJf/usVXZjvRnz8qhepirqOjCRCwuDkdg=; b=M2E3tocUtAzVi9BIoSLtj4dkXka43iRJ5vZIQOvobMPKuTt0ZbfisTYtG0nMt3MNsL 9Y9oRjlk8Pwv8Uc5rDx+dWURLh4ytwYkB2EJa9AUezW1aymkGeR2vLmLfT+E/VWe/oMU 2Vbvkg+c1mjBx3b/ziUGgzt1yxh96xduzfy5fiQA+wkiITVezLzUg5fwIbrbx0thztnE +aoxtACsUbMR+05RsiPx8JiSzwZI0hEMf1pOtRcQZ4R1xI8fQjOQYS5+9cL8yutDg3yh H1OcCmmrGfX5sn96u944EiwIHwHOO4xBUiVzCqgHzHbmapnY9dbcsA90e7S1oV6X75Yc jWqQ== X-Gm-Message-State: ABy/qLbdrIAnNlwwRyIl6lEnS2WrqH6rp6JfXIBzOp0FWNuIBBlbUD1K suik6A+r147rZd16crv9IRYT2w== X-Received: by 2002:a17:906:18d:b0:991:d883:3df9 with SMTP id 13-20020a170906018d00b00991d8833df9mr6213162ejb.21.1688221296673; Sat, 01 Jul 2023 07:21:36 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id a18-20020a1709063a5200b00988f168811bsm9355065ejf.135.2023.07.01.07.21.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 07:21:36 -0700 (PDT) Date: Sat, 1 Jul 2023 16:21:34 +0200 From: Andrew Jones To: Haibo Xu Cc: xiaobo55x@gmail.com, 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 , Ricardo Koller , Vishal Annapurve , 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 v5 08/13] KVM: arm64: selftests: Move reject_set check logic to a function Message-ID: <20230701-0255de0b29b22f180bb3bbbf@orel> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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=unavailable 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, Jul 01, 2023 at 09:42:56PM +0800, Haibo Xu wrote: > No functional changes. Just move the reject_set check logic to a > function so we can check for specific errno for specific register. 'for specific register' part isn't true anymore. > This is a preparation for support reject_set in riscv. > > Suggested-by: Andrew Jones > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/aarch64/get-reg-list.c | 5 +++++ > tools/testing/selftests/kvm/get-reg-list.c | 7 ++++++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/tools/testing/selftests/kvm/aarch64/get-reg-list.c b/tools/testing/selftests/kvm/aarch64/get-reg-list.c > index aaf035c969ec..4aa58f1aebe3 100644 > --- a/tools/testing/selftests/kvm/aarch64/get-reg-list.c > +++ b/tools/testing/selftests/kvm/aarch64/get-reg-list.c > @@ -27,6 +27,11 @@ bool filter_reg(__u64 reg) > return false; > } > > +bool check_reject_set(int err) > +{ > + return err == EPERM; > +} > + > #define REG_MASK (KVM_REG_ARCH_MASK | KVM_REG_SIZE_MASK | KVM_REG_ARM_COPROC_MASK) > > #define CORE_REGS_XX_NR_WORDS 2 > diff --git a/tools/testing/selftests/kvm/get-reg-list.c b/tools/testing/selftests/kvm/get-reg-list.c > index f6ad7991a812..79e198968860 100644 > --- a/tools/testing/selftests/kvm/get-reg-list.c > +++ b/tools/testing/selftests/kvm/get-reg-list.c > @@ -98,6 +98,11 @@ void __weak print_reg(const char *prefix, __u64 id) > printf("\t0x%llx,\n", id); > } > > +bool __weak check_reject_set(int err) > +{ > + return true; > +} > + > #ifdef __aarch64__ > static void prepare_vcpu_init(struct vcpu_reg_list *c, struct kvm_vcpu_init *init) > { > @@ -216,7 +221,7 @@ static void run_test(struct vcpu_reg_list *c) > if (s->rejects_set && find_reg(s->rejects_set, s->rejects_set_n, reg.id)) { > reject_reg = true; > ret = __vcpu_ioctl(vcpu, KVM_SET_ONE_REG, ®); > - if (ret != -1 || errno != EPERM) { > + if (ret != -1 || !check_reject_set(errno)) { > printf("%s: Failed to reject (ret=%d, errno=%d) ", config_name(c), ret, errno); > print_reg(config_name(c), reg.id); > putchar('\n'); > -- > 2.34.1 > Otherwise, Reviewed-by: Andrew Jones