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: 681504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C1DCC77B7F for ; Thu, 11 May 2023 09:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237477AbjEKJR3 (ORCPT ); Thu, 11 May 2023 05:17:29 -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 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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