From patchwork Tue Mar 29 15:42:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 8688661 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2CE0BC0553 for ; Tue, 29 Mar 2016 15:47:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C44520160 for ; Tue, 29 Mar 2016 15:47:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 77C8420121 for ; Tue, 29 Mar 2016 15:47:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A817C6E6AD; Tue, 29 Mar 2016 15:47:51 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:120:8448::d00d]) by gabe.freedesktop.org (Postfix) with ESMTP id AD6156E6AD for ; Tue, 29 Mar 2016 15:47:48 +0000 (UTC) X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hli8XmsHC2QJ; Tue, 29 Mar 2016 17:42:15 +0200 (CEST) Received: from pd.tnic (p54AF4F9D.dip0.t-ipconnect.de [84.175.79.157]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 32969245A97; Tue, 29 Mar 2016 17:42:06 +0200 (CEST) Received: by pd.tnic (Postfix, from userid 1000) id A24C91618D4; Tue, 29 Mar 2016 17:42:03 +0200 (CEST) From: Borislav Petkov To: X86 ML Date: Tue, 29 Mar 2016 17:42:01 +0200 Message-Id: <1459266123-21878-9-git-send-email-bp@alien8.de> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1459266123-21878-1-git-send-email-bp@alien8.de> References: <1459266123-21878-1-git-send-email-bp@alien8.de> Cc: intel-gfx@lists.freedesktop.org, LKML Subject: [Intel-gfx] [PATCH 08/10] x86/cpufeature: Kill cpu_has_pat X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Borislav Petkov Signed-off-by: Borislav Petkov Cc: intel-gfx@lists.freedesktop.org Acked-by: Daniel Vetter --- @tip guys, the pat_bsp_init() and pat_ap_init() hunk will conflict with d63dcf49cf5a ("x86/mm/pat: Replace cpu_has_pat with boot_cpu_has()") in tip/x86:mm. Let me know how you wanna handle it. Or you can simply delete those hunks below when applying after merging the above branch. Or I can send this patch later... Yadda yadda. arch/x86/include/asm/cpufeature.h | 1 - arch/x86/mm/pat.c | 4 ++-- drivers/gpu/drm/i915/i915_gem.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 5e02bc2e8444..ad480c5fb27c 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h @@ -128,7 +128,6 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; #define cpu_has_aes boot_cpu_has(X86_FEATURE_AES) #define cpu_has_avx boot_cpu_has(X86_FEATURE_AVX) #define cpu_has_avx2 boot_cpu_has(X86_FEATURE_AVX2) -#define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT) #define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE) #define cpu_has_xsaves boot_cpu_has(X86_FEATURE_XSAVES) /* diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index faec01e7a17d..6df20ac83ec3 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c @@ -202,7 +202,7 @@ static void pat_bsp_init(u64 pat) { u64 tmp_pat; - if (!cpu_has_pat) { + if (!boot_cpu_has(X86_FEATURE_PAT)) { pat_disable("PAT not supported by CPU."); return; } @@ -227,7 +227,7 @@ static void pat_ap_init(u64 pat) if (!pat_enabled()) return; - if (!cpu_has_pat) { + if (!boot_cpu_has(X86_FEATURE_PAT)) { /* * If this happens we are on a secondary CPU, but switched to * PAT on the boot CPU. We have no way to undo PAT. diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 3d31d3ac589e..aaec8aef9fd4 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1732,7 +1732,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, if (args->flags & ~(I915_MMAP_WC)) return -EINVAL; - if (args->flags & I915_MMAP_WC && !cpu_has_pat) + if (args->flags & I915_MMAP_WC && !boot_cpu_has(X86_FEATURE_PAT)) return -ENODEV; obj = drm_gem_object_lookup(dev, file, args->handle);