Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp926242imj; Sat, 9 Feb 2019 10:58:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmJI47KoEJhq0+4kyoiu0UjFv3jgP5paQjHD3if0+OSlrX6IjotRoYtKPZbo3nIyjqsf5d X-Received: by 2002:a63:5861:: with SMTP id i33mr26668781pgm.60.1549738709569; Sat, 09 Feb 2019 10:58:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738709; cv=none; d=google.com; s=arc-20160816; b=YAgbg0wGCh9P64su3oJ3RmFaLsXpvAR6u9LhbHywLulRbiKqm8/FAG4wRgXPGXziA1 7/xWB79bJouS+3V8FXsw1ObPDqOr872kaaqrI1VhzZioQdOxhWt0Ae0V6DQt/rrHSk9k 0GeunE/EHvc3KFAjOvPFfDsPmBIkLLtGygKI0Jhxp9Sav2+UALy52M+bi0HykpxbE2z6 7oeM59750MQCuzwDZUP4CCfX6KF2PIEISURGnifSe5QE4VivgFHN1Z60RMIwqdoej+Ws P2vHTfwZ5ArnbXqfjmjFuHKtszH7ZarGA1hcE72rlA+W7fykLV9zkR7xNrb3Rg/pWFRL 88uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KiaeHZBvp5foOaD+1NcprJi0luUaB5XU8IcztD1T+9E=; b=LhTDVfLe8Vo8ZZi6PErywikAAB3iCQSo2pOOGVpJ5FCsQkTaBL3+YJCa/4EPbtXlwQ O3jrGJshczba0HWt+qeVnVP/l41akHwAzdVS3cIzAbIN2Lf5q63RuS9/WkbzcyYJzbBc IRmtjDGdbL+2UOB8N0xSrntEVysApdbgsTR+QjFEpPIMDBMqsp95hWhK9lb3pa8dhVl6 G3t1iYlguHb2RvbAxqu/cYfrqzaNKgOdYDYz2BKczvereHHnsoFU7mtlbsO6btp+pgAC gph9ivcu/2v6IfQ7Acu4VpM4O0j08LhSPoXMLNY8zX3i6MJQ7S4m0bxEGIJm2cm4FEYc LXqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MTQ6pQKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m193si4016785pga.465.2019.02.09.10.58.14; Sat, 09 Feb 2019 10:58:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MTQ6pQKu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727374AbfBISrq (ORCPT + 99 others); Sat, 9 Feb 2019 13:47:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:60314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727331AbfBISro (ORCPT ); Sat, 9 Feb 2019 13:47:44 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9C99C20821; Sat, 9 Feb 2019 18:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738063; bh=YhIMmOSwti1zPESoOl0fTvV5sFCRMp9I5uuDvqzkyWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MTQ6pQKudmnQrPEzZHttWIuKUGGulNEeNWvng3bVEc8hhui+7SSXUscudxfFyKzfS Dzik9CQUeB8P3fckDhiO42FTFvnJbD3h5KMIYqcY/1bKbwCFdgTAjZYZFaLXJowKmj WsK5aPq/5HfHhY7LLxZMDo/zWdLk6Vgg45CskOBI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Aurelien Jarno , Palmer Dabbelt , Sasha Levin Subject: [PATCH AUTOSEL 4.20 07/42] tools uapi: fix RISC-V 64-bit support Date: Sat, 9 Feb 2019 13:46:59 -0500 Message-Id: <20190209184734.125935-7-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aurelien Jarno [ Upstream commit d0df00e30e4bf9bc27ddbd092ad683ff6121b360 ] The BPF library is not built on 64-bit RISC-V, as the BPF feature is not detected. Looking more in details, feature/test-bpf.c fails to build with the following error: | In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17, | from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2, | from /usr/include/riscv64-linux-gnu/asm/unistd.h:1, | from test-bpf.c:2: | /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h | #error Inconsistent word size. Check asm/bitsperlong.h | ^~~~~ The UAPI from the tools directory is missing RISC-V support, therefore bitsperlong.h from asm-generic is used, defaulting to 32 bits. Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h as a copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updating tools/include/uapi/asm/bitsperlong.h. Signed-off-by: Aurelien Jarno Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- .../arch/riscv/include/uapi/asm/bitsperlong.h | 25 +++++++++++++++++++ tools/include/uapi/asm/bitsperlong.h | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 tools/arch/riscv/include/uapi/asm/bitsperlong.h diff --git a/tools/arch/riscv/include/uapi/asm/bitsperlong.h b/tools/arch/riscv/include/uapi/asm/bitsperlong.h new file mode 100644 index 000000000000..0b3cb52fd29d --- /dev/null +++ b/tools/arch/riscv/include/uapi/asm/bitsperlong.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2012 ARM Ltd. + * Copyright (C) 2015 Regents of the University of California + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _UAPI_ASM_RISCV_BITSPERLONG_H +#define _UAPI_ASM_RISCV_BITSPERLONG_H + +#define __BITS_PER_LONG (__SIZEOF_POINTER__ * 8) + +#include + +#endif /* _UAPI_ASM_RISCV_BITSPERLONG_H */ diff --git a/tools/include/uapi/asm/bitsperlong.h b/tools/include/uapi/asm/bitsperlong.h index 8dd6aefdafa4..fd92ce8388fc 100644 --- a/tools/include/uapi/asm/bitsperlong.h +++ b/tools/include/uapi/asm/bitsperlong.h @@ -13,6 +13,8 @@ #include "../../arch/mips/include/uapi/asm/bitsperlong.h" #elif defined(__ia64__) #include "../../arch/ia64/include/uapi/asm/bitsperlong.h" +#elif defined(__riscv) +#include "../../arch/riscv/include/uapi/asm/bitsperlong.h" #else #include #endif -- 2.19.1