qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Taylor Simpson <tsimpson@quicinc.com>
Cc: "Alessandro Di Federico" <ale@rev.ng>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Niccolò Izzo" <izzoniccolo@gmail.com>,
	"nizzo@rev.ng" <nizzo@rev.ng>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Aleksandar Markovic" <aleksandar.m.mail@gmail.com>
Subject: Re: QEMU for Qualcomm Hexagon - KVM Forum talk and code available
Date: Tue, 17 Dec 2019 19:41:09 +0100	[thread overview]
Message-ID: <ffdee96f-c9dc-0281-d4bc-da53e518e020@redhat.com> (raw)
In-Reply-To: <CAFEAcA-TpZfqbWjGX-tD0Osapt_K4yuTBg6+B=ZxU4MuVr7omg@mail.gmail.com>

On 12/17/19 7:21 PM, Peter Maydell wrote:
> On Tue, 17 Dec 2019 at 18:16, Taylor Simpson <tsimpson@quicinc.com> wrote:
>> Question 1:
>> I see this error from checkpatch.pl
>> ERROR: Macros with complex values should be enclosed in parenthesis
>> However, there are times when the code will not compile with parenthesis.  For example, we have a file that defined all the instruction attributes.  Each line has
>> DEF_ATTRIB(LOAD, "Loads from memory", "", "")
>> So, we create an enum of all the possible attributes as follows
>> enum {
>> #define DEF_ATTRIB(NAME, ...) A_##NAME,
>> #include "attribs_def.h"
>> #undef DEF_ATTRIB
>> };
> 
> checkpatch is often right, but also often wrong,
> especially for C macros which are in the general case
> impossible to parse. If the error makes no sense, you can
> ignore it.
> 
>> Question 2:
>> What is the best source of guidance on breaking down support for a new target into a patch series?
> 
> Look at how previous ports did it.

Recent ports were system (softmmu), this is a linux-user port. The last 
architecture merged is RISCV, they did that with commit, so I'm not sure 
this is our best example on breaking down:

$ git show --stat ea10325917c8
commit ea10325917c8a8f92611025c85950c00f826cb73
Author: Michael Clark <mjc@sifive.com>
Date:   Sat Mar 3 01:31:10 2018 +1300

     RISC-V Disassembler

     The RISC-V disassembler has no dependencies outside of the 'disas'
     directory so it can be applied independently. The majority of the
     disassembler is machine-generated from instruction set metadata:

     - https://github.com/michaeljclark/riscv-meta

     Expected checkpatch errors for consistency and brevity reasons:

     ERROR: line over 90 characters
     ERROR: trailing statements should be on next line
     ERROR: space prohibited between function name and open parenthesis '('

     Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
     Signed-off-by: Michael Clark <mjc@sifive.com>

  include/disas/bfd.h |    2 +
  disas.c             |    2 +
  disas/riscv.c       | 3048 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  disas/Makefile.objs |    1 +
  4 files changed, 3053 insertions(+)

$ git show --stat 55c2a12cbcd3d
commit 55c2a12cbcd3d417de39ee82dfe1d26b22a07116
Author: Michael Clark <mjc@sifive.com>
Date:   Sat Mar 3 01:31:11 2018 +1300

     RISC-V TCG Code Generation

     TCG code generation for the RV32IMAFDC and RV64IMAFDC. The QEMU
     RISC-V code generator has complete coverage for the Base ISA v2.2,
     Privileged ISA v1.9.1 and Privileged ISA v1.10:

     - RISC-V Instruction Set Manual Volume I: User-Level ISA Version 2.2
     - RISC-V Instruction Set Manual Volume II: Privileged ISA Version 1.9.1
     - RISC-V Instruction Set Manual Volume II: Privileged ISA Version 1.10

     Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
     Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
     Signed-off-by: Sagar Karandikar <sagark@eecs.berkeley.edu>
     Signed-off-by: Michael Clark <mjc@sifive.com>

  target/riscv/instmap.h   |  364 ++++++++++++++++++++++++++++++++++++++
  target/riscv/translate.c | 1978 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2 files changed, 2342 insertions(+)

$ git show --stat 47ae93cdfed
commit 47ae93cdfedc683c56e19113d516d7ce4971c8e6
Author: Michael Clark <mjc@sifive.com>
Date:   Sat Mar 3 01:31:11 2018 +1300

     RISC-V Linux User Emulation

     Implementation of linux user emulation for RISC-V.

     Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
     Signed-off-by: Sagar Karandikar <sagark@eecs.berkeley.edu>
     Signed-off-by: Michael Clark <mjc@sifive.com>

  linux-user/riscv/syscall_nr.h     | 287 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  linux-user/riscv/target_cpu.h     |  18 +++++++++++++
  linux-user/riscv/target_elf.h     |  14 ++++++++++
  linux-user/riscv/target_signal.h  |  23 ++++++++++++++++
  linux-user/riscv/target_structs.h |  46 ++++++++++++++++++++++++++++++++
  linux-user/riscv/target_syscall.h |  56 
++++++++++++++++++++++++++++++++++++++
  linux-user/riscv/termbits.h       | 222 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  linux-user/syscall_defs.h         |  13 +++++----
  target/riscv/cpu_user.h           |  13 +++++++++
  linux-user/elfload.c              |  22 +++++++++++++++
  linux-user/main.c                 |  99 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  linux-user/signal.c               | 203 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
  linux-user/syscall.c              |   2 ++
  13 files changed, 1012 insertions(+), 6 deletions(-)


> Also I thought we'd
> had a subthread on how best to split things up, but maybe I'm
> misremembering.

I remember something too, I hope you are right :P

>>   I see avr being reviewed currently.  I have mostly new files: 12 in linux-user/hexagon, and ~50 in target/hexagon.  I also need to add test cases and a container for the toolchain.  Is it OK to break things down mostly at file boundaries?
> 
> No, file boundaries are generally a bad choice of breakdown.
> You want to split at conceptual boundaries, ie one chunk
> of functionality that can be comprehended in one go without
> having to refer forward to other patches.
> 
> thanks
> -- PMM
> 



  reply	other threads:[~2019-12-17 18:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25 16:26 Taylor Simpson
2019-11-01 18:29 ` Philippe Mathieu-Daudé
2019-11-04  2:35   ` Taylor Simpson
2019-11-05  0:05 ` Aleksandar Markovic
2019-11-05 16:32   ` Taylor Simpson
2019-11-12 22:52     ` Taylor Simpson
2019-11-13 10:31       ` Alex Bennée
2019-11-13 19:31         ` Taylor Simpson
2019-11-13 21:10           ` Richard Henderson
2019-11-15  0:54             ` Taylor Simpson
2019-12-17 18:14               ` Taylor Simpson
2019-12-17 18:19                 ` Thomas Huth
2019-12-17 18:21                 ` Peter Maydell
2019-12-17 18:41                   ` Philippe Mathieu-Daudé [this message]
2019-12-17 18:44                     ` Philippe Mathieu-Daudé
2019-12-18 23:50                   ` Richard Henderson
2019-11-13 21:27         ` Peter Maydell
2019-11-19  9:12       ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ffdee96f-c9dc-0281-d4bc-da53e518e020@redhat.com \
    --to=philmd@redhat.com \
    --cc=ale@rev.ng \
    --cc=aleksandar.m.mail@gmail.com \
    --cc=alex.bennee@linaro.org \
    --cc=izzoniccolo@gmail.com \
    --cc=nizzo@rev.ng \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=tsimpson@quicinc.com \
    --subject='Re: QEMU for Qualcomm Hexagon - KVM Forum talk and code available' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox