From patchwork Tue Jan 9 07:01:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Bernat X-Patchwork-Id: 10151027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9ADF0603ED for ; Tue, 9 Jan 2018 07:02:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E61A28683 for ; Tue, 9 Jan 2018 07:02:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82FEC286A2; Tue, 9 Jan 2018 07:02:39 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 D6940286B5 for ; Tue, 9 Jan 2018 07:02:38 +0000 (UTC) Received: from localhost ([::1]:33309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYnvh-0002Ek-G2 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 09 Jan 2018 02:02:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYnuW-0001UX-J8 for qemu-devel@nongnu.org; Tue, 09 Jan 2018 02:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eYnuQ-0007de-TD for qemu-devel@nongnu.org; Tue, 09 Jan 2018 02:01:24 -0500 Received: from bart.luffy.cx ([78.47.78.131]:51060) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eYnuQ-0007cP-J4 for qemu-devel@nongnu.org; Tue, 09 Jan 2018 02:01:18 -0500 Received: from bart.luffy.cx (localhost [127.0.0.1]) by bart.luffy.cx (Postfix) with ESMTP id A4B641534F; Tue, 9 Jan 2018 08:01:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bernat.im; h=from:to:cc :subject:date:message-id; s=postfix; bh=Rc2IlBO8JL0sZzwtL9b1hJT/ Ans=; b=tgYlqB73HQ8tbW59Aku7BYHmDbJemtKIQmECZBs4WNGU5QuLINSrEbdz 6Ef5GzHNADOFGQNwFmrrTWsB24bKteVjP6Tg35cIklACJxKzNXbGUI5Lru8exQSA rMyTayEVSMr2J3mGNiIIWv0PdSROHMdrQBcYEo8zRHjl+uxe+fg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bernat.im; h=from:to:cc :subject:date:message-id; q=dns; s=postfix; b=Z7TkCe4SNVUAsNiOBy 2hF1CDBNGKIshf5ZdRAIY2F2ZExuC2jtXviLAaHS2XZw8ktsNUF2oJP35rSdqmKR 8xVbSnpmbJjsHs+xSVka297i7Nx3lpevvjhVdNru/+gnr9KkIx+pj1scFR3d26yh ZGHTLSMRM0eV5m9ee66UybHO4= Received: from neo.luffy.cx (184.66.60.188.dynamic.wline.res.cust.swisscom.ch [188.60.66.184]) by bart.luffy.cx (Postfix) with ESMTPS id 5AF341534B; Tue, 9 Jan 2018 08:01:16 +0100 (CET) Received: by neo.luffy.cx (Postfix, from userid 500) id 1744B2166; Tue, 9 Jan 2018 08:01:16 +0100 (CET) From: Vincent Bernat To: Paolo Bonzini , Richard Henderson , Eduardo Habkost , qemu-devel@nongnu.org Date: Tue, 9 Jan 2018 08:01:12 +0100 Message-Id: <20180109070112.30806-1-vincent@bernat.im> X-Mailer: git-send-email 2.15.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 78.47.78.131 Subject: [Qemu-devel] [PATCH x86-next v2] target-i386: add PCID flag to Westmere, Sandy Bridge and Ivy Bridge 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: Vincent Bernat Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP PCID has been introduced in Westmere and, since Linux 3.6 (ad756a1603c5), KVM exposes PCID flag if host has it. Update CPU model for Westmere, Sandy Bridge and Ivy Bridge accordingly. Ensure compat 2.11 keeps PCID disabled by default for those models and document the new requirement for host kernel. Signed-off-by: Vincent Bernat --- include/hw/i386/pc.h | 14 +++++++++++++- qemu-doc.texi | 11 +++++++++++ target/i386/cpu.c | 7 ++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index bb49165fe0a4..f4ccbfdc4ac2 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -327,6 +327,18 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "Skylake-Server" "-" TYPE_X86_CPU,\ .property = "clflushopt",\ .value = "off",\ + },{\ + .driver = "Westmere-" TYPE_X86_CPU,\ + .property = "pcid",\ + .value = "off",\ + },{\ + .driver = "SandyBridge-" TYPE_X86_CPU,\ + .property = "pcid",\ + .value = "off",\ + },{\ + .driver = "IvyBridge-" TYPE_X86_CPU,\ + .property = "pcid",\ + .value = "off",\ }, #define PC_COMPAT_2_10 \ @@ -351,7 +363,7 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .driver = "mch",\ .property = "extended-tseg-mbytes",\ .value = stringify(0),\ - },\ + }, #define PC_COMPAT_2_8 \ HW_COMPAT_2_8 \ diff --git a/qemu-doc.texi b/qemu-doc.texi index 8d0c809ad5cf..9e1a03181427 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -37,6 +37,7 @@ * QEMU System emulator for non PC targets:: * QEMU Guest Agent:: * QEMU User space emulator:: +* System requirements:: * Implementation notes:: * Deprecated features:: * License:: @@ -2565,6 +2566,16 @@ Act as if the host page size was 'pagesize' bytes Run the emulation in single step mode. @end table +@node System requirements +@chapter System requirements + +@section KVM kernel module + +On x86_64 hosts, the default set of CPU features enabled by the KVM +accelerator require the host to be running Linux v3.6 or newer. If the +minimum requirement is not met, the guest will not be runnable, +depending on the selected CPU model. Older emulated machines, like +``pc-q35-2.10'', may work with older kernels. @include qemu-tech.texi diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 65f785c7e739..873c0151ef57 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1081,7 +1081,7 @@ static X86CPUDefinition builtin_x86_defs[] = { .features[FEAT_1_ECX] = CPUID_EXT_AES | CPUID_EXT_POPCNT | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | - CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, + CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3 | CPUID_EXT_PCID, .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, .features[FEAT_8000_0001_ECX] = @@ -1109,7 +1109,7 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ | - CPUID_EXT_SSE3, + CPUID_EXT_SSE3 | CPUID_EXT_PCID, .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL, @@ -1140,7 +1140,8 @@ static X86CPUDefinition builtin_x86_defs[] = { CPUID_EXT_TSC_DEADLINE_TIMER | CPUID_EXT_POPCNT | CPUID_EXT_X2APIC | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | CPUID_EXT_CX16 | CPUID_EXT_SSSE3 | CPUID_EXT_PCLMULQDQ | - CPUID_EXT_SSE3 | CPUID_EXT_F16C | CPUID_EXT_RDRAND, + CPUID_EXT_SSE3 | CPUID_EXT_F16C | CPUID_EXT_RDRAND | + CPUID_EXT_PCID, .features[FEAT_7_0_EBX] = CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_ERMS,