From: santosh.shilimkar@ti•com (Santosh Shilimkar)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] arm/arm64: KVM: introduce new mapping API for percpu mappings
Date: Fri, 15 Nov 2013 10:57:18 -0500 [thread overview]
Message-ID: <5286445E.2090300@ti.com> (raw)
In-Reply-To: <1384530008-18181-1-git-send-email-marc.zyngier@arm.com>
On Friday 15 November 2013 10:40 AM, Marc Zyngier wrote:
> Using virt_to_phys on percpu mappings is horribly wrong (my own bad).
> Thankfully, the kernel offers a way to obtain the physical address
> of such a mapping.
>
> Add a new create_hyp_percpu_mappings function to deal with those.
>
> Reported-by: Santosh Shilimkar <santosh.shilimkar@ti•com>
> Cc: Christoffer Dall <christoffer.dall@linaro•org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm•com>
> ---
> Santosh, can you please give this new patch a spin on your HW?
>
Works except to make guest boot on my machine, phys_addr_t
update is needed as discussed ;-)
>
> arch/arm/include/asm/kvm_mmu.h | 1 +
> arch/arm/kvm/arm.c | 2 +-
> arch/arm/kvm/mmu.c | 32 ++++++++++++++++++++++++++++++++
> arch/arm64/include/asm/kvm_mmu.h | 1 +
> 4 files changed, 35 insertions(+), 1 deletion(-)
>
[..]
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index b0de86b..f2a552b 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -331,6 +331,38 @@ int create_hyp_mappings(void *from, void *to)
> }
>
> /**
> + * create_hyp_percpu_mappings - duplicate a percpu kernel virtual address
> + * range in Hyp mode
> + * @from: The virtual kernel start address of the range
> + * @to: The virtual kernel end address of the range (exclusive)
> + *
> + * The same virtual address as the kernel virtual address is also used
> + * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying
> + * physical pages. It *has* to be a percpu region.
> + */
> +int create_hyp_percpu_mappings(void *from, void *to)
> +{
> + unsigned long phys_addr;
s/unsigned long/phys_addr_t
regards,
Santosh
next prev parent reply other threads:[~2013-11-15 15:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 15:40 [PATCH] arm/arm64: KVM: introduce new mapping API for percpu mappings Marc Zyngier
2013-11-15 15:57 ` Santosh Shilimkar [this message]
2013-11-15 16:10 ` Christoffer Dall
2013-11-15 16:33 ` Marc Zyngier
2013-11-15 16:43 ` Christoffer Dall
2013-11-15 16:59 ` Marc Zyngier
2013-11-15 17:50 ` Christoffer Dall
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=5286445E.2090300@ti.com \
--to=santosh.shilimkar@ti$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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