From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93916246BCD for ; Sun, 19 Jul 2026 09:31:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.2 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784453485; cv=none; b=c4HOKDsH2ro563zjM9WVXl5TPbRUJs6vc48q+ZG+EU4NcXN5a+0/55ngAPzoQOLXKg7O+RIR9BH5OdRChOvBwRyKMUuBfuFnrs/ne3kp5DMPzyQG/cZ1H6+nTLM2ZSDrYI/Ai0ZyKkD9dGFVZy9ChUdaORL7x+yjdzZZxr6joog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784453485; c=relaxed/simple; bh=MaPT5KqyuWCLXHAHd5KrI95LYvEJFd1Y9trAltKiV2o=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nPmEPq++v+7/JMte9r3KTmV5s9CliPRqLYgICszGmy/uXTcdSjewHL4crdtvR8NQa8E5b2gZvmTGW/bvQr9ZEBcINrBAPFPNQxU0dsVhaMKuUzmbzR69Z1dgxxRizYH2f/8ULAJZU7m1S1L6GEsm/ZWMeFXu3ztMEST3S6f+wKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=jTbAzq+j; arc=none smtp.client-ip=220.197.31.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="jTbAzq+j" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=62 XoSo48bEdF6mCndS9Tdt19X98FGEVyGmooRFe2RUc=; b=jTbAzq+jaAkozG1gL6 VW44x+N7GnEoCQMHqQkG3H0EAE6xeYVeJZFWOW1TfqSAa81afEmC8KTgAKtsKKvO af0mfQ3VbvDN4J1kUdi5nlaNKc2BPyYsY7TwxVCkgRnlWYM4Rhz8u5UaPVDeApu2 lqQwebReoKUlECZbIGQ105SHc= Received: from Ubuntu.. (unknown []) by gzsmtp4 (Coremail) with SMTP id PygvCgCnTyswmVxqbA0SIA--.60699S2; Sun, 19 Jul 2026 17:30:25 +0800 (CST) From: Xiaofeng Yuan To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: Alexandre Ghiti , Nam Cao , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/2] riscv: fix kprobes on minimal kernel configs Date: Sun, 19 Jul 2026 09:30:22 +0000 Message-ID: <20260719093024.33351-1-xiaofengmian@163.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:PygvCgCnTyswmVxqbA0SIA--.60699S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XryDJFy8ur18KFyxKF13twb_yoW3urg_Wr 1xtrySkw48Gayaka4xKw4rGryqkay7uay0kr4jvF9Fgw129wnIk3s5Kas8Aw4jyrWfKrs3 Za93uay3Ar1IqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8BBT5UUUUU== X-CM-SenderInfo: p0ld0w5hqjzxldq6il2tof0z/xtbDAREkJ2pcmTH-CgAA34 When building with an allnoconfig-derived minimal configuration (without CONFIG_STRICT_MODULE_RWX), kprobes fails because instruction slot pages from EXECMEM_KPROBES are read-only and patch_map() bypasses the fixmap writable alias. These two patches fix the infrastructure. v2: - use CONFIG_STRICT_MODULE_RWX instead of CONFIG_ARCH_HAS_EXECMEM_ROX in PATCH 1/2 - add commit description to PATCH 2/2 v3: - simplify PATCH 2/2: early return when !CONFIG_STRICT_MODULE_RWX (suggested by Nam Cao) Xiaofeng Yuan (2): riscv: mm: make EXECMEM_KPROBES writable without CONFIG_STRICT_MODULE_RWX riscv: patch: skip fixmap mapping when kernel text is already writable arch/riscv/kernel/patch.c | 4 ++-- arch/riscv/mm/init.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-)