linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lauraa@codeaurora.org (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC][PATCH] arm64: efi: Obey EFI memory type in dmi_remap
Date: Mon, 19 Jan 2015 15:02:47 -0800	[thread overview]
Message-ID: <54BD8D17.10202@codeaurora.org> (raw)
In-Reply-To: <CAKv+Gu8y428H0QQznV9SqhKNLMf6NVmNw5Lup3LiZYinRVMU-A@mail.gmail.com>

On 1/17/2015 12:24 AM, Ard Biesheuvel wrote:
> On 17 January 2015 at 02:24, Laura Abbott <lauraa@codeaurora.org> wrote:
>> Currently, dmi_remap unconditionally calls ioremap_cache for dmi_remap.
>> The memory that's being remapped may be part of the existing EFI
>> memory map and already remapped as uncached. Remapping as cached can
>> created unexpected behavior so check the physical address against the
>> EFI memory type before remapping.
>>
>
> Mapping the SMBIOS tables as uncached is a bad idea, as 'uncached'
> implies MT_DEVICE_nGnRnE in the arm64 kernel, and the SMBIOS structure
> tables are not guaranteed to be aligned. So you should at least use
> MT_NORMAL_NC here.
>
> Why does it end up mapped uncached in the first place? Is it backed by
> a ROM instead of normal RAM? And does the region have any of the WT/WC
> attributes set in addition to UC? What type is it? I suppose it has
> the EFI_MEMORY_RUNTIME bit set as well? (Note that the spec seems to
> assume that configuration tables always reside in system RAM [UEFI
> spec 2.4A 2.3.6])
>
> Also, with my latest virtmap changes, UEFI runtime regions are only
> mapped during runtime service invocations, and explicitly when e.g.
> the SMBIOS or ACPI layer needs to get at the data. Currently, regions
> backed by system RAM are still covered by the linear mapping as well,
> but that is something we intend to change too. So if the region is not
> system RAM (!EFI_MEMORY_WB), the latest code will not have this region
> mapped at DMI scan time, afaict.
>
> Finally, I have been looking into classifying memory as system RAM or
> not myself[0]. Even if SMBIOS is UEFI only in arm64, I would prefer
> not to add infrastructure that allows us to answer these kind of
> questions only when booted via UEFI.
>
> [0] http://article.gmane.org/gmane.linux.kernel.efi/5133
>
>

Thanks for the feedback. The tables aren't in ROM, they are in external
memory which needs to be accessed by other devices (e.g. BMC) which
necessitates having it marked as uncached without WT/WC attributes.
I think for now we are going to re-evaluate the need for the support
provided by this patch based on the feedback given.

Thanks,
Laura

-- 
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

      parent reply	other threads:[~2015-01-19 23:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-17  2:24 [RFC][PATCH] arm64: efi: Obey EFI memory type in dmi_remap Laura Abbott
2015-01-17  8:24 ` Ard Biesheuvel
2015-01-17 11:56   ` Leif Lindholm
2015-01-17 12:43     ` Ard Biesheuvel
2015-01-17 14:36       ` Leif Lindholm
2015-01-19  9:49         ` Ard Biesheuvel
2015-01-19 12:22           ` Leif Lindholm
2015-01-19 23:02   ` Laura Abbott [this message]

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=54BD8D17.10202@codeaurora.org \
    --to=lauraa@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.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 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).