All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang YanQing <udknight@gmail.com>
To: spock@gentoo.org
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	x86@kernel.org, hpa@linux.intel.com
Subject: [PATCH 2/2] video:uvesafb: Fix oops when uvesafb try to execute NX-protected page
Date: Mon, 27 Feb 2012 09:04:29 +0800	[thread overview]
Message-ID: <20120227010429.GC4019@udknight> (raw)


commit 5bd5a452662bc37c54fb6828db1a3faf87e6511c add NX protection for kernel
data. So on many machine (like my machine Aspire 4741 and other three machines I
have tested) this commit will make the BIOS NX,  then when uvesafb use PMI and
try to execute NX-protected page, Oops!
This patch try to resolve it!
(I have try to let uvesafb_pan_display use v86d to do pan, but it works very
very bad, so I give it up)

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/uvesafb.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index e7f69ef..f7e326f 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -23,6 +23,7 @@
 #include <video/uvesafb.h>
 #ifdef CONFIG_X86
 #include <video/vga.h>
+#include <linux/pci.h>
 #endif
 #ifdef CONFIG_MTRR
 #include <asm/mtrr.h>
@@ -812,11 +813,16 @@ static int __devinit uvesafb_vbe_init(struct fb_info *info)
 
 	par->nocrtc = nocrtc;
 #ifdef CONFIG_X86_32
+	if (check_pcibios_enabled()) {
 	par->pmi_setpal = pmi_setpal;
 	par->ypan = ypan;
 
 	if (par->pmi_setpal || par->ypan)
 		uvesafb_vbe_getpmi(task, par);
+	} else {
+		par->pmi_setpal = par->ypan = 0;
+		printk(KERN_WARNING "uvesafb: PCI BIOS is NX, can't use PMI. Use redraw instead\n");
+	}
 #else
 	/* The protected mode interface is not available on non-x86. */
 	par->pmi_setpal = par->ypan = 0;
-- 
1.7.3.4


                 reply	other threads:[~2012-02-27  1:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120227010429.GC4019@udknight \
    --to=udknight@gmail.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spock@gentoo.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.