linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@loongson.cn>
To: Andrew Morton <akpm@linux-foundation.org>,
	Huacai Chen <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev, linux-mm@kvack.org,
	Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
	Xuerui Wang <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn,
	Huacai Chen <chenhuacai@loongson.cn>
Subject: [PATCH 0/3] Make {virt, phys, page, pfn} translation work with KFENCE for LoongArch
Date: Thu,  4 Apr 2024 21:36:33 +0800	[thread overview]
Message-ID: <20240404133642.971583-1-chenhuacai@loongson.cn> (raw)

On LoongArch kmalloc() range is DMW-mapped rather than TLB-mapped, so
KFENCE remap __kfence_pool to the TLB-mappd range.

To make all drivers work, {virt, phys, page, pfn} translation functions
are overriden (part of them already done, others done in this series):
1, virt_to_pfn()/pfn_to_virt();
2, virt_to_page()/page_to_virt();
3, virt_to_phys()/phys_to_virt().
 
Since LoongArch overrides page_to_virt() which use page_address() in the
KFENCE case (by defining WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL). So move
lowmem_page_address() a little later to avoid such build errors:

error: implicit declaration of function ‘page_address’.

Huacai Chen(3):
 mm: Move lowmem_page_address() a little later.
 LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE
 LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
2.27.0



             reply	other threads:[~2024-04-04 13:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 13:36 Huacai Chen [this message]
2024-04-04 13:36 ` [PATCH 1/3] mm: Move lowmem_page_address() a little later Huacai Chen
2024-04-04 18:25   ` Andrew Morton
2024-04-05  9:21     ` Huacai Chen
2024-04-04 13:36 ` [PATCH 2/3] LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE Huacai Chen
2024-04-04 13:36 ` [PATCH 3/3] LoongArch: Make virt_addr_valid()/__virt_addr_valid() " Huacai Chen

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=20240404133642.971583-1-chenhuacai@loongson.cn \
    --to=chenhuacai@loongson.cn \
    --cc=akpm@linux-foundation.org \
    --cc=chenhuacai@kernel.org \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    /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).