From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) (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 117FA2E888A for ; Sun, 19 Jul 2026 08:11:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784448711; cv=none; b=OLeEWG8M2eFr97VBitqfKs2SEZDJvUpISxgJTUSQIUNtAWJLU6AP7t2PuWaUoktYpGiuemxbShTCUPWwJxS7xyxVmGiFlXTiWh2BKSF7BifiWevcH/mYY2/SHTWB9lz2zmnXHXFJcjh1Yeei28WmGOJlWvY7FcPiHaUlZOeMHrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784448711; c=relaxed/simple; bh=n/v1P0uzthTf83bSHozh8vE41HQnBKLXMH1mfNdYO6U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NaJ1TRfcu42gexFao4ik4GJ9U1QZc9MUXplBmcF/N4SmecrPwMDZUC9eGOsQ/Yd0mSdCFhfZa0WfEwYHEp5a2Tf2quVjpTXELZ1ixdMkliqP9N0bQDPbBzU8JYngY4GH58dO1xS6rntRbopxnSWfwH6bLQylCHa940MIu49L/2o= 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=TWRouIRH; arc=none smtp.client-ip=117.135.210.3 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="TWRouIRH" 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=jZ Moaj6iXtsIsiavVwALtLTmgKmKM6rTa+1phtopYkY=; b=TWRouIRHkCiMvzj1Nl V8pIshbWBv41R1PKB1+gep8WhUOhWc0+WKiesKjQHIhWlMxZCS6RrM+WvQn4y9d+ iue4S6I6rcutWMd5SZ8qyCB+xB9Z4Eig7jMK0jKqewf3wvE8w/dg2sataAwhJ+Ne ox7W5Co1+F+mue16VlDfDtCSk= Received: from Ubuntu.. (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wC3z6F9hlxq+TAUKA--.58193S2; Sun, 19 Jul 2026 16:10:38 +0800 (CST) From: Xiaofeng Yuan To: pjw@kernel.org Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu, namcao@linutronix.de, alex@ghiti.fr, broonie@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/2] riscv: fix kprobes on minimal kernel configs Date: Sun, 19 Jul 2026 08:10:34 +0000 Message-ID: <20260719081037.5749-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:_____wC3z6F9hlxq+TAUKA--.58193S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7XryDJFy8ur18KFyxKF13twb_yoWxuwc_Ww 1Sqryagw48Wa9IgF1I9ws5Xryqkay7Way8Ar4jvF9Fgw1a93sxA3sYgF98Aa1qyrWFkrs3 Za95ZFZ3Ar4IqjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU8y5l5UUUUU== X-CM-SenderInfo: p0ld0w5hqjzxldq6il2tof0z/xtbDAR5ydWpchn5CfgAA3q 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 (per Nam Cao's review) 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 | 3 ++- arch/riscv/mm/init.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)