mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dylan Jhong <dylan@andestech.com>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	Lorenzo Stoakes <lstoakes@gmail.com>, <linux-mm@kvack.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -fixes] mm: Add a call to flush_cache_vmap() in vmap_pfn()
Date: Thu, 10 Aug 2023 16:43:29 +0800	[thread overview]
Message-ID: <ZNSjMUb5pzZu66i5@atctrx.andestech.com> (raw)
In-Reply-To: <20230809164633.1556126-1-alexghiti@rivosinc.com>

On Wed, Aug 09, 2023 at 06:46:33PM +0200, Alexandre Ghiti wrote:
> flush_cache_vmap() must be called after new vmalloc mappings are
> installed in the page table in order to allow architectures to make sure
> the new mapping is visible.
> 
> Fixes: 3e9a9e256b1e ("mm: add a vmap_pfn function")
> Reported-by: Dylan Jhong <dylan@andestech.com>
> Closes: https://lore.kernel.org/linux-riscv/ZMytNY2J8iyjbPPy@atctrx.andestech.com/
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
>  mm/vmalloc.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 93cf99aba335..228a4a5312f2 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2979,6 +2979,10 @@ void *vmap_pfn(unsigned long *pfns, unsigned int count, pgprot_t prot)
>  		free_vm_area(area);
>  		return NULL;
>  	}
> +
> +	flush_cache_vmap((unsigned long)area->addr,
> +			 (unsigned long)area->addr + count * PAGE_SIZE);
> +
>  	return area->addr;
>  }
>  EXPORT_SYMBOL_GPL(vmap_pfn);
> -- 
> 2.39.2
> 

Hi Alex,

Looks good to me. Thanks.
Reviewed-by: Dylan Jhong <dylan@andestech.com>

Best regards,
Dylan Jhong


      parent reply	other threads:[~2023-08-10  8:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 16:46 Alexandre Ghiti
2023-08-09 18:46 ` Andrew Morton
2023-08-10  7:15   ` Alexandre Ghiti
2023-08-09 22:25 ` Christoph Hellwig
2023-08-10 15:13   ` Palmer Dabbelt
2023-08-10 15:58     ` Palmer Dabbelt
2023-08-10  8:43 ` Dylan Jhong [this message]

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=ZNSjMUb5pzZu66i5@atctrx.andestech.com \
    --to=dylan@andestech.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexghiti@rivosinc.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lstoakes@gmail.com \
    --cc=urezki@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

all inboxes | Powered by JetHome®