From patchwork Mon Oct 15 04:47:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 10641053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 697D3933 for ; Mon, 15 Oct 2018 04:49:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B55E294EE for ; Mon, 15 Oct 2018 04:49:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA87294F3; Mon, 15 Oct 2018 04:49:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B24F294EE for ; Mon, 15 Oct 2018 04:49:06 +0000 (UTC) Received: from localhost ([::1]:50336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBuoT-0000ua-Lf for patchwork-qemu-devel@patchwork.kernel.org; Mon, 15 Oct 2018 00:49:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBun5-0008Up-RP for qemu-devel@nongnu.org; Mon, 15 Oct 2018 00:47:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBumz-00017e-LZ for qemu-devel@nongnu.org; Mon, 15 Oct 2018 00:47:39 -0400 Received: from mga14.intel.com ([192.55.52.115]:20045) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gBumy-00015F-Ra for qemu-devel@nongnu.org; Mon, 15 Oct 2018 00:47:33 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Oct 2018 21:47:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,383,1534834800"; d="scan'208";a="272425739" Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by fmsmga006.fm.intel.com with ESMTP; 14 Oct 2018 21:47:27 -0700 From: Robert Hoo To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, thomas.lendacky@amd.com Date: Mon, 15 Oct 2018 12:47:22 +0800 Message-Id: <1539578845-37944-1-git-send-email-robert.hu@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 Subject: [Qemu-devel] [PATCH v5 0/3] x86: QEMU side support on MSR based features X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robert.hu@intel.com, qemu-devel@nongnu.org, Robert Hoo Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP KVM side has added the framework (kvm.git:d1d93fa90) to support MSR based features. Here is the QEMU part, including data structure changes/expanding, referring functions changes, and the implementations on KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl. Changelog: v5: Re-order patches. Complement feature MSR set routines. v4: Re-organize patch set to conform to request of individually build pass. Add KVM capability check for KVM_GET_MSR_INDEX_LIST before fetch. Special treatment for MSR_IA32_ARCH_CAPABILITIES.RSBA. Use more convenient glib wrapper (g_strdup_printf) instead of native (sprintf). v3: patch 2&3 in v2 are corrupted. Re-format patches. v2: coding style changes to pass ./scripts/checkpatch.pl. Robert Hoo (3): kvm: Add support to KVM_GET_MSR_FEATURE_INDEX_LIST and KVM_GET_MSRS system ioctl x86: Data structure changes to support MSR based features x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES include/sysemu/kvm.h | 2 + target/i386/cpu.c | 217 +++++++++++++++++++++++++++++++++++++++------------ target/i386/cpu.h | 8 ++ target/i386/kvm.c | 91 +++++++++++++++++++++ 4 files changed, 266 insertions(+), 52 deletions(-)