Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp184829pxf; Wed, 17 Mar 2021 19:31:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfjUH78Zuox0rewl9s/PIHGtg5OrCYsTUQ7i/j4cS923HmoHy68UKX6tPf2MfemoRz789g X-Received: by 2002:a17:906:e84:: with SMTP id p4mr7736134ejf.248.1616034677788; Wed, 17 Mar 2021 19:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616034677; cv=none; d=google.com; s=arc-20160816; b=GRkXmwe68S+6MLdY+3itXsOcbxqzNmuxzbc1FKjeyoFmSfmfLM0cdnKm//FgTEHi1H vB8srEUfBD7IT0vawYOqVMRm4mxnAshKutTgW4ldYgsdtVAeru8Of8u4BpfZx0f1Qh99 zz6A1JiUE73RqxnUdFdMj/Y9iu8deWC021BIZvJwXqcGd3b85iztlpDj7xv5vjzVNgkT yN5cfWYjsF9xVh9O33Z/uoWjrNiX3GylTd6KxNzImja9hD2H8mpHwM52WvIk6oYauIOP sJKthuXRaH4LRDWUPSUWA/PGa/PUvAGftw1swO/S+oBCmZt9P8NJBJQsvUufiscSQqlv BzWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=38EPux8WLt26xqxrWAxB/xY0GDaUXbqSWNm47RiNb3Y=; b=G6+X1YIy+zihPxUv1YrckN+EYXmpCL6siOwZTV/t+fTFPi/BbKzd8pbtIjTSrWiyLO aAp91J1xogyWwCw+kYPtjwYVl3Hhx3xzQ5qdWTtEOqIl0D3xtGdZ5fzlYXVuiqeCzqeU 8LzSvsYqVcjun6SsJtZDcMT0YAP5jkwFAeneWvt1Ou/VG+PWY+i47azvnQh2NoVj0FMJ AAy8AHNgTmlizQIfIHIZOYVNstOwa6VjwJchvVzLK3iemQqx6MIlMzty6D0l9LK+kv8l t/ljtD/XQ9WUGFuPK+W0pU8VELbQoBkM1uILtEneB6za1nP/ExtvpcwUCPLUADyY/4ng YGXQ== ARC-Authentication-Results: i=1; mx.google.com; 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 bi6si528032edb.419.2021.03.17.19.30.37; Wed, 17 Mar 2021 19:31:17 -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; 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 S230226AbhCRC3j (ORCPT + 99 others); Wed, 17 Mar 2021 22:29:39 -0400 Received: from mail.loongson.cn ([114.242.206.163]:59686 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230245AbhCRC3X (ORCPT ); Wed, 17 Mar 2021 22:29:23 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9BxY+X9ulJggeUBAA--.6154S2; Thu, 18 Mar 2021 10:29:17 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH v2] MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again Date: Thu, 18 Mar 2021 10:29:17 +0800 Message-Id: <1616034557-5844-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9BxY+X9ulJggeUBAA--.6154S2 X-Coremail-Antispam: 1UD129KBjvJXoW7Zw4rWFy3KF4xJF13Zw17GFg_yoW8WF47pa nYyasxKr4UWrWDGF1vy3yxuryrJrs7GrWagF4rtF4Fva98ur98Xr4fta13tryUZr4DJ3W3 W34xua47KaykCrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkG14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4U JVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxV WxJr0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2Wl Yx0E2Ix0cI8IcVAFwI0_Jrv_JF1lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbV WUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK 6r4UMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI 0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y 0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxV WUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8 JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x0JUatC7UUU UU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work"), bpf_probe_read{, str}() functions were no longer available on MIPS, so there exist some errors when running bpf program: root@linux:/home/loongson/bcc# python examples/tracing/task_switch.py bpf: Failed to load program: Invalid argument [...] 11: (85) call bpf_probe_read#4 unknown func bpf_probe_read#4 [...] Exception: Failed to load BPF program count_sched: Invalid argument So select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE in arch/mips/Kconfig, otherwise the bpf old helper bpf_probe_read() will not be available. This is similar with the commit d195b1d1d119 ("powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again"). Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") Signed-off-by: Tiezhu Yang --- v2: update the commit message to fix typos found by Sergei Shtylyov, thank you! not longer --> no longer there exists --> there exist arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 160b3a8..4b94ec7 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -6,6 +6,7 @@ config MIPS select ARCH_BINFMT_ELF_STATE if MIPS_FP_SUPPORT select ARCH_HAS_FORTIFY_SOURCE select ARCH_HAS_KCOV + select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_PTE_SPECIAL if !(32BIT && CPU_HAS_RIXI) select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST select ARCH_HAS_UBSAN_SANITIZE_ALL -- 2.1.0