Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3159876ybt; Mon, 29 Jun 2020 17:16:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQrw1aJcu/9J2shIS56lJu99CVu37gFkAIidyH0xqXofgRWn+bIcaryfv/pdGz6pqP5yUD X-Received: by 2002:a05:6402:306a:: with SMTP id bs10mr12740021edb.51.1593476213715; Mon, 29 Jun 2020 17:16:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593476213; cv=none; d=google.com; s=arc-20160816; b=dVLAXpfyXy/R4/5RX4ibahPa5gUDdPOtrTdqItCOaJouN+wp0vhpBEN4J2Yf771VON +YnAQus/T164soetLjhgMq0zOrl+Hv7T0eco6ID4a/FFWJsS47U3rV+pggJWyxezO6e7 5A3cdWLo1oe6KrDAs8oI4iNlyQ6epd5hCUpclLeL5PZ41QxiPCJx2x5NFsBZ2vxsjoa+ mMzgPgxxaBZWMjP3nMYNg+sRqx2Tub131VHkHZBTF8Ao3NWwkfSnjT0bH+wsQauv0chL dA/kHGmiPEz0jzWxqfgf993BRlAs/nudj5KHypatUeNRPVZGJRdrOT1w2pHwpEK5SWgY 7Ryw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=s3VzMohSaWNb5VFHtzw5RgpRlfErs2RFHDf1RPBbQ7w=; b=XFwin0p8hudLwgVYFWybyPBtiI1gOxho9tjApQzFBYTx4IQf3Q9L4BmF8nMVyeVk3U u5OtDWP8woUzmXS68cFbL/DRpyfZfaTEGt7OVa9iUJ/p1PY/y0DQj8WmuqcWoz9nbKCA OlklD0T/vDbJ1zfQni9As4je6QGQv/9ETf2wD1JpOIdMXnHVNArDurrV0t+MO0fLJf39 ATR77P+ZU0Wvzv6Ix8rGgzNa5Ju5DZbXyk708I1ztwXan57bJxp12vdlLrRw66K2N1mi h9uiJ2iaRbrRD5j4v47AK+vbc+pmJJYaMkQBoA9r6M0Vx9NQDEH5UyirJuZ+8miWpmQm r8vQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Py1tgRPv; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si640276edt.552.2020.06.29.17.16.31; Mon, 29 Jun 2020 17:16:53 -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=@kernel.org header.s=default header.b=Py1tgRPv; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728062AbgF3AM5 (ORCPT + 99 others); Mon, 29 Jun 2020 20:12:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:34692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbgF3AM4 (ORCPT ); Mon, 29 Jun 2020 20:12:56 -0400 Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 6D524207E8; Tue, 30 Jun 2020 00:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593475975; bh=Eun4NbTfii0sW6QvTru7wRSuIGDGkkNEhp0AOlaNHNE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Py1tgRPvgo9LIcjYU1cqG1eObUlUJhT6HW0GA2FfobvWok6kLb/+5KWVyDjsHyTSt zB7pyxrK37gPMIyrmt9QFrggg0sy2lBX5vDCK9CZzaaF6JQGmWiP+QIrjJ3p4GkYCl eJ/RDztRABDZpB1hepOGzJ/XSimfXWB8LI/pko/o= Received: by mail-lj1-f172.google.com with SMTP id h22so13232700lji.9; Mon, 29 Jun 2020 17:12:55 -0700 (PDT) X-Gm-Message-State: AOAM530tcDYHX8GbFfJ+XsMo1z4O5qRn0AHfi12neIzlzsnXsplBlYUT pYmCZbXjlwc+bzTmJBB19qyPuubY8zRD5iPLBH4= X-Received: by 2002:a2e:5344:: with SMTP id t4mr7382221ljd.79.1593475973227; Mon, 29 Jun 2020 17:12:53 -0700 (PDT) MIME-Version: 1.0 References: <20200629012524.c941a5f18aa7f312d325f714@kernel.org> In-Reply-To: From: Guo Ren Date: Tue, 30 Jun 2020 08:12:41 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V2] riscv: Fixup compile error BUILD_BUG_ON failed To: Palmer Dabbelt Cc: Masami Hiramatsu , Greentime Hu , linux-riscv , Linux Kernel Mailing List , Paul Walmsley , Anup Patel , linux-csky@vger.kernel.org, Zong Li , Guo Ren Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Palmer, On Tue, Jun 30, 2020 at 7:22 AM Palmer Dabbelt w= rote: > > On Sun, 28 Jun 2020 09:25:24 PDT (-0700), mhiramat@kernel.org wrote: > > On Sun, 28 Jun 2020 16:07:37 +0000 > > guoren@kernel.org wrote: > > > >> From: Guo Ren > >> > >> Unfortunately, the current code couldn't be compiled: > >> > >> CC arch/riscv/kernel/patch.o > >> In file included from ./include/linux/kernel.h:11, > >> from ./include/linux/list.h:9, > >> from ./include/linux/preempt.h:11, > >> from ./include/linux/spinlock.h:51, > >> from arch/riscv/kernel/patch.c:6: > >> In function =E2=80=98fix_to_virt=E2=80=99, > >> inlined from =E2=80=98patch_map=E2=80=99 at arch/riscv/kernel/patc= h.c:37:17: > >> ./include/linux/compiler.h:392:38: error: call to =E2=80=98__compileti= me_assert_205=E2=80=99 declared with attribute error: BUILD_BUG_ON failed: = idx >=3D __end_of_fixed_addresses > >> _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER= __) > >> ^ > >> ./include/linux/compiler.h:373:4: note: in definition of macro =E2=80= =98__compiletime_assert=E2=80=99 > >> prefix ## suffix(); \ > >> ^~~~~~ > >> ./include/linux/compiler.h:392:2: note: in expansion of macro =E2=80= =98_compiletime_assert=E2=80=99 > >> _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER= __) > >> ^~~~~~~~~~~~~~~~~~~ > >> ./include/linux/build_bug.h:39:37: note: in expansion of macro =E2=80= =98compiletime_assert=E2=80=99 > >> #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > >> ^~~~~~~~~~~~~~~~~~ > >> ./include/linux/build_bug.h:50:2: note: in expansion of macro =E2=80= =98BUILD_BUG_ON_MSG=E2=80=99 > >> BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition) > >> ^~~~~~~~~~~~~~~~ > >> ./include/asm-generic/fixmap.h:32:2: note: in expansion of macro =E2= =80=98BUILD_BUG_ON=E2=80=99 > >> BUILD_BUG_ON(idx >=3D __end_of_fixed_addresses); > >> ^~~~~~~~~~~~ > >> > >> Because fix_to_virt(, idx) needs a const value, not a dynamic variable= of > >> reg-a0 or BUILD_BUG_ON failed with "idx >=3D __end_of_fixed_addresses"= . > > > > Looks good to me :) > > > > Reviewed-by: Masami Hiramatsu > > Is there a configuration that runs into this bug? It's not showing up fo= r me, > and I generally try to add regressions to my test suite. > > > Thanks! KPROBE, I'll send the patch soon. --=20 Best Regards Guo Ren ML: https://lore.kernel.org/linux-csky/