From patchwork Thu May 11 09:22:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haibo Xu X-Patchwork-Id: 9194 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4230689vqo; Thu, 11 May 2023 02:25:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7yL/dv9VUuccffkE3OZMfkbIE8DvcIroqkAtn9dG61rUkS5jJ17Ogg6cqeQEOTXk7EY+lA X-Received: by 2002:a05:6a00:1688:b0:647:5409:5d08 with SMTP id k8-20020a056a00168800b0064754095d08mr12967729pfc.17.1683797137760; Thu, 11 May 2023 02:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683797137; cv=none; d=google.com; s=arc-20160816; b=ODHBn0ZMjdqOLUeSvJJGyw/bIpxEI2CRORypZ9oS/iB5TgNseNSZV04/ciU7YWZZcw tjdhiHDaZ1IGGAXIMdLYXUhb47T1J1/5lU1ATCHRf3mkAe28x16TuBA/dg5pWnRURkgZ hcpcfR6jm5D+aiP/mw6O3TLxxqKM5mRefWxxz2AjlW5vB5miiQWdAjM0IS7294c7/O2B jmiKBqX5GGOgJ15BWCZYQyeNxF9M7+e3/lWSC+/UIfoFidHo3RonZTUcuh6KjX3TP4Qm 3+N8NwvVpnbdmrfMwYsoBrqhn+rk60v1dlOtiwp/wXFeiyLWmrgCUd8wqp9+aCDjCiRH /iVw== 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 :message-id:date:subject:cc:from:dkim-signature; bh=jsGej2ekTOy/GDHcutLMd0Hw0R1B0zDpj0x2BKf1w6I=; b=eZU2fgjBKAQrfeqDsRKR/1S3I1PF3FZ0ymABirUeli41mh7CGXLUrzp8ndOT9ytShJ vbaqTqjPgAAzaaCHKvz7Zi+bgICKG27KqQb8L0DsoOMHdZtEygh2dJ+DnJ+lBTTwDyaG KtnHvddhaRshGZ/KTiJQPNd3Q6+LcLj0d3f+4z6yIuoEmO5ad3hoNJ2ZLqQ0vIelpf+m ZYb3m/1c4a5e+ux4CoSxacdzlqDEOA/JB65+4IiG9znG10PEPHlWEl0spiHf8mIl4czr ZmzltUUzEAHT2om6Jp3atld4ANUKN2OAoHdjpLmkhmm3crwPOZ6D/YCaqVjzCkxD8f04 o17Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=OCxstCiY; 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 c6-20020a6566c6000000b005303bf3e14bsi6371178pgw.412.2023.05.11.02.25.22; Thu, 11 May 2023 02:25:37 -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=OCxstCiY; 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 S237437AbjEKJRb (ORCPT + 99 others); Thu, 11 May 2023 05:17:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236079AbjEKJRV (ORCPT ); Thu, 11 May 2023 05:17:21 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4525AA5F7; Thu, 11 May 2023 02:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683796599; x=1715332599; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=n3XwJXO5FdIVuPB1WqckwaILsrCamFfH7Cyu/4AMII0=; b=OCxstCiYFYXfqDhWUGpbqENIUn7xZsanH+ZHRdW3YyiGMk6FzztNoDE3 DUhmjo3S0jx+bXYHvvpLWG9F0g/upihjyu8aXtb9jztPgQP9hmaqF9sTY 4tdirOJS9SRBu1ubGaMh2iH4uotB/XT6dkMCq6WJUXgEpjW7tuUvpRfKP y8EXkX3Re3v/D8NWVDt8OITeCWwNLgdNKZ114br4d8itnFAewXzVtCy2h T6gnH9REDdigQjkam/8q6QI/1emNVpMz45K+euoLYLS/cPfazKRswq+Q6 5yy3aJX5L/c/2E1TmCctmQW94WKXjGBjP1zUH80oUJoLMyYFJzmujUqGL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="416040303" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="416040303" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 02:16:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="789316811" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="789316811" Received: from haibo-optiplex-7090.sh.intel.com ([10.239.159.132]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 02:16:34 -0700 From: Haibo Xu Cc: xiaobo55x@gmail.com, ajones@ventanamicro.com, Haibo Xu , Paolo Bonzini , Jonathan Corbet , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Shuah Khan , 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 Subject: [PATCH 0/2] RISCV: Add KVM_GET_REG_LIST API Date: Thu, 11 May 2023 17:22:47 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 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_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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?1765589267287139806?= X-GMAIL-MSGID: =?utf-8?q?1765589267287139806?= KVM_GET_REG_LIST will dump all register IDs that are available to KVM_GET/SET_ONE_REG and It's very useful to identify some platform regression issue during VM migration. Patch 1 enabled the KVM_GET_REG_LIST API in riscv and patch 2 added the corresponding kselftest for checking possible register regressions. Both patches were ported from arm64 and tested with Linux 6.4-rc1 on a Qemu riscv virt machine. Haibo Xu (2): riscv: kvm: Add KVM_GET_REG_LIST API support KVM: selftests: Add riscv get-reg-list test Documentation/virt/kvm/api.rst | 2 +- arch/riscv/kvm/vcpu.c | 346 +++++++ tools/testing/selftests/kvm/Makefile | 3 + .../selftests/kvm/include/riscv/processor.h | 3 + .../selftests/kvm/riscv/get-reg-list.c | 869 ++++++++++++++++++ 5 files changed, 1222 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/kvm/riscv/get-reg-list.c