Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp735476rwb; Wed, 26 Jul 2023 01:50:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFZ4hp9ipNXGcE36lmnUwiNpOzLf+5S2cB3dIAFUG+yQu4LeLjZmh+frjt4DXM7BRcXbo41 X-Received: by 2002:a05:6808:158:b0:3a4:ccf:53e8 with SMTP id h24-20020a056808015800b003a40ccf53e8mr1571044oie.29.1690361435021; Wed, 26 Jul 2023 01:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690361434; cv=none; d=google.com; s=arc-20160816; b=TjnmvVtPJ9KBciXl0CqOziDWtGGipyBWuNkBu6OKezDogZg/+sCCgJC9lqbdfoRDqt xYXjz2lQOFiv/OXqcjz5VRLdr9PBOHzoD5LUVQeFQpCEPU/95D0cVvVovBJJY1ECb53Z f0oBqkeUT5/ISLVohVzCAvHzKkPJ1HBo+x4ViBuvH85BDwqieZOV6HULumlhOcJznZ7v JF60FMSYh7W2N22FFpZggHNJZqN5TbrqcvNqFxGlQ3VxOgiqBtSu3RsEB/Cw0p962++Z yBxUxXoLKlktKrOIsinro1SDM9VPGXzDMApe4I7Bct84Kd34gbhxPEcPTktmxgnJ1EPQ A/qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=s6FD60eWx6lDCFNBUNo6xpDIaAowVyX5Zua7tmQynmE=; fh=wapFSAX8S2iDa8683ds9bDrrJ9TH1OsfFQF2Odt9AbY=; b=ZEVWorXTAstwOP0IUfkltzdWs7zZ3KrdQA+utKPEtRBdOw/tQ2NwqSE2Hr20XaWz/N +1wC1eI/mzCU/RvKF6rcg+9rF9VSGsUW5lgtlyNwo7UXpr2ATXN21j465NXxJ+3RxIfN LxX7ZUPyy+GvBVKMmcqgDk55nSon/uKvvNlCZO+xu3wJT+PdmLt4MU4mhxpTCOipUq+z lYt8euAvJl2r4f+lZo4Gl9E/hbyN2HvAKeNO/YICGizkm42ZZz2x2t+hTtrc3dXUmC61 ELI3jITZ3U9kWhz8/b+47JK1pMflivA+H+p3gtYzVM7f/C+mwYwN/rB4Gi3eNW5MA3oL Yu4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=sOFrT84l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b00563e7aacaa1si645811pge.393.2023.07.26.01.50.22; Wed, 26 Jul 2023 01:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=sOFrT84l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232373AbjGZHgQ (ORCPT + 99 others); Wed, 26 Jul 2023 03:36:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232483AbjGZHf0 (ORCPT ); Wed, 26 Jul 2023 03:35:26 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C807230E5; Wed, 26 Jul 2023 00:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1690356834; bh=XcZL0UiYpctgNqxRKPIYWTpapEbyjnHQl0vSOz4L+S8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sOFrT84lpq+9LFYaPO2jYEMW81bGQf13vrHET4eYePr+RwYlbrJSUcH9eaexSChJQ 4wSQirGWca2fWQHRgQJEUVD5B45iQFYUA2hbyUXlbRRpH++ZHJyzMejXyP2QkjprAj Egqz3rcEluWWukUlPtXMQj1BRiwDvlHYga7QDbVw= Received: from [100.100.34.13] (unknown [220.248.53.61]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 2B45D60112; Wed, 26 Jul 2023 15:33:54 +0800 (CST) Message-ID: <504c5fc7-57d3-f36a-b9e7-801d7e40bc60@xen0n.name> Date: Wed, 26 Jul 2023 15:33:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] LoongArch: eBPF: Restrict bpf_probe_read{, str}() only to archs where they work Content-Language: en-US To: zhaochenguang , chenhuacai@kernel.org Cc: loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, bpf@vger.kernel.org References: <20230726062902.566312-1-zhaochenguang@kylinos.cn> From: WANG Xuerui In-Reply-To: <20230726062902.566312-1-zhaochenguang@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/7/26 14:29, zhaochenguang wrote: > When we run nettrace on LoongArch, there is a problem that > ERROR: failed to load kprobe-based eBPF > ERROR: failed to load kprobe-based bpf > > Because ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE dose not exist, > so we enable it. > > The patch reference upstream id 0ebeea8ca8a4d1d453ad299aef0507dab04f6e8d. The description is a bit hard to follow. Rephrasing a bit: "Currently nettrace does not work on LoongArch due to missing bpf_probe_read{,str}() support, with the error message: ERROR: failed to load kprobe-based eBPF ERROR: failed to load kprobe-based bpf According to commit 0ebeea8ca8a4d ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work"), we only need to select CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE to add said support, because LoongArch does have non-overlapping address ranges for kernel and userspace." Also, the patch subject does not make sense. Looking at precedents such as commit 66633abd0642f ("MIPS/bpf: Enable bpf_probe_read{, str}() on MIPS again") and commit d195b1d1d1196 ("powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again"), we can instead re-title the commit as "LoongArch/bpf: Enable bpf_probe_read{, str}() on LoongArch". (No "again" because commit 0ebeea8ca8a4d actually predated the LoongArch port.) > > Signed-off-by: zhaochenguang > --- > arch/loongarch/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig > index 903096bd87f8..4a156875e9cc 100644 > --- a/arch/loongarch/Kconfig > +++ b/arch/loongarch/Kconfig > @@ -11,6 +11,7 @@ config LOONGARCH > select ARCH_ENABLE_MEMORY_HOTREMOVE > select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI > select ARCH_HAS_PTE_SPECIAL > + select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE Please keep the list in alphabetical order by moving this one line above. > select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST > select ARCH_INLINE_READ_LOCK if !PREEMPTION > select ARCH_INLINE_READ_LOCK_BH if !PREEMPTION -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/