linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Huang Ying <ying.huang@intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>, Ingo Molnar <mingo@elte.hu>
Cc: Myron Stowe <myron.stowe@redhat.com>,
	lenb@kernel.org, linux-acpi@vger.kernel.org, rjw@sisk.pl,
	trenn@suse.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] ACPI, APEI: Add RAM mapping support to ACPI
Date: Mon, 30 Jan 2012 08:35:38 +0800	[thread overview]
Message-ID: <1327883738.7922.64.camel@yhuang-dev> (raw)
In-Reply-To: <CAErSpo5hrWz81SSS7Tg0HmTZ2seg76pa8kAe4iauAoqL6YAoOw@mail.gmail.com>

On Sun, 2012-01-29 at 13:41 -0700, Bjorn Helgaas wrote:
> On Sat, Jan 28, 2012 at 5:58 PM, Huang Ying <ying.huang@intel.com> wrote:
> > Hi, Bjorn,
> >
> > Sorry for late.  Just return from Chinese new year holiday.
> >
> > On Sat, 2012-01-21 at 08:04 -0700, Bjorn Helgaas wrote:
> > [snip]
> >> > +
> >> > +static void __iomem *acpi_map(acpi_physical_address pg_off, unsigned long pg_sz)
> >> > +{
> >> > +       unsigned long pfn;
> >> > +
> >> > +       pfn = pg_off >> PAGE_SHIFT;
> >> > +       if (should_use_kmap(pfn)) {
> >> > +               if (pg_sz > PAGE_SIZE)
> >> > +                       return NULL;
> >> > +               return (void __iomem __force *)kmap(pfn_to_page(pfn));
> >> > +       } else
> >> > +               return acpi_os_ioremap(pg_off, pg_sz);
> >>
> >> This implies that ioremap() works differently on ia64 than on x86.
> >> Apparently one can ioremap() RAM on x86, but not on ia64.  Why is this
> >> different?  Shouldn't we instead fix ioremap() on ia64 so it works the
> >> same as on x86?
> >
> > If my understanding were correct, ioremap can not work for RAM on x86.
> > So we need to use kmap for RAM.  And on IA64, ioremap works for RAM and
> > will take care of cache attributes while kmap will not.  So ioremap is
> > used on IA64, while kmap is used on x86.
> 
> My point is that the *user* of ioremap() shouldn't need to care what
> architecture we're on.  For example, maybe the ioremap()
> implementation could be changed so that it uses kmap() internally when
> necessary.

I think that is about the semantics of ioremap().

Hi, Ingo,

Can you describe why normal RAM is not allowed to be mapped by
ioremap()?

> >> I looked at the ia64 ioremap(), and I can't see the reason it fails
> >> for RAM.  Huang, do you remember the details from 76da3fb3575?
> 
> This question is still open.  Do you remember anything about it?

Copy from Tony's mail,

This (Ying: use kmap insted of ioremap to map RAM) 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.

Best Regards,
Huang Ying


  reply	other threads:[~2012-01-30  0:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-21  2:13 [PATCH 0/3] ACPI: Re-factor and remove ./drivers/acpi/atomicio.[ch] Myron Stowe
2012-01-21  2:13 ` [PATCH 1/3] ACPI, APEI: Add 64-bit read/write support for APEI on i386 Myron Stowe
2012-01-21  2:13 ` [PATCH 2/3] ACPI, APEI: Add RAM mapping support to ACPI Myron Stowe
2012-01-21 15:04   ` Bjorn Helgaas
2012-01-21 20:38     ` Bjorn Helgaas
2012-01-23 18:03     ` Myron Stowe
2012-01-29  0:58     ` Huang Ying
2012-01-29 20:41       ` Bjorn Helgaas
2012-01-30  0:35         ` Huang Ying [this message]
2012-02-06  1:37         ` Huang Ying
2012-01-21  2:13 ` [PATCH 3/3] ACPI: Remove ./drivers/acpi/atomicio.[ch] Myron Stowe
2012-01-21  3:15 ` [PATCH 0/3] ACPI: Re-factor and remove ./drivers/acpi/atomicio.[ch] Huang Ying
  -- strict thread matches above, loose matches on Subject: below --
2012-01-23 15:51 [PATCH 2/3] ACPI, APEI: Add RAM mapping support to ACPI Thomas Renninger
2012-01-23 17:48 ` Myron Stowe
2012-01-23 18:23 ` Luck, Tony
2012-01-29  1:09 ` 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=1327883738.7922.64.camel@yhuang-dev \
    --to=ying.huang@intel.com \
    --cc=bhelgaas@google.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=myron.stowe@redhat.com \
    --cc=rjw@sisk.pl \
    --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).