linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Uvarov <maxim.uvarov@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, wim@iguana.be,
	torvalds@linux-foundation.org, stable@vger.kernel.org,
	Thomas.Mingarelli@hp.com, Maxim Uvarov <maxim.uvarov@oracle.com>
Subject: [PATCH] hpwdt: clean up set_memory_x call for 32 bit
Date: Sun, 15 Jan 2012 20:02:50 -0800	[thread overview]
Message-ID: <1326686570-19303-2-git-send-email-maxim.uvarov@oracle.com> (raw)
In-Reply-To: <1326686570-19303-1-git-send-email-maxim.uvarov@oracle.com>

1. addess has to be page aligned.
2. set_memory_x uses page size argument, not size.
Bug causes with following commit:
	commit da28179b4e90dda56912ee825c7eaa62fc103797
	Author: Mingarelli, Thomas <Thomas.Mingarelli@hp.com>
	Date:   Mon Nov 7 10:59:00 2011 +0100

     watchdog: hpwdt: Changes to handle NX secure bit in 32bit path

    commit e67d668e147c3b4fec638c9e0ace04319f5ceccd upstream.

    This patch makes use of the set_memory_x() kernel API in order
    to make necessary BIOS calls to source NMIs.

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
---
 drivers/watchdog/hpwdt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 9cb60df..7f04d37 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -216,7 +216,7 @@ static int __devinit cru_detect(unsigned long map_entry,
 
 	cmn_regs.u1.reax = CRU_BIOS_SIGNATURE_VALUE;
 
-	set_memory_x((unsigned long)bios32_entrypoint, (2 * PAGE_SIZE));
+	set_memory_x((unsigned long)bios32_entrypoint & PAGE_MASK, 2);
 	asminline_call(&cmn_regs, bios32_entrypoint);
 
 	if (cmn_regs.u1.ral != 0) {
@@ -235,7 +235,7 @@ static int __devinit cru_detect(unsigned long map_entry,
 			cru_rom_addr =
 				ioremap(cru_physical_address, cru_length);
 			if (cru_rom_addr) {
-				set_memory_x((unsigned long)cru_rom_addr, cru_length);
+				set_memory_x((unsigned long)cru_rom_addr & PAGE_MASK, cru_length >> PAGE_SHIFT);
 				retval = 0;
 			}
 		}
-- 
1.7.4.1


  reply	other threads:[~2012-01-16  4:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16  4:02 hpwdt: clean up set_memory_x call for 32 bit Maxim Uvarov
2012-01-16  4:02 ` Maxim Uvarov [this message]
2012-01-24 20:20   ` [PATCH] " Linus Torvalds
2012-01-24 20:37     ` Wim Van Sebroeck
2012-01-24 21:05       ` Mingarelli, Thomas
2012-01-25 23:21         ` Maxim Uvarov
2012-01-26  0:01           ` Mingarelli, Thomas
2012-01-27 16:49     ` Wim Van Sebroeck
2012-01-27 16:55       ` Mingarelli, Thomas
2012-01-27 18:33       ` Maxim Uvarov

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=1326686570-19303-2-git-send-email-maxim.uvarov@oracle.com \
    --to=maxim.uvarov@oracle.com \
    --cc=Thomas.Mingarelli@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wim@iguana.be \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).