From: Pingfan Liu <kernelfans@gmail.com>
To: Linux ARM <linux-arm-kernel@lists.infradead.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
Kristina Martsenko <kristina.martsenko@arm.com>,
James Morse <james.morse@arm.com>,
Steven Price <steven.price@arm.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Pavel Tatashin <pasha.tatashin@soleen.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
Atish Patra <atish.patra@wdc.com>,
Mike Rapoport <rppt@kernel.org>,
Logan Gunthorpe <logang@deltatee.com>,
Mark Brown <broonie@kernel.org>
Subject: Re: [RFC 8/8] arm64/head: convert idmap_pg_dir and init_pg_dir to __create_pgd_mapping()
Date: Mon, 19 Apr 2021 22:10:57 +0800 [thread overview]
Message-ID: <CAFgQCTt9PONoYVk_tXtt_ZU-FN1OfjA+Ga46aJ_mqfKhfQGTRQ@mail.gmail.com> (raw)
In-Reply-To: <20210410095654.24102-9-kernelfans@gmail.com>
On Sat, Apr 10, 2021 at 5:57 PM Pingfan Liu <kernelfans@gmail.com> wrote:
>
[...]
> /*
> * Map the kernel image (starting with PHYS_OFFSET).
> */
> adrp x0, init_pg_dir
> - mov_q x5, KIMAGE_VADDR // compile time __va(_text)
> - add x5, x5, x23 // add KASLR displacement
> - mov x4, PTRS_PER_PGD
> - adrp x6, _end // runtime __pa(_end)
> - adrp x3, _text // runtime __pa(_text)
> - sub x6, x6, x3 // _end - _text
> - add x6, x6, x5 // runtime __va(_end)
> + adrp x1, init_pg_end
> + sub x1, x1, x0
> + bl set_cur_mempool
>
> - map_memory x0, x1, x5, x6, x7, x3, x4, x10, x11, x12, x13, x14
> + mov x1, PTRS_PER_PGD
> + adrp x3, _text // runtime __pa(_text)
> + mov_q x4, KIMAGE_VADDR // compile time __va(_text)
> + add x4, x4, x23 // add KASLR displacement
> + adrp x5, _end // runtime __pa(_end)
> + sub x5, x5, x3 // _end - _text
> +
> + ldr x3, =PAGE_KERNEL_EXEC
> + adr_l x4, head_pgtable_alloc
> + mov x5, #0
> + mov x6, #NO_FIXMAP
> +
> + bl create_init_pgd_mapping
This calling convention is wrong, should be changed as the following (
will be updated in v2)
adrp x0, init_pg_dir
adrp x1, init_pg_end
sub x1, x1, x0
bl set_cur_mempool
mov x0, #0
mov x0, #0
bl head_pgtable_alloc // x0 is init_pg_dir
adrp x1, _text // runtime __pa(_text)
mov_q x2, KIMAGE_VADDR // compile time __va(_text)
add x2, x2, x23 // add KASLR displacement
adrp x3, _end // runtime __pa(_end)
sub x3, x3, x1 // _end - _text
ldr x4, =PAGE_KERNEL_EXEC
adr_l x5, head_pgtable_alloc
mov x6, #0
mov x7, #(NO_FIXMAP | NO_PRINTK | BOOT_HEAD)
bl create_init_pgd_mapping
Thanks,
Pingfan
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-04-19 14:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-10 9:56 [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes Pingfan Liu
2021-04-10 9:56 ` [RFC 1/8] arm64/mm: split out __create_pgd_mapping() routines Pingfan Liu
2021-04-14 13:19 ` Pingfan Liu
2021-04-10 9:56 ` [RFC 2/8] arm64/mm: change __create_pgd_mapping() prototype to accept nr_entries and introduce create_idmap() Pingfan Liu
2021-04-10 9:56 ` [RFC 3/8] arm64/mm: change __create_pgd_mapping() prototype to accept extra info for allocator Pingfan Liu
2021-04-10 9:56 ` [RFC 4/8] arm64/mm: enable __create_pgd_mapping() to run across different pgtable Pingfan Liu
2021-04-10 9:56 ` [RFC 5/8] arm64/mm: make trans_pgd_idmap_page() use create_idmap() Pingfan Liu
2021-04-10 9:56 ` [RFC 6/8] arm64/mm: introduce pgtable allocator for head Pingfan Liu
2021-04-10 9:56 ` [RFC 7/8] arm64/pgtable-prot.h: reorganize to cope with asm Pingfan Liu
2021-04-10 9:56 ` [RFC 8/8] arm64/head: convert idmap_pg_dir and init_pg_dir to __create_pgd_mapping() Pingfan Liu
2021-04-19 14:10 ` Pingfan Liu [this message]
2021-04-14 14:05 ` [RFC 0/8] use __create_pgd_mapping() to implement idmap and unify codes Pavel Tatashin
2021-04-15 2:14 ` Pingfan Liu
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=CAFgQCTt9PONoYVk_tXtt_ZU-FN1OfjA+Ga46aJ_mqfKhfQGTRQ@mail.gmail.com \
--to=kernelfans@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=anshuman.khandual@arm.com \
--cc=atish.patra@wdc.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=logang@deltatee.com \
--cc=maz@kernel.org \
--cc=pasha.tatashin@soleen.com \
--cc=rppt@kernel.org \
--cc=steven.price@arm.com \
--cc=will@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.