Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp112746pxb; Wed, 3 Nov 2021 00:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbQTVoeUpPbUSpFaAiju2fuk80RBgsJF65VQo3xj5YMcgvxu/HYGaKLPPvDnEolf+OnyVT X-Received: by 2002:a92:d8ca:: with SMTP id l10mr26779620ilo.218.1635925346194; Wed, 03 Nov 2021 00:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635925346; cv=none; d=google.com; s=arc-20160816; b=OrE1mPAgKCM2CPnvfiDGbGMjfzjFPU5dZr40ZY+DgPZwHvmA6qX+MjJ1GtWObPhdth SWT2zziZAAXMshEmMVu+LmoL1ADH8GpgkTzDov5VjAijraAW9c4+UEh+b1KnvyuPsxn9 Xjp1224GXTV+74wNTODOG3BxyY3YtY9+23VUTsDK605W+SLAfKXBTFmv3idlZ5KMkzGo P3hO2zsNM5OucO4bH03T6/f1onUiSiNk6eK6BkoWu9ZoHoDlfSa/D9foNbu1j62sCABT ttDnKe8U1NHGCThiQ9cL37VMNAllicUviQdhQsnv2Aybc3qOwlRA1wvqmEhP5e6sRZOL y1eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=rEUk3hjZbgaNLemqWe9Q44RKe4LYiJjMpeJVdUSL6cI=; b=FZOOKUQkWDDcgNUubhiFP1U8ahDtN8R4KFC3pn/1lPjqJ34fqzScxfJF9p04pkcEsZ TQMDStuMwCU7TZuCadVdt3pkiguw76SHC8w4o2S+CKxtpDIzqn1seCllhUBfEThnEJt4 Yd0XQhus/VgZK51JjZ3bsyXabAta93FCQsc7V+pwd2pSvY/z7GF/Ikln4AcMKCnL5mOe Kwbf5abMmTTppPirUyJYw9sdB24DF7JDpRkQzNlhnHFl1POxBsPexR34+nnNguagWQpl 7m5ALzEVFDWyrjzNXdtu7iThdd+hyEqShKjwfCLgQaWYvlGIq5A0BeYVFlUB2urwS37y o23Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=SzSEr4Gz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si3190164ioq.55.2021.11.03.00.42.08; Wed, 03 Nov 2021 00:42:26 -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=@gmail.com header.s=20210112 header.b=SzSEr4Gz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbhKCHnv (ORCPT + 99 others); Wed, 3 Nov 2021 03:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231985AbhKCHnu (ORCPT ); Wed, 3 Nov 2021 03:43:50 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2086FC061714; Wed, 3 Nov 2021 00:41:14 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id u1so2073309wru.13; Wed, 03 Nov 2021 00:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=rEUk3hjZbgaNLemqWe9Q44RKe4LYiJjMpeJVdUSL6cI=; b=SzSEr4GzUIi1n53esxrhyzEL+hnpq51VXmuNzoRbJng2jp0GsMOv6J6G+0AUT7sKib WaR12lSVZFAI5pPfRFm9i0NG3DAZEN4srkUw67DLwYHYnhu3wUCn780FuNIYfO0LzT40 1Nj9cfpioDcXN/7KmFeruIRM9XUofAP7KZhnQMRuqUkJhuz49XhNdRrR2FIzrb8Ah5f0 xSfFjOU9PBmgkriGn55A5Q6gxEwiETQJqtV1yx7WGqGX849wiHMl3lVPW3SrzN3LFSmT tBrMKwDkH4oSdrSOYaHSJLP2+zRMOnlibiAZVi1+gMlRLxYDs5zu6QQoVEsDBOje/AjA dS4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=rEUk3hjZbgaNLemqWe9Q44RKe4LYiJjMpeJVdUSL6cI=; b=F4+JdGU5/88RO+OLiI1m2zc/lDBPS1ymNR832P2tBao7fVSS4yYivFG1/VuFNhEL8G E5UcQuEw+9T6tg0On+llcbwOm9nhjNy8eEqJAopTfE/OZEzIiUU1OesfcbvnhfvSFJl1 fENZan8r/DPEJMNgFsrFFYH/shoMjs7Qol+ssar+E7zq1OoF/ROyd3wX+0EVBspBngcE 5dfm4rWrFPJ6/4qIZCJ6QKSeDNX+GBZQaoSQV4xdV/Hk0fuAyNnF2nhLsbgQOYh8T7+Y 9Kxlm5aZb1xyb5atqdkrzv7ldmPZQ32CgZT6FsjJilodJQVaXpPnP92STomciBbtlhkJ 4x8Q== X-Gm-Message-State: AOAM5315Kj9IWAeZrlAagiRFlLYOk73lmrh914R/u2sdy0qCkT5S/byQ /MJpF4AFwqL7D/1rWCpN9YyYOcOdKwj8v8FTmSQy28bgcFA2Ng== X-Received: by 2002:a05:6000:12d2:: with SMTP id l18mr42076950wrx.289.1635925272752; Wed, 03 Nov 2021 00:41:12 -0700 (PDT) MIME-Version: 1.0 References: <20211102145642.724820-1-tongtiangen@huawei.com> <448599f5-e773-6ab5-bdaf-289f583edf01@huawei.com> In-Reply-To: From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Date: Wed, 3 Nov 2021 08:41:01 +0100 Message-ID: Subject: Re: [PATCH bpf-next] riscv, bpf: fix some compiler error To: tongtiangen Cc: Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , linux-riscv , LKML , Netdev , bpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Nov 2021 at 08:26, tongtiangen wrote: > [...] > > Adding a function declaration in bpf_jit_comp64.c file cannot fix this co= mpiler error: > AFAIK, there are two issues: 1. https://lore.kernel.org/llvm/202110290334.2zdMyRq4-lkp@intel.com/ 2. https://lore.kernel.org/llvm/202111020610.9oy9Rr0G-lkp@intel.com/ 1 is a warning when W=3D1 is enabled (missing prototype from -Wmissing-prot= otypes) 2 is an error, since the function is not defined when building CONFIG_ARCH_= RV32I You are trying to address both issues in this patch. > .... > when CONFIG_BPF_JIT and CONFIG_ARCH_64I is open, There is the following c= ompiler error (W=3D1): > error: no previous prototype for 'rv_bpf_fixup_exception' > .... > > To fix this compiler error, you need to make a declaration in a header fi= le, which is also > the reason for introducing extable.h. > No, you don't need the header file. The forward declaration is sufficient to get rid of the warning, and the adding CONFIG_ARCH_RV64I fixes the RV32I build. Bj=C3=B6rn