Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2817111pxj; Mon, 10 May 2021 11:21:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAmgnMSes6TVkTHjK072aT8vFK3SYKdDXYipSfp2p2W9VenaGEl1vbFw3AmdLsXmNKGD0p X-Received: by 2002:a6b:7b0b:: with SMTP id l11mr19489112iop.28.1620670905840; Mon, 10 May 2021 11:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620670905; cv=none; d=google.com; s=arc-20160816; b=G10ozvyR+cb7/8PQfwKn6aDO6Ajcr89LADa/ygPtoGrJwE631yg47HW2bMsQb/aHxl JyO/xmZjUI3lP9Nd7pxqDke5+vNA2Qw0wJvs8FK0Fg01iEFWltGRkyM3hZGUA7KeGiTG LJGxyKUY+qdcmKDdt7SKciBSHvtoQiVpkJlh6l+zsxaok7ll3X/5Rc3W3OzR4tM1/gh0 CmofR7dEURvMzTj+jkiTlYJ/JJNBP26Rb/dR+wbALRRAXaVxhjnIcYghmagFa7R3jVBc Fra1Md9EZPjOqDt1XAP3lCx7ldySTfji5rFR9/DOKAmcN8xJ3Ib3ZMzIxBTYcK2oIrPV 66Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=uLEPdHE/lUDqSfzKgjlnQIQkgZHfxgrF+vujnKkyTIM=; b=KzJMhrKvjEyhT9V0oZBxN5ucuImWdRo4zi1joWtMdxTDLsuJsYMeIk0Lul+jVdeypU 7U5B4B5du8dmwOom5F/EGUviW/vrBSH/CdyFHhoz6QHqY3FQDMiBn13KjXDNPErjHfs0 yg9320bbWLlWbNCaFP749WH+Mrsna3Kce6tZcWsSuGKX/uMZt6pHvDapiQFBEC3mUQcg 4bo7arsk6bUNesovLib6UbIrRdyQ1zngHA9aJMQ/8u3RfhjIcYTUO1U8hqV2+Vo9cT2p NHdhgUs4hZcwZuxVZ6jhmpcCC9x8epCsKPFDUfr2sxljIPyvR625+UcbcdJ8J3cJmgA5 19Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=cS3HdG81; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m18si223926jaj.112.2021.05.10.11.21.33; Mon, 10 May 2021 11:21:45 -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=@konsulko.com header.s=google header.b=cS3HdG81; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbhEJSUs (ORCPT + 99 others); Mon, 10 May 2021 14:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231218AbhEJSUs (ORCPT ); Mon, 10 May 2021 14:20:48 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D63C061574 for ; Mon, 10 May 2021 11:19:42 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id j10so24733163lfb.12 for ; Mon, 10 May 2021 11:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uLEPdHE/lUDqSfzKgjlnQIQkgZHfxgrF+vujnKkyTIM=; b=cS3HdG8156DCaEKIJ+gTF1weCypb9gV1HaJjmr1Aqq0coGamkyOxKt3YpLZLmcRAOi zAKb2gl2KQnO+XP/itg7MwOmO/ebuGOZ044jSVLRZfBrIqC2t2jleOBLqT7xmc0Wc9B4 C6CFtQrFxWqJ0cwLcve8MBErb+lO0oE+VQu4U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uLEPdHE/lUDqSfzKgjlnQIQkgZHfxgrF+vujnKkyTIM=; b=rcvu17bvn36QvzezjELIM51pZG5lB2joVicDmY0OjvGdmwMr+jZzDalvjuLOQ7qGF2 z9dAOSbxumr0vAmZUb9imiJy5LFQgTfW37GLN6nAirp9Hsn4trD6w03BnhHP+L6lDzu1 XX94839O/Wz8MlTlHs61iYt1t8T3VylO8arRwFjMTh0NVBpIiF1uZ/m6E8WviWwe9xio hcNfYg+sBcZbhD4KrfjVXESr3LytBH1yl3W5nsjP/k2lsYsIEg8rO4ZzSvGPHyiRCI0C Icq4Fp/9Bg8hBziVTtUp9EsH8WdvX+FAcKad1G/s2kXxl8EFapCxEe4klFrKB8AbjnsR f/cw== X-Gm-Message-State: AOAM5329WK5J9sgd9bkEeaQGRx9w/HO9lqaIe3wVZnSA7Zj2wBT86pos /cFhT2aNFUbNy8xfGqtYQPGB1+/ArnAwNzvd3Hic6A== X-Received: by 2002:ac2:5a07:: with SMTP id q7mr3615365lfn.407.1620670781305; Mon, 10 May 2021 11:19:41 -0700 (PDT) MIME-Version: 1.0 References: <20210511002838.7b3cb1e7@xhacker> In-Reply-To: <20210511002838.7b3cb1e7@xhacker> From: Vitaly Wool Date: Mon, 10 May 2021 20:19:30 +0200 Message-ID: Subject: Re: [PATCH] riscv: code patching only works on !XIP_KERNEL To: Jisheng Zhang Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 6:35 PM Jisheng Zhang wrote: > > 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. Since we can define extra RW sections to place some tiny code bits in RAM, I would suggest that you hold back this patch for a while. I am not going to support the idea of e. g. compiling KGDB support into a XIP kernel, but disabling the whole HAVE_ARCH_JUMP_LABEL is hardly the way to go. Best regards, Vitaly > 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 > > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv