From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by sourceware.org (Postfix) with ESMTPS id E119E3858D37 for ; Sun, 12 Jul 2020 10:06:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E119E3858D37 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06CA6lPd014363; Sun, 12 Jul 2020 10:06:47 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 32762n31n9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 12 Jul 2020 10:06:47 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 06CA3S22107014; Sun, 12 Jul 2020 10:06:43 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 327q0k052q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 12 Jul 2020 10:06:43 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 06CA6gFl027614; Sun, 12 Jul 2020 10:06:42 GMT Received: from termi.oracle.com (/77.189.207.108) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 12 Jul 2020 03:06:41 -0700 From: "Jose E. Marchesi" To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH V4 2/3] sim: eBPF simulator References: <20200710122530.32541-1-jose.marchesi@oracle.com> <20200710122530.32541-3-jose.marchesi@oracle.com> <20200712082503.GC2737@embecosm.com> Date: Sun, 12 Jul 2020 12:06:38 +0200 In-Reply-To: <20200712082503.GC2737@embecosm.com> (Andrew Burgess's message of "Sun, 12 Jul 2020 09:25:03 +0100") Message-ID: <871rlhoxn5.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9679 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 suspectscore=29 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007120079 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9679 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 spamscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 suspectscore=29 phishscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007120079 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Jul 2020 10:06:53 -0000 Hi Andrew. > This patch introduces the basics of an instruction-simulator for eBPF. > The simulator is based on CGEN. Thanks I took a look through and I'm basically happy. There's a few small issues that I've highlighted inline below. Thanks for the review. > > sim/ChangeLog: > > 2020-07-10 Jose E. Marchesi > David Faust > > * configure.tgt (sim_arch): Add entry for bpf-*-*. > * configure: Regenerate. > * MAINTAINERS: Add maintainer for the BPF simulator. > * bpf/Makefile.in: New file. > * bpf/bpf-helpers.c: Likewise. > * bpf/bpf-helpers.def: Likewise. > * bpf/bpf-helpers.h: Likewise. > * bpf/bpf-sim.h: Likewise. > * bpf/bpf.c: Likewise. > * bpf/config.in: Likewise. > * bpf/configure.ac: Likewise. > * bpf/decode.h: Likewise. > * bpf/eng.h: Likewise. > * bpf/mloop.in: Likewise. > * bpf/sim-if.c: Likewise. > * bpf/sim-main.h: Likewise. > * bpf/traps.c: Likewise. > * bpf/configure: Generate. This file is missing from this message. Yeah, I removed the thunks containing complete `configure' files to avoid hitting the mailman zise limit. I can send it in a separated email if required. > diff --git a/sim/bpf/Makefile.in b/sim/bpf/Makefile.in > new file mode 100644 > index 0000000000..b12bb6a7d5 > --- /dev/null > +++ b/sim/bpf/Makefile.in > @@ -0,0 +1,205 @@ > +# Makefile template for configure for the eBPF simulator > +# Copyright (C) 2019 Free Software Foundation, Inc. This should probably be 2020 here. Right. Will change. > +# Dependencies for binaries from CGEN generated source > + > +arch.o: arch.c $(SIM_MAIN_DEPS) > +cpu.o: cpu.c $(BPF_INCLUDE_DEPS) > +decode-le.o: decode-le.c $(BPF_INCLUDE_DEPS) > +decode-be.o: decode-be.c $(BPF_INCLUDE_DEPS) > +# XXX sem-switch.o: sem-switch.c $(BPF_INCLUDE_DEPS) > +# XXX model.o: model.c $(BPF_INCLUDE_DEPS) As I mentioned in my review of patch #1, I'm not a fan of these XXX comments. I'm not going to insist these be removed (where they are limited to the bpf directories), but I don't think things like the above add any value, so I'd prefer they be removed, and you shouldn't assume that these wont be removed in the future. Actually, these particular comments are obsolete and should be removed. > diff --git a/sim/bpf/bpf-helpers.def b/sim/bpf/bpf-helpers.def > new file mode 100644 > index 0000000000..6106ac794a > --- /dev/null > +++ b/sim/bpf/bpf-helpers.def > @@ -0,0 +1,194 @@ > +/* BPF helpers database. > + Copyright (C) 2019-2020 Free Software Foundation, Inc. Is this really 2019-2020? If it's copied from some other file that is 2019-2020 then could you mention on the preceding line, just to make it clear. Yes, that file (with same name) was contributed as part of the BPF GCC backend, back in 2019.