Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2738082pxj; Mon, 10 May 2021 09:36:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSnr+k+Ay/Dv9bA8Gx6ydfp69/IVGx6RXin5Isf2Y44tWjyzd7a4qrUrkx+3cbNFGQZKW1 X-Received: by 2002:a92:cec3:: with SMTP id z3mr22133450ilq.179.1620664619813; Mon, 10 May 2021 09:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620664619; cv=none; d=google.com; s=arc-20160816; b=s9uFI3ki26pDMCgRKzgx7PVxQ7C8jbwvftA2u6Qfb9VpTvH92kaJ9qATJwrtkp/SEH xs09MT+IT7aysWrV8yK7/01yJFuuoFsP/zCLr6qg5NDeRWpbxqBwhAY9z47KA2t6D/c5 xsq/wgprQ8DPmpzgybBlDnGh0EkbvFBmOK+5cbDHaL6GdrZ0xk+pJ6nAZqgjTZTk89Ir Y3REAu/vZfOGhnO2P56Xj5kgux94I8/xVdpkizzFHPwXpAAueZ0Xe4xzJll5sTfm5vlM AXMJ2y3AuHUCQLi8JsBzp8ibAIInsthUXm6lUvpOq9U1AIHVTa5gwnSdFpypz3TpY3Uc 3GjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=W35ihF1HmZl897viGKIMEuGvRdzLmwITgJf6gYzR6Qk=; b=yqstz4GzP/d9LwXvwOCejcte2ZkoR7XYxxEvIR8iKczPDJkXyLGIAq5wpdSdRo6a0y 97YxbtjPI6c/zL0ZG4zd+qqq3LVAeMXnTbs2o1pryh167ZpFmhTSvvn1h2Dn1w+aCthf Mfmj49gmebrCCMKJ3AHyGyyprrW042GPBLkaQdu5HiNQSu+5cAqzDXoAQA2DBvwJhzX1 y3Qe4rNZub/fnLdHUkcXjxprCtbKlUaaOnyEMY09OPjPPJXtonkV3QM1ZpkOZtG2a9lC 0P84gRfk86U/n1h6xvqp0GnpYfyhCwVWzAGV1PAn9p1Gp27eSmmyY89SJeW/0YdmZ7Zr rVkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=A6ydf6k2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v1si23231149iof.80.2021.05.10.09.36.47; Mon, 10 May 2021 09:36:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mail.ustc.edu.cn header.s=dkim header.b=A6ydf6k2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mail.ustc.edu.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231791AbhEJQfa (ORCPT + 99 others); Mon, 10 May 2021 12:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231748AbhEJQfP (ORCPT ); Mon, 10 May 2021 12:35:15 -0400 Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7834C06138C for ; Mon, 10 May 2021 09:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ustc.edu.cn; s=dkim; h=Received:Date:From:To:Cc:Subject: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=W35ihF1HmZl897viGKIMEuGvRdzLmwITgJf6gYzR6Qk=; b=A6ydf6k2ZxXA/ mhQldeR0HM+RIIPx8DQvwK54AQtg1yXKodWvvMZiWX2uzr01Kho5FEwymDUAA0J7 5QvYXln7O4CfBK6gizFz1CtSat17QuWbpmx44omLyuKA947iQdB5icXbGc9m/fPp CYDDw0NRtQEGnf1Emi+EYIc7jpXjJk= Received: from xhacker (unknown [101.86.20.15]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygDHzpp5YJlgEbi3AA--.7137S2; Tue, 11 May 2021 00:34:02 +0800 (CST) Date: Tue, 11 May 2021 00:28:38 +0800 From: Jisheng Zhang To: Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: code patching only works on !XIP_KERNEL Message-ID: <20210511002838.7b3cb1e7@xhacker> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CM-TRANSID: LkAmygDHzpp5YJlgEbi3AA--.7137S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KFy3GF4xZw45JF4DJrW5ZFb_yoW5Jr1Dpr naya47XFZrXr4ruw4YkFy8Ww45ZFZ7XFWfJryrGa48ArW0yrWqyr1j9r1UG34UXr93Ww1f WFyrG34UCr4qywUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUy2b7Iv0xC_KF4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVWxJVW8Jr1l84ACjcxK6I 8E87Iv6xkF7I0E14v26r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxAIw28IcxkI7VAKI48JMxC20s02 6xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_Jr I_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v2 6r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj4 0_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j 6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jOb18UUUUU= X-CM-SenderInfo: xmv2xttqjtqzxdloh3xvwfhvlgxou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jisheng Zhang Some features which need code patching such as KPROBES, DYNAMIC_FTRACE KGDB can only work on !XIP_KERNEL. Add dependencies for these features that rely on code patching. Signed-off-by: Jisheng Zhang --- Hi, Currently, the RISCV_ERRATA_ALTERNATIVE also only works on !XIP_KERNEL but from the maillist it seem there's effort to make the co-exist, so I drop RISCV_ERRATA_ALTERNATIVE dependency on !XIP_KERNEL. Thanks arch/riscv/Kconfig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index a8ad8eb76120..61320b94ef97 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -60,11 +60,11 @@ config RISCV select GENERIC_TIME_VSYSCALL if MMU && 64BIT select HANDLE_DOMAIN_IRQ select HAVE_ARCH_AUDITSYSCALL - select HAVE_ARCH_JUMP_LABEL - select HAVE_ARCH_JUMP_LABEL_RELATIVE + select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL + select HAVE_ARCH_JUMP_LABEL_RELATIVE if !XIP_KERNEL select HAVE_ARCH_KASAN if MMU && 64BIT select HAVE_ARCH_KASAN_VMALLOC if MMU && 64BIT - select HAVE_ARCH_KGDB + select HAVE_ARCH_KGDB if !XIP_KERNEL select HAVE_ARCH_KGDB_QXFER_PKT select HAVE_ARCH_MMAP_RND_BITS if MMU select HAVE_ARCH_SECCOMP_FILTER @@ -79,9 +79,9 @@ config RISCV select HAVE_GCC_PLUGINS select HAVE_GENERIC_VDSO if MMU && 64BIT select HAVE_IRQ_TIME_ACCOUNTING - select HAVE_KPROBES - select HAVE_KPROBES_ON_FTRACE - select HAVE_KRETPROBES + select HAVE_KPROBES if !XIP_KERNEL + select HAVE_KPROBES_ON_FTRACE if !XIP_KERNEL + select HAVE_KRETPROBES if !XIP_KERNEL select HAVE_PCI select HAVE_PERF_EVENTS select HAVE_PERF_REGS @@ -230,11 +230,11 @@ config ARCH_RV64I bool "RV64I" select 64BIT select ARCH_SUPPORTS_INT128 if CC_HAS_INT128 && GCC_VERSION >= 50000 - select HAVE_DYNAMIC_FTRACE if MMU && $(cc-option,-fpatchable-function-entry=8) + select HAVE_DYNAMIC_FTRACE if !XIP_KERNEL && MMU && $(cc-option,-fpatchable-function-entry=8) select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE - select HAVE_FTRACE_MCOUNT_RECORD + select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL select HAVE_FUNCTION_GRAPH_TRACER - select HAVE_FUNCTION_TRACER + select HAVE_FUNCTION_TRACER if !XIP_KERNEL select SWIOTLB if MMU endchoice -- 2.31.0