From patchwork Thu May 25 07:38:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 98832 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp183964vqr; Thu, 25 May 2023 00:48:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ749iwWEkLXf0UKl2sOJ1EJHUYezi4EtGUz0LvsWMzJEf5+AygRNg06j5ZkKP0oL2vq8+No X-Received: by 2002:a05:6a21:32a1:b0:10b:8221:3348 with SMTP id yt33-20020a056a2132a100b0010b82213348mr15965595pzb.50.1685000912916; Thu, 25 May 2023 00:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685000912; cv=none; d=google.com; s=arc-20160816; b=C63e1TEsLeaOtqBiiJ/ePWjbVsH/jOBIwX8vhEJMDhNDJu1q/7sPgd+VD9nw9t3OTx 9vK7pcl7An1oYQYD4h6EJaI1mH1w5hWL/s7OQTSx0fb2MPH0mnibk7oVUcl3tdmF9YXC 95Afp7d6UPZMIvbdm2ZAHhUrhf4qzP8gxn4jf/0gB7UO9jhVge1zLqgadbm+gRw5RsL6 ds9Dw3a3bLk3bh/DlDVyZOHUpjEKWrpWCDwIf7YnfdtCN3a0maDOJFTrRkLJwe92ciO1 E8qj9U8p358UEroNtARRqTfD1yATnAl9/VDU3yOdInuq+IYNA+WKQmavs52yJ3Td7Vum FEZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=gKDGIAmG9ZqX/sTlsP/NeQIqpajvcflifxrqgtxtNnI=; b=J+o0kjxYEtkevZnEgbpXAEWFo9u7nn45lNVxwUSG5ATB8YpcLiLuAM7NPYZPqfbT07 u9zF7m/FFU9ioGobL+Lk5jDc7L+3R1TvYbIrncpqG9HhWYBtXZ6/cP+dWyxS2eJOsHD3 dpWH5562MpfLPLb/EHBjhVRmowklwaSuqgklbu/Cwk28R4L1J/6Mv0CLleXU796fwYzX Jks5OEIiUoAV1lTr/eglwaBjDIsnK5+BmkJYRK4YptAu4TICAOYtW/7olZWaPYpL689P Db/slCpjQiV31XmIjxqbKub2uPHGFq2jDUKK/L6toTFLqGjDndABW0e3dAp4qpI7Vfmr cXDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=Bkp5PEyI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z194-20020a6333cb000000b00534897a49a6si554992pgz.294.2023.05.25.00.48.18; Thu, 25 May 2023 00:48:32 -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=fail header.i=@intel.com header.s=Intel header.b=Bkp5PEyI; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239056AbjEYHgb (ORCPT + 99 others); Thu, 25 May 2023 03:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239726AbjEYHfr (ORCPT ); Thu, 25 May 2023 03:35:47 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DED5AE5D; Thu, 25 May 2023 00:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685000137; x=1716536137; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+u1HJaFTXrPVFD+3NbnmJ/AGWJcDm8pIPpTYzo4Zo5U=; b=Bkp5PEyInb678hmkrwtWbI30yRf5zJepIUrUlS8sd8LuIjCGC5dkVFrs VoOgJy4561daLXNDUnaJsdzm8Az1KkntxTC4gNtcsC7zJn++pCjiwe2+9 9oaI7/upetz5i5JjqAqAMm/m6PwfGXt0y7bBO19ZS65PUSv564fVOM4mn YJF6DANeUdUP7/2qf6FlSFFpRGfLeunUe7cZQ+/d6ErqeLAjYrRZ4oJd3 HYO1k9dR2+Gysx7oQ+E0Bjd0Kq81zBUbv7Z2DK//u7mShicUEtpFY7FNu Eot7+r/tShfvhiPs71Cd18c8LPATq6NZ9ipUk8j5ipPhFITn+Q6arOYpq Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="356164562" X-IronPort-AV: E=Sophos;i="6.00,190,1681196400"; d="scan'208";a="356164562" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 00:34:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10720"; a="769776197" X-IronPort-AV: E=Sophos;i="6.00,190,1681196400"; d="scan'208";a="769776197" Received: from haibo-optiplex-7090.sh.intel.com ([10.239.159.132]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2023 00:34:48 -0700 From: Haibo Xu Cc: xiaobo55x@gmail.com, haibo1.xu@intel.com, ajones@ventanamicro.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 , 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: [PATCH v2 10/11] KVM: riscv: selftests: Skip some registers set operation Date: Thu, 25 May 2023 15:38:34 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766851517247376078?= X-GMAIL-MSGID: =?utf-8?q?1766851517247376078?= Set operation on some riscv registers(mostly pesudo ones) was not supported and should be skipped in the get-reg-list test. Just reuse the rejects_set utilities to handle it in riscv. Signed-off-by: Haibo Xu Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/get-reg-list.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kvm/get-reg-list.c b/tools/testing/selftests/kvm/get-reg-list.c index f1fc113e9719..ebd6b580b33b 100644 --- a/tools/testing/selftests/kvm/get-reg-list.c +++ b/tools/testing/selftests/kvm/get-reg-list.c @@ -211,16 +211,22 @@ static void run_test(struct vcpu_reg_list *c) ++failed_get; } - /* rejects_set registers are rejected after KVM_ARM_VCPU_FINALIZE */ + /* + * rejects_set registers are rejected after KVM_ARM_VCPU_FINALIZE on aarch64, + * or registers that should skip set operation on riscv. + */ for_each_sublist(c, s) { 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) { - printf("%s: Failed to reject (ret=%d, errno=%d) ", config_name(c), ret, errno); - print_reg(config_name(c), reg.id); - putchar('\n'); - ++failed_reject; + if ((reg.id & KVM_REG_ARCH_MASK) == KVM_REG_ARM64) { + ret = __vcpu_ioctl(vcpu, KVM_SET_ONE_REG, ®); + if (ret != -1 || errno != EPERM) { + printf("%s: Failed to reject (ret=%d, errno=%d) ", + config_name(c), ret, errno); + print_reg(config_name(c), reg.id); + putchar('\n'); + ++failed_reject; + } } break; }