From patchwork Fri Mar 11 22:16:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 8569721 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A85369F44D for ; Fri, 11 Mar 2016 22:17:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D3C5E20221 for ; Fri, 11 Mar 2016 22:17:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF4832034C for ; Fri, 11 Mar 2016 22:17:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932855AbcCKWRQ (ORCPT ); Fri, 11 Mar 2016 17:17:16 -0500 Received: from mx2.suse.de ([195.135.220.15]:59475 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932084AbcCKWRO (ORCPT ); Fri, 11 Mar 2016 17:17:14 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DABBDABAF; Fri, 11 Mar 2016 22:17:10 +0000 (UTC) Received: by pd.tnic (Postfix, from userid 1000) id D7CD5161553; Fri, 11 Mar 2016 23:16:51 +0100 (CET) Date: Fri, 11 Mar 2016 23:16:51 +0100 From: Borislav Petkov To: Paolo Bonzini Cc: One Thousand Gnomes , Paul Gortmaker , Toshi Kani , Richard Purdie , Toshi Kani , Bruce Ashfield , "Hart, Darren" , "saul.wold" , linux-kernel@vger.kernel.org, kvm ML , x86-ml Subject: Re: runtime regression with "x86/mm/pat: Emulate PAT when it is disabled" Message-ID: <20160311221651.GE4347@pd.tnic> References: <1457398578.15454.421.camel@hpe.com> <1457400913.15454.435.camel@hpe.com> <20160310144250.GG23251@windriver.com> <1457628591.15454.542.camel@hpe.com> <20160310172029.GA2194@pd.tnic> <20160310190429.GI23251@windriver.com> <20160310191933.GC2194@pd.tnic> <20160311132356.43a7b373@lxorguk.ukuu.org.uk> <20160311134000.GC4347@pd.tnic> <56E319FF.3090709@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <56E319FF.3090709@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Mar 11, 2016 at 08:18:23PM +0100, Paolo Bonzini wrote: > Somebody got it wrong 10-ish years ago, and nobody has ever checked since. > > But, don't use qemu32 or qemu64. Use kvm32 and kvm64, or better > something like the host you run on ("-cpu Nehalem", "-cpu SandyBridge", > "-cpu Haswell-noTSX" etc.). Paul, Richard, how about it? > I really, really should fix those defaults... Here's a start, while I have everything fresh in my head. --- From: Borislav Petkov Date: Fri, 11 Mar 2016 23:11:05 +0100 Subject: [PATCH] target-i386/cpu: Correct MTRR and PAT feature bits Pentium Pro had MTRRs but not PAT, PAT support appeared in Pentium III. Fix all defines. Signed-off-by: Borislav Petkov --- target-i386/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 0f38d1eae317..fa7ea4a8c229 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -308,12 +308,12 @@ static const char *cpuid_6_feature_name[] = { #define PENTIUM_FEATURES (I486_FEATURES | CPUID_DE | CPUID_TSC | \ CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_MMX | CPUID_APIC) #define PENTIUM2_FEATURES (PENTIUM_FEATURES | CPUID_PAE | CPUID_SEP | \ - CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | CPUID_PAT | \ + CPUID_MTRR | CPUID_PGE | CPUID_MCA | CPUID_CMOV | \ CPUID_PSE36 | CPUID_FXSR) -#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE) +#define PENTIUM3_FEATURES (PENTIUM2_FEATURES | CPUID_SSE | CPUID_PAT) #define PPRO_FEATURES (CPUID_FP87 | CPUID_DE | CPUID_PSE | CPUID_TSC | \ CPUID_MSR | CPUID_MCE | CPUID_CX8 | CPUID_PGE | CPUID_CMOV | \ - CPUID_PAT | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \ + CPUID_MTRR | CPUID_FXSR | CPUID_MMX | CPUID_SSE | CPUID_SSE2 | \ CPUID_PAE | CPUID_SEP | CPUID_APIC) #define TCG_FEATURES (CPUID_FP87 | CPUID_PSE | CPUID_TSC | CPUID_MSR | \