linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Enze Li <lienze@kylinos.cn>
To: chenhuacai@kernel.org, kernel@xen0n.name,
	loongarch@lists.linux.dev, glider@google.com, elver@google.com,
	akpm@linux-foundation.org, kasan-dev@googlegroups.com,
	linux-mm@kvack.org
Cc: zhangqing@loongson.cn, yangtiezhu@loongson.cn,
	dvyukov@google.com, Enze Li <lienze@kylinos.cn>
Subject: [PATCH 1/4 v3] KFENCE: Defer the assignment of the local variable addr
Date: Tue,  1 Aug 2023 10:58:12 +0800	[thread overview]
Message-ID: <20230801025815.2436293-2-lienze@kylinos.cn> (raw)
In-Reply-To: <20230801025815.2436293-1-lienze@kylinos.cn>

The LoongArch architecture is different from other architectures.
It needs to update __kfence_pool during arch_kfence_init_pool().

This patch modifies the assignment location of the local variable addr
in the kfence_init_pool function to support the case of updating
__kfence_pool in arch_kfence_init_pool().

Signed-off-by: Enze Li <lienze@kylinos.cn>
Acked-by: Marco Elver <elver@google.com>
---
 mm/kfence/core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/kfence/core.c b/mm/kfence/core.c
index dad3c0eb70a0..e124ffff489f 100644
--- a/mm/kfence/core.c
+++ b/mm/kfence/core.c
@@ -566,13 +566,14 @@ static void rcu_guarded_free(struct rcu_head *h)
  */
 static unsigned long kfence_init_pool(void)
 {
-	unsigned long addr = (unsigned long)__kfence_pool;
+	unsigned long addr;
 	struct page *pages;
 	int i;
 
 	if (!arch_kfence_init_pool())
-		return addr;
+		return (unsigned long)__kfence_pool;
 
+	addr = (unsigned long)__kfence_pool;
 	pages = virt_to_page(__kfence_pool);
 
 	/*
-- 
2.34.1



  reply	other threads:[~2023-08-01  3:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-01  2:58 [PATCH 0/4 v3] Add KFENCE support for LoongArch Enze Li
2023-08-01  2:58 ` Enze Li [this message]
2023-08-01  2:58 ` [PATCH 2/4 v3] LoongArch: mm: Add page table mapped mode support Enze Li
2023-08-01  2:58 ` [PATCH 3/4 v3] LoongArch: Get stack without NMI when providing regs parameter Enze Li
2023-08-01  2:58 ` [PATCH 4/4 v3] LoongArch: Add KFENCE support Enze Li
2023-08-02 15:12 ` [PATCH 0/4 v3] Add KFENCE support for LoongArch Huacai Chen
2023-08-03  8:05   ` Enze Li

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=20230801025815.2436293-2-lienze@kylinos.cn \
    --to=lienze@kylinos.cn \
    --cc=akpm@linux-foundation.org \
    --cc=chenhuacai@kernel.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=kernel@xen0n.name \
    --cc=linux-mm@kvack.org \
    --cc=loongarch@lists.linux.dev \
    --cc=yangtiezhu@loongson.cn \
    --cc=zhangqing@loongson.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