Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Nicholas Piggin <npiggin@gmail.com>, kvm-ppc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, Nicholas Piggin <npiggin@gmail.com>
Subject: Re: [PATCH v2] KVM: PPC: Book3S HV: Fix reverse map real-mode address lookup with huge vmalloc
Date: Fri, 28 May 2021 23:36:29 +0000	[thread overview]
Message-ID: <87sg26h1mq.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20210526120005.3432222-1-npiggin@gmail.com>

Nicholas Piggin <npiggin@gmail.com> writes:
> real_vmalloc_addr() does not currently work for huge vmalloc, which is
> what the reverse map can be allocated with for radix host, hash guest.
>
> Extract the hugepage aware equivalent from eeh code into a helper, and
> convert existing sites including this one to use it.
>
> Fixes: 8abddd968a30 ("powerpc/64s/radix: Enable huge vmalloc mappings")
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>

I changed the subject to "powerpc: ..." now that it's not just a KVM patch.

...

> diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c
> index 51bbaae94ccc..ddba8761e58c 100644
> --- a/arch/powerpc/kernel/io-workarounds.c
> +++ b/arch/powerpc/kernel/io-workarounds.c
> @@ -65,22 +65,13 @@ struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr)
>  		bus = &iowa_busses[token - 1];
>  	else {
>  		unsigned long vaddr, paddr;
> -		pte_t *ptep;
>  
>  		vaddr = (unsigned long)PCI_FIX_ADDR(addr);
>  		if (vaddr < PHB_IO_BASE || vaddr >= PHB_IO_END)
>  			return NULL;
> -		/*
> -		 * We won't find huge pages here (iomem). Also can't hit
> -		 * a page table free due to init_mm
> -		 */
> -		ptep = find_init_mm_pte(vaddr, &hugepage_shift);
> -		if (ptep = NULL)
> -			paddr = 0;
> -		else {
> -			WARN_ON(hugepage_shift);
> -			paddr = pte_pfn(*ptep) << PAGE_SHIFT;
> -		}
> +
> +		paddr = ppc_find_vmap_phys(vaddr);
> +
>  		bus = iowa_pci_find(vaddr, paddr);
>  
>  		if (bus = NULL)

This needed:

diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c
index ddba8761e58c..c877f074d174 100644
--- a/arch/powerpc/kernel/io-workarounds.c
+++ b/arch/powerpc/kernel/io-workarounds.c
@@ -55,7 +55,6 @@ static struct iowa_bus *iowa_pci_find(unsigned long vaddr, unsigned long paddr)
 #ifdef CONFIG_PPC_INDIRECT_MMIO
 struct iowa_bus *iowa_mem_find_bus(const PCI_IO_ADDR addr)
 {
-	unsigned hugepage_shift;
 	struct iowa_bus *bus;
 	int token;
 

cheers

  reply	other threads:[~2021-05-28 23:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 12:00 [PATCH v2] KVM: PPC: Book3S HV: Fix reverse map real-mode address lookup with huge vmalloc Nicholas Piggin
2021-05-28 23:36 ` Michael Ellerman [this message]
2021-06-06 11:34 ` Michael Ellerman

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=87sg26h1mq.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    /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