Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1669927pxb; Mon, 11 Oct 2021 10:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOlIvB+wQ/7q2veCnCqioeG8RIGiNCxCY0taI0Eirjp+P7fd1rDVyFmAt8m5tyMJ2evJfe X-Received: by 2002:a17:906:9742:: with SMTP id o2mr26907256ejy.532.1633973655271; Mon, 11 Oct 2021 10:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633973655; cv=none; d=google.com; s=arc-20160816; b=n+ZhyKFUy0G/85Z1ECa7G1kH0usMhULF+ywXyDdy4KBKpCmav2gfk/FaWXQSW/dwSx JEsdXUB/CWO8Jlnh3ivpu7fUzYoIZLuIJpljFEqgiWYx5gbuvkfNMkktAwEttimr6udO X3+9XDFvzr3J9BpBT29FoV3tXVSHXIYkyd7v78pFWpFcemwBWD5KBD9j1HhKQWPE0W/F BT05QAsUE3Mz6dyFpkfeYklq4j9TjHfW5eXamVr0G4OzSplbseQoUPdNPACqeGiZEBEY ZpKEVggmfwCBTI12IAgxC6TDkQQoSahFwQLBK45beIgbxb/5YCd6gpDm6OrdY6RHsjSy nXZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qA3YuL7fYmv4Y8Yvw8BDi0DK+UWHyslqyhO8rDvQoNY=; b=ECB5Bs5BhReHI0Esk1EJtN2/gENi/iseVcT0FgKMaLJwve7i84t17DwaVkd06bKWlP cDahF8GITX9lLLr/1txEQ6KTiyryrdBMisiw5b5NugdW2e2az4B8wh4I2FZml5lVSP1/ p9yyQiDLOlvA2YdXdyRFUNCQ2KujRlaxo1RStxq6VcnxAfHNEEqlIQCDCb6vANYB0Q0n evLBYlSl8Dsx9jcnYnu0FT1e6T9S5EtP7Epk3QQngjmpJWk6F0aWuCJbex5cniItoyVl HKWDd0ugcpoKknSeuTUwRiopVTmTEPg6gdxYhaU1WF74ucC4X5i+DK+DHgOJPWIhOInc ON2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d+BRza8H; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bh21si12906733ejb.428.2021.10.11.10.33.48; Mon, 11 Oct 2021 10:34:15 -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=@linaro.org header.s=google header.b=d+BRza8H; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230023AbhJKRbh (ORCPT + 95 others); Mon, 11 Oct 2021 13:31:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230061AbhJKRbg (ORCPT ); Mon, 11 Oct 2021 13:31:36 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAED1C061570 for ; Mon, 11 Oct 2021 10:29:35 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id p13so71304207edw.0 for ; Mon, 11 Oct 2021 10:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qA3YuL7fYmv4Y8Yvw8BDi0DK+UWHyslqyhO8rDvQoNY=; b=d+BRza8HiCfXT1IwFtf5HXAvgHtq59Wg3QEi22ubyhxfWeM5jg8fYggLDauZf4D62E ussN8dvte5J0e2s0xVWV9KtiXwsJSNs1IEkau5yacd6kSEHgXjuutTXkH0JRQyqwpy8I gI9QJ7P0fOQf07zjlkUMcCik5oB+GpKIezcjH7/MuAwRafmk1NrQuPvLsllqRXLEgiRr PM7wr+Zmcj+wrj9W/eet2X4fKldR9TiUJ9ssP0pQYWnPUPT76NawLB92sH0R+nWcNnPI 7I9YK+HLgZozd3wSV2SLDu/8mYkroFiAW+mrwMrXg/lihmOyENJX0bxvqlT9ZkpwqgBg XM5Q== 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; bh=qA3YuL7fYmv4Y8Yvw8BDi0DK+UWHyslqyhO8rDvQoNY=; b=aVKX5fsKGyeQXH7T9bcPY7OoD5cwDCDJV6zqP5EFHksAH2PaFwRZcZmolBbOUSQOqX JkkDcgKB06bWxdYdbuKsKtYinIEsWDrkuyju6kWV0wR36Nxf806jTL8PlTFgU8WOl+ca 523g3WssohfL0WBWVplelfd5XkGDmSyypE0kBuwvf2scTJd3dbnO7ve91MCY8gdJyCJ4 G1CmZzbKcq6mEN5eOOGwsJSTEOmeZs2+0O8Qdfjz2tEBggS3W7Wj7NzN46LgmJ9ikUOa BqAXYQMq4lPCgVPQfn/MzZcIPNsEZd28Oo7bgEwFvU61K42cl0Q9Gx/WLoPjlHjxWe6/ WxEQ== X-Gm-Message-State: AOAM531f3AMMns/fFBHETuUXhugRRJrJfADYfi30/fvVT6HeM6qRlhTB kQJ7389FeeKynKQRUD4U1uvR3gk7gizYwgrIuRWGbw== X-Received: by 2002:a05:6402:3587:: with SMTP id y7mr43089286edc.182.1633973374304; Mon, 11 Oct 2021 10:29:34 -0700 (PDT) MIME-Version: 1.0 References: <20211011134508.362906295@linuxfoundation.org> <20211011134510.897297770@linuxfoundation.org> In-Reply-To: <20211011134510.897297770@linuxfoundation.org> From: Naresh Kamboju Date: Mon, 11 Oct 2021 22:59:23 +0530 Message-ID: Subject: Re: [PATCH 5.10 73/83] powerpc/bpf: Fix BPF_MOD when imm == 1 To: Greg Kroah-Hartman Cc: open list , linux-stable , "Naveen N. Rao" , Johan Almbladh , Christophe Leroy , Song Liu , Michael Ellerman , Sasha Levin Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org stable-rc 5.4 build failed due this patch. - powerpc gcc-10-defconfig - FAILED - powerpc gcc-11-defconfig - FAILED - powerpc gcc-8-defconfig - FAILED - powerpc gcc-9-defconfig - FAILED On Mon, 11 Oct 2021 at 19:28, Greg Kroah-Hartman wrote: > > From: Naveen N. Rao > > [ Upstream commit 8bbc9d822421d9ac8ff9ed26a3713c9afc69d6c8 ] > > Only ignore the operation if dividing by 1. > > Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") > Signed-off-by: Naveen N. Rao > Tested-by: Johan Almbladh > Reviewed-by: Christophe Leroy > Acked-by: Song Liu > Acked-by: Johan Almbladh > Signed-off-by: Michael Ellerman > Link: https://lore.kernel.org/r/c674ca18c3046885602caebb326213731c675d06.1633464148.git.naveen.n.rao@linux.vnet.ibm.com > Signed-off-by: Sasha Levin > --- > arch/powerpc/net/bpf_jit_comp64.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c > index 658ca2bab13c..e79f9eae2bc0 100644 > --- a/arch/powerpc/net/bpf_jit_comp64.c > +++ b/arch/powerpc/net/bpf_jit_comp64.c > @@ -408,8 +408,14 @@ static int bpf_jit_build_body(struct bpf_prog *fp, u32 *image, > case BPF_ALU64 | BPF_DIV | BPF_K: /* dst /= imm */ > if (imm == 0) > return -EINVAL; > - else if (imm == 1) > - goto bpf_alu32_trunc; > + if (imm == 1) { > + if (BPF_OP(code) == BPF_DIV) { > + goto bpf_alu32_trunc; > + } else { > + EMIT(PPC_RAW_LI(dst_reg, 0)); In file included from arch/powerpc/net/bpf_jit64.h:11, from arch/powerpc/net/bpf_jit_comp64.c:19: arch/powerpc/net/bpf_jit_comp64.c: In function 'bpf_jit_build_body': arch/powerpc/net/bpf_jit_comp64.c:415:46: error: implicit declaration of function 'PPC_RAW_LI'; did you mean 'PPC_RLWIMI'? [-Werror=implicit-function-declaration] 415 | EMIT(PPC_RAW_LI(dst_reg, 0)); | ^~~~~~~~~~ arch/powerpc/net/bpf_jit.h:32:34: note: in definition of macro 'PLANT_INSTR' 32 | do { if (d) { (d)[idx] = instr; } idx++; } while (0) | ^~~~~ arch/powerpc/net/bpf_jit_comp64.c:415:41: note: in expansion of macro 'EMIT' 415 | EMIT(PPC_RAW_LI(dst_reg, 0)); | ^~~~ cc1: all warnings being treated as errors Reported-by: Linux Kernel Functional Testing -- Linaro LKFT https://lkft.linaro.org