linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Ying <ying.huang@intel.com>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Russell King <linux@arm.linux.org.uk>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Renninger <trenn@suse.de>, Len Brown <lenb@kernel.org>,
	"Moore, Robert" <robert.moore@intel.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"bondd@us.ibm.com" <bondd@us.ibm.com>,
	Myron Stowe <myron.stowe@redhat.com>
Subject: RE: [PATCH 2/2] ACPICA: support Generic Address Structure bit_offset in acpi_read/write
Date: Thu, 01 Dec 2011 08:49:11 +0800	[thread overview]
Message-ID: <1322700551.4849.66.camel@yhuang-dev> (raw)
In-Reply-To: <0207C53569FE594381A4F2EB66570B2A018ED45AA8@orsmsx508.amr.corp.intel.com>

On Thu, 2011-12-01 at 05:54 +0800, Luck, Tony wrote:
> > But as this code may be used in general acpi_read/write path too in the
> > future, can you verify whether it is harmless on ia64?
> 
> This might be a problem on ia64 - it is s/w responsibility to make sure
> that we don't map the same underlying physical address using different
> cache attributes - e.g. we must not map memory both cacheable and uncacheable
> at the same time.  Accessing such a mis-attributed page will result in a
> machine check.
> 
> So I'd worry that if the memory in question was being used as uncacheable,
> this code might result in a cached access, which would crash the machine.

+static void __iomem *acpi_map(phys_addr_t pg_off, unsigned long pg_sz)
+{
+	unsigned long pfn;
+
+	pfn = pg_off >> PAGE_SHIFT;
+	if (page_is_ram(pfn)) {
+		if (pg_sz > PAGE_SIZE)
+			return NULL;
+		return (void __iomem __force *)kmap(pfn_to_page(pfn));
+	} else
+		return ioremap(pg_off, pg_sz);
+}

Is it possible to use the page_is_ram() and kamp() path in the patch to avoid the situation you mentioned?

Best Regards,
Huang Ying



  reply	other threads:[~2011-12-01  0:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-11 23:05 [PATCH 0/2] acpi_read() bit_offset support Bjorn Helgaas
2011-11-11 23:05 ` [PATCH 1/2] ACPICA: acpi_read: update return value atomically Bjorn Helgaas
2011-11-11 23:05 ` [PATCH 2/2] ACPICA: support Generic Address Structure bit_offset in acpi_read/write Bjorn Helgaas
2011-11-15 15:13   ` Bjorn Helgaas
2011-11-15 16:49     ` Thomas Renninger
2011-11-16 15:45       ` Bjorn Helgaas
2011-11-16 19:58         ` Thomas Renninger
2011-11-17  0:15           ` Bjorn Helgaas
2011-12-12 15:39             ` Thomas Renninger
2011-11-16 23:27         ` Rafael J. Wysocki
2011-11-16 23:59           ` Bjorn Helgaas
2011-11-17 23:10             ` Rafael J. Wysocki
2011-11-17  0:51           ` Huang Ying
2011-11-17 20:27             ` Rafael J. Wysocki
2011-11-17 23:38               ` Thomas Renninger
2011-11-18  9:27                 ` Rafael J. Wysocki
2011-11-18  1:04               ` Huang Ying
2011-11-18  9:25                 ` Rafael J. Wysocki
2011-11-21  7:51                   ` Huang Ying
2011-11-21 10:08                     ` Russell King - ARM Linux
2011-11-28 23:03                     ` Luck, Tony
2011-11-29  2:15                       ` Huang Ying
2011-11-30 21:54                         ` Luck, Tony
2011-12-01  0:49                           ` Huang Ying [this message]
2011-12-01  0:53                             ` Luck, Tony
2011-12-01  0:57                               ` Huang Ying
2011-12-01  1:03                                 ` Luck, Tony
2011-12-01  1:11                                   ` Huang Ying
2011-12-01 17:35                                     ` Luck, Tony
2011-12-02  1:48                                       ` Huang Ying

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=1322700551.4849.66.camel@yhuang-dev \
    --to=ying.huang@intel.com \
    --cc=bhelgaas@google.com \
    --cc=bondd@us.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=myron.stowe@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=robert.moore@intel.com \
    --cc=tony.luck@intel.com \
    --cc=trenn@suse.de \
    /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).