From patchwork Fri Oct 26 12:55:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Hoo X-Patchwork-Id: 989571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42hPDB4s23z9sBn for ; Fri, 26 Oct 2018 23:57:46 +1100 (AEDT) Received: from localhost ([::1]:59966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG1gO-00015D-2a for incoming@patchwork.ozlabs.org; Fri, 26 Oct 2018 08:57:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gG1fh-00012d-Ro for qemu-devel@nongnu.org; Fri, 26 Oct 2018 08:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gG1fg-0007dx-Ra for qemu-devel@nongnu.org; Fri, 26 Oct 2018 08:57:01 -0400 Received: from mga14.intel.com ([192.55.52.115]:32029) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gG1fg-0006eB-JE for qemu-devel@nongnu.org; Fri, 26 Oct 2018 08:57:00 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2018 05:55:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,427,1534834800"; d="scan'208";a="103508535" Received: from sqa-gate.sh.intel.com (HELO robert-ivt.tsp.org) ([10.239.48.212]) by orsmga002.jf.intel.com with ESMTP; 26 Oct 2018 05:55:57 -0700 From: Robert Hoo To: pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, thomas.lendacky@amd.com Date: Fri, 26 Oct 2018 20:55:52 +0800 Message-Id: <1540558555-75679-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 v6 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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: v6: In cpu feature filtering, filter out MSR features whose CPUID feature dependency is not there. Check feature word type for other accelerator, like hvf, for otherwise it would return bogus EAX/ECX values in x86_cpu_get_supported_feature_word(). 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 | 234 +++++++++++++++++++++++++++++++++++++++------------ target/i386/cpu.h | 15 +++- target/i386/kvm.c | 91 ++++++++++++++++++++ 4 files changed, 289 insertions(+), 53 deletions(-)