From patchwork Tue Jul 23 00:13:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Ambardar X-Patchwork-Id: 13739245 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 934DE7F; Tue, 23 Jul 2024 00:14:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721693653; cv=none; b=M+UPrBuW/TqSC2aMJOtbIk4ic+UMcAPp54kLKdADvCMdT8KMpqA7ZySRsIUhBGky2Cnpq4Do+WZVsekU4WSD12DWkjO9SBnPmbbr3MphaEZuGaYsaQN+5NFthpbWF7xbpQQtB7KIC0r33toT8VRj0KfMxOazf2K7murLduehbSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721693653; c=relaxed/simple; bh=fMIiiwF/8KT3Ihu31SNEhh7KgE/wOF47oWGWKBl/gRo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QkOxTIEw0CihP+U3tTGwfiHwuGX8J5VzZnYnCewytWBUk6/P6ypc/RddoLes62DzqO+/Thy0ObBNCdsZPkflOS4W8kkm+TW77x4oQWVcW+Sm8bWzjKS99Ymb2rMQPVwW1Br8UmrH4/Z4ySl8xl2+2wsgIF/mX9ryfE/vTqAwqDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PP4eX+D8; arc=none smtp.client-ip=209.85.214.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PP4eX+D8" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1fd70ba6a15so830175ad.0; Mon, 22 Jul 2024 17:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721693650; x=1722298450; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CZxO5Yffej+v0UdKyiQJxUeNLy7cx3lHnIrlCNqVQQg=; b=PP4eX+D8+C/+THfYX0aCywMEqde/AzrQDJdrmx3FdqUG5f83E96OU2NjQgNWX9JaZu 7hB9VQmmrWHc3MwAxRcp0QIVHqF66XMG9OUw9wep1jBasUFDwV0pqM//O8WTT0vggTIh 92mVoCLVB8gkOa5XjsrOKI5t8U1cpCJLBCoTs3WNyIp+qiie0MrNstVtOTUBRWuzxw9a /ZRk7W/GGjbI6m7/w+FoovUV+Nm0oGWGG7i+WCZW4Py7iDDnV/w8d89V1tJRsiDMTTBO 7Gtufg1Jw6ehKoDvUB7mcLYdPnODedEL2tjHqBhEIER8beAJsXxYghywbchOVVjh55OU NOaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721693650; x=1722298450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CZxO5Yffej+v0UdKyiQJxUeNLy7cx3lHnIrlCNqVQQg=; b=G278+cQbdpsnsIvzFzrNCD7/mVXB6E5FcuPbfKcYyWVWL0uMCw1lZu8A6yMDbt7APh FKnPcAFJnGePZ9n6QLkfETzizAkhs5EpCYM8+uiUZNxASk9JRzrtXmojIHaDw/ZM/tXE 4+f0zY2NQHvbuBXU7jnuezvTTX4kXt2dqcvqq1GlF/3Yow/r2thLTEIqcaSnU1/R30EV kOi2aec1ZBvCU0IFCq3g6vzsp/GLGYGDNrFyfWgee84cbrwnWYNht0qW9gUVY4cTg8iO Ds7VY5mGu+dIe+HTo8sP9DBUdqdhLTsKBqMd/Iitpwf7bc9UrZkmjlCo1kPP6QPX6ZbU bh7Q== X-Forwarded-Encrypted: i=1; AJvYcCXLhFR0tu/ezO/bFNZx+gMqfnHb3CXEPRKFGNOKctvauyNyW+PQaFMzZ3vhcTpYwYaKU5oymg2YR835Hu04FYnt0/9j8WHYs2TRSjS7UD2o X-Gm-Message-State: AOJu0YxuCZPz4BW7WWE9T2rbxKPcsV8H+j/TqB7+Rng2toMYfcv3aWdq yP6L95EZ3uOLRaro9sbZhZ/On+gCXJHYoXq1CNxNSNFnPrszwfEHjjlR3qxm X-Google-Smtp-Source: AGHT+IGckL46kThmGU9G72fGyTEz03NVp4yK/A1c77+f32LG26KsAgwky7f+lBYZduliDiNlhu0PZQ== X-Received: by 2002:a17:902:da8b:b0:1fd:6b87:2154 with SMTP id d9443c01a7336-1fd7455e313mr58015465ad.27.1721693649842; Mon, 22 Jul 2024 17:14:09 -0700 (PDT) Received: from localhost.localdomain (69-172-146-21.cable.teksavvy.com. [69.172.146.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f48e7c4sm61395485ad.307.2024.07.22.17.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 17:14:09 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: bpf@vger.kernel.org Cc: Tony Ambardar , linux-kselftest@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan Subject: [PATCH bpf-next v2 1/2] selftests/bpf: Add missing system defines for mips Date: Mon, 22 Jul 2024 17:13:28 -0700 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Tony Ambardar Update get_sys_includes in Makefile with missing MIPS-related definitions to fix many, many compilation errors building selftests/bpf. The following added defines drive conditional logic in system headers for word-size and endianness selection: MIPSEL, MIPSEB _MIPS_SZPTR _MIPS_SZLONG _MIPS_SIM, _ABIO32, _ABIN32, _ABI64 Signed-off-by: Tony Ambardar --- tools/testing/selftests/bpf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 3b638069446d..11fdf126cb7c 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -396,7 +396,8 @@ define get_sys_includes $(shell $(1) $(2) -v -E - &1 \ | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \ $(shell $(1) $(2) -dM -E - X-Patchwork-Id: 13739244 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76F6D367; Tue, 23 Jul 2024 00:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721693652; cv=none; b=TzB8BCTo2Av1vioGu8lyhZAFj+vGmvQHL8/ZHPZIATCuX89sblvNKzL76F30TBL0avz6mxcU7Hegkj/whWWZwDVnCVnWVvImWOcc28QAYv5f0r57sA6uuOFzKRVqtr4NAbIA9Qlcv4cr0bQg8jJkvoa7r3mNNfgmuS1Wb5YtYCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721693652; c=relaxed/simple; bh=yNqvLkLdmItRNrlqWRMJ9OQAo/hWme8VonLmIuj9wck=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mSKCCff/Y6+utmIAw5SFvD/i5nmM04n2aQsIwc+FVr7+Tz9+3hKwXB8+7w/e+zm5pyGZ6Ye9f+V3Qo84wqpbo44cM3EPorPlJV70TTXv3n20ThACyc8AC+GTzSBa/cr+RZC2Tx2cb+k4ff5vzYC0gSpg3+e58IuxoeEB6UZUpiU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OaJQswgR; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OaJQswgR" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1fc5239faebso802675ad.1; Mon, 22 Jul 2024 17:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721693651; x=1722298451; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uZ5wt8LPl1ED8SmV39RI+AxdKFeRoDjRtT2DxDCCHdI=; b=OaJQswgRuQCgPFdBnaNSYwjzasuFbHw1K2iyUoCzAlkUcaiZ4geinVpSrsva3bckSh 7kmK8CwPOcK0Osli6RXhWeaQqpw53cGhmA4NDFxARlMB5dmCDF7GO/NKW5gmCe7sIudA pOE79xUj58FegJIU6OsNDH95GAMF6+xlh0TyhcO9QEljEJySrHQmR9kbK1Zi8L+yg0b/ 85npTIFApiFBSJsnR57ghAAEHZ7+md3wm2KEfAFv8t64c5d9mP7VLb29vSjDZG+VWXUd wQOW6h4z2xnwIl/XWp9lrsWow8rwqnlushmQ9FhmO9ggRwlQLl3nYbvocsy9N9emUALu 4eQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721693651; x=1722298451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uZ5wt8LPl1ED8SmV39RI+AxdKFeRoDjRtT2DxDCCHdI=; b=Fo5PhoVAw0gl/22la9ZX9Mp8aL2bAONspQIaQV3vjTo8r+c06Ba36LU0fBV7/LYdHe WobZScLdXF2WvexkMFVGrBVXc9W5mId43lMewwAgeFQwWzsDYKayqZv0Te081473Xx0S 3Oo6tchnYvt3Yprwv7+HtQmHOOO61LTixbIkd3zTBr8zCsXtM8upH/X0x6eNn4noAEQT 7U5Ztv9R+8Kq2H7NsZ7uRx50+XfleZZg74XYuQe0zgKQKgfQmSvq42/163ON2BG9+9F3 QRHrAZtvdXMesZV2cVPuPnMt3UUBc3DQAopFDZANRsYLdtBPvCtRRCRNoL1yZdUizSa+ LISw== X-Forwarded-Encrypted: i=1; AJvYcCW0jtnXfpf5tTNdyw50zi1AyYJMhP9Vpv2Uwov37MKfk8NjuROZ74+0XpZKT/HPX3YeoSfRPkIgiV4ENJZB/EkzTv5/dHKDcn7ahSp1NvN1 X-Gm-Message-State: AOJu0YzPUaNscIMM6OrKltm3DZgu+t22B78FgUaGWOHhCjLzradzrdO4 4CATDvpUYSZPJIy/XXck2oLXqbXM1iFHmpwn2OUL+0VlxEK6IsNzYudEZ/G2 X-Google-Smtp-Source: AGHT+IHrOJFzXzmwYP6gm0u+D7NVm/ke4XvWTtjIvETGp7oJlN/edpQaCQuA5A1x/OKNnrnGGjzq7g== X-Received: by 2002:a17:902:ea0b:b0:1fb:82f5:6641 with SMTP id d9443c01a7336-1fd7455cae3mr75992595ad.23.1721693650636; Mon, 22 Jul 2024 17:14:10 -0700 (PDT) Received: from localhost.localdomain (69-172-146-21.cable.teksavvy.com. [69.172.146.21]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fd6f48e7c4sm61395485ad.307.2024.07.22.17.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 17:14:10 -0700 (PDT) From: Tony Ambardar X-Google-Original-From: Tony Ambardar To: bpf@vger.kernel.org Cc: Tony Ambardar , linux-kselftest@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan Subject: [PATCH bpf-next v2 2/2] selftests/bpf: Fix error linking uprobe_multi on mips Date: Mon, 22 Jul 2024 17:13:29 -0700 Message-Id: <14eb7b70f8ccef9834874d75eb373cb9292129da.1721692479.git.tony.ambardar@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Tony Ambardar Linking uprobe_multi.c on mips64el fails due to relocation overflows, when the GOT entries required exceeds the default maximum. Add a specific CFLAGS (-mxgot) for uprobe_multi.c on MIPS that allows using a larger GOT and avoids errors such as: /tmp/ccBTNQzv.o: in function `bench': uprobe_multi.c:49:(.text+0x1d7720): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08188' uprobe_multi.c:49:(.text+0x1d7730): relocation truncated to fit: R_MIPS_GOT_DISP against `uprobe_multi_func_08189' ... collect2: error: ld returned 1 exit status Fixes: 519dfeaf5119 ("selftests/bpf: Add uprobe_multi test program") Signed-off-by: Tony Ambardar --- tools/testing/selftests/bpf/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 11fdf126cb7c..60a07605a162 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -785,6 +785,8 @@ $(OUTPUT)/veristat: $(OUTPUT)/veristat.o $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@ +# Linking uprobe_multi can fail due to relocation overflows on mips. +$(OUTPUT)/uprobe_multi: CFLAGS += $(if $(filter mips, $(ARCH)),-mxgot) $(OUTPUT)/uprobe_multi: uprobe_multi.c $(call msg,BINARY,,$@) $(Q)$(CC) $(CFLAGS) -O0 $(LDFLAGS) $^ $(LDLIBS) -o $@