linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] ARM: kvm: Use virt_to_idmap instead of virt_to_phys for idmap mappings
Date: Fri, 15 Nov 2013 00:12:42 +0000	[thread overview]
Message-ID: <20131115001242.GD20516@lvm> (raw)
In-Reply-To: <1384457866-16135-3-git-send-email-santosh.shilimkar@ti.com>

On Thu, Nov 14, 2013 at 02:37:42PM -0500, Santosh Shilimkar wrote:
> KVM initialisation fails on architectures implementing virt_to_idmap() because
> virt_to_phys() on such architectures won't fetch you the correct idmap page.
> 
> So update the KVM ARM code to use the virt_to_idmap() to fix the issue.
> 
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> 
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
> ---
>  arch/arm/kvm/mmu.c |    9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index b0de86b..3bd652f 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -747,9 +747,9 @@ int kvm_mmu_init(void)
>  {
>  	int err;
>  
> -	hyp_idmap_start = virt_to_phys(__hyp_idmap_text_start);
> -	hyp_idmap_end = virt_to_phys(__hyp_idmap_text_end);
> -	hyp_idmap_vector = virt_to_phys(__kvm_hyp_init);
> +	hyp_idmap_start = virt_to_idmap(__hyp_idmap_text_start);
> +	hyp_idmap_end = virt_to_idmap(__hyp_idmap_text_end);
> +	hyp_idmap_vector = virt_to_idmap(__kvm_hyp_init);
>  
>  	if ((hyp_idmap_start ^ hyp_idmap_end) & PAGE_MASK) {
>  		/*
> @@ -775,8 +775,7 @@ int kvm_mmu_init(void)
>  		 * caches off at that point.
>  		 */
>  		kvm_flush_dcache_to_poc(init_bounce_page, len);
> -
> -		phys_base = virt_to_phys(init_bounce_page);
> +		phys_base = virt_to_idmap(init_bounce_page);
>  		hyp_idmap_vector += phys_base - hyp_idmap_start;
>  		hyp_idmap_start = phys_base;
>  		hyp_idmap_end = phys_base + len;
> -- 
> 1.7.9.5
> 
Looks good to me.

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>

  reply	other threads:[~2013-11-15  0:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 19:37 [PATCH 0/6] ARM/AMR64: Few patches on kvm and mm code Santosh Shilimkar
2013-11-14 19:37 ` [PATCH 1/6] arm64: mm: Add __virt_to_idmap() to keep kvm build happy Santosh Shilimkar
2013-11-15 13:34   ` Catalin Marinas
2013-11-15 14:55     ` Santosh Shilimkar
2013-11-15 14:58       ` Catalin Marinas
2013-11-15 15:31         ` Santosh Shilimkar
2013-11-15 15:05   ` Marc Zyngier
2013-11-15 15:25     ` Santosh Shilimkar
2013-11-15 15:29       ` Marc Zyngier
2013-11-15 15:31         ` Catalin Marinas
2013-11-15 15:33           ` Santosh Shilimkar
2013-11-14 19:37 ` [PATCH 2/6] ARM: kvm: Use virt_to_idmap instead of virt_to_phys for idmap mappings Santosh Shilimkar
2013-11-15  0:12   ` Christoffer Dall [this message]
2013-11-14 19:37 ` [PATCH 3/6] ARM: mm: Drop the lowmem watermark check from virt_addr_valid() Santosh Shilimkar
2013-11-15  0:22   ` Christoffer Dall
2013-11-15  0:31     ` Santosh Shilimkar
2013-11-15  0:40       ` Christoffer Dall
2013-11-15 11:48         ` Marc Zyngier
2013-11-15 11:43     ` Marc Zyngier
2013-11-15 14:55       ` Santosh Shilimkar
2013-11-15 15:08         ` Marc Zyngier
2013-11-15 15:46           ` Christoffer Dall
2013-11-15 14:20   ` Russell King - ARM Linux
2013-11-15 15:40     ` Santosh Shilimkar
2013-11-14 19:37 ` [PATCH 4/6] arm64: " Santosh Shilimkar
2013-11-15 13:39   ` Catalin Marinas
2013-11-15 14:25     ` Marc Zyngier
2013-11-15 14:57       ` Santosh Shilimkar
2013-11-14 19:37 ` [PATCH 5/6] ARM: kvm: Use phys_addr_t instead of unsigned long in mm code Santosh Shilimkar
2013-11-15  0:09   ` Christoffer Dall
2013-11-15  0:10     ` Santosh Shilimkar
2013-11-15 11:58   ` Marc Zyngier
2013-11-14 19:37 ` [PATCH 6/6] ARM: kvm: TMP: Commit the hyp page tables to main memory Santosh Shilimkar
2013-11-14 22:36   ` Santosh Shilimkar
2013-11-15  0:11   ` Christoffer Dall
2013-11-15  0:15     ` Santosh Shilimkar
2013-11-15  0:27       ` Christoffer Dall
2013-11-15  0:36         ` Santosh Shilimkar
2013-11-15  0:42           ` Christoffer Dall
2013-11-15  1:19             ` Santosh Shilimkar
2013-11-15  1:35               ` 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=20131115001242.GD20516@lvm \
    --to=christoffer.dall@linaro.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).