From: Stefan Agner <stefan@agner.ch>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Mark Salter <msalter@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
Laura Abbott <lauraa@codeaurora.org>,
Arnd Bergmann <arnd@arndb.de>,
Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v3] ARM: early fixmap support for earlycon
Date: Sat, 06 Jun 2015 15:29:02 +0200 [thread overview]
Message-ID: <25ac891cd5876d4141e03317bf0d4173@agner.ch> (raw)
In-Reply-To: <20150606124800.GR7557@n2100.arm.linux.org.uk>
On 2015-06-06 14:48, Russell King - ARM Linux wrote:
> On Sat, Jun 06, 2015 at 02:31:28PM +0200, Stefan Agner wrote:
<snip>
>> --- a/arch/arm/include/asm/fixmap.h
>> +++ b/arch/arm/include/asm/fixmap.h
>> @@ -6,9 +6,13 @@
>> #define FIXADDR_TOP (FIXADDR_END - PAGE_SIZE)
>>
>> #include <asm/kmap_types.h>
>> +#include <asm/pgtable.h>
>>
>> enum fixed_addresses {
>> - FIX_KMAP_BEGIN,
>> + FIX_EARLYCON_MEM_BASE,
>> + __end_of_permanent_fixed_addresses,
>> +
>> + FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
>> FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1,
>>
>> /* Support writing RO kernel text via kprobes, jump labels, etc. */
>> @@ -18,7 +22,14 @@ enum fixed_addresses {
>> __end_of_fixed_addresses
>> };
>>
>> +#define FIXMAP_PAGE_COMMON (L_PTE_YOUNG | L_PTE_PRESENT | L_PTE_XN | L_PTE_DIRTY)
>> +
>> +#define FIXMAP_PAGE_NORMAL (FIXMAP_PAGE_COMMON | L_PTE_MT_WRITEBACK)
>> +#define FIXMAP_PAGE_IO (FIXMAP_PAGE_COMMON | L_PTE_MT_DEV_SHARED | L_PTE_SHARED)
>> +#define FIXMAP_PAGE_NOCACHE FIXMAP_PAGE_IO
>
> I'm really not happy with this. What are the expected semantics of the
> set_fixmap_nocache() and set_fixmap_offset_nocache() ? Are they there
> for mapping a device, or are they there for mapping _memory_ ?
>
> I would prefer that FIXMAP_PAGE_NOCACHE is _not_ provided until the
> semantics of that can be clarified, as there is a difference between the
> two on ARM.
set_fixmap_nocache is used for PCIe and IO APIC stuff, so actually IO
devices. However, as far as I understand the x86 page table definitions
in pgtable_types.h, IO devices are not explicitly uncached on x86. The
define set_fixmap_nocache make sure IO devices are mapped uncached...
Maybe set_fixmap_io_nocache instead of set_fixmap_nocache would be more
appropriate...?
Maybe the initial authors of the common fixmap.h have a more clear
understanding of the expected semantics, Mark?
Since the focus currently is on set_fixmap_io, we could define
FIXMAP_PAGE_IO only for the time being...?
Agreed to the rest, will apply the review in v4.
--
Stefan
next prev parent reply other threads:[~2015-06-06 13:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-06 12:31 Stefan Agner
2015-06-06 12:48 ` Russell King - ARM Linux
2015-06-06 13:29 ` Stefan Agner [this message]
2015-06-06 15:29 ` Rob Herring
2015-06-08 14:05 ` Mark Salter
2015-07-10 11:25 ` Russell King - ARM Linux
2015-07-13 19:48 ` Stefan Agner
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=25ac891cd5876d4141e03317bf0d4173@agner.ch \
--to=stefan@agner.ch \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=keescook@chromium.org \
--cc=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=msalter@redhat.com \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®