qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Claudio Fontana <cfontana@suse.de>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Alex Bennée" <alex.bennee@linaro.org>
Cc: Laurent Vivier <lvivier@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Thomas Huth <thuth@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, Roman Bolshakov <r.bolshakov@yadro.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [RFC v17 10/14] i386: split tcg btp_helper into softmmu and user parts
Date: Thu, 11 Feb 2021 12:48:30 +0100	[thread overview]
Message-ID: <8df76510-3478-f315-bc84-bee6ddebdaa5@suse.de> (raw)
In-Reply-To: <79bbf2f3-1345-8102-eab2-b5e8c2528c68@amsat.org>

On 2/11/21 11:39 AM, Philippe Mathieu-Daudé wrote:
> On 2/11/21 11:07 AM, Claudio Fontana wrote:
>> On 2/10/21 5:28 PM, Alex Bennée wrote:
>>>
>>> Claudio Fontana <cfontana@suse.de> writes:
>>>
>>> s/btp/bpt/ in subject line...
>>>
>>>> Signed-off-by: Claudio Fontana <cfontana@suse.de>
>>>> ---
>>>>  target/i386/tcg/helper-tcg.h                 |   3 +
>>>>  target/i386/tcg/bpt_helper.c                 | 275 -----------------
>>>>  target/i386/tcg/softmmu/bpt_helper_softmmu.c | 293 +++++++++++++++++++
>>>>  target/i386/tcg/user/bpt_helper_user.c       |  33 +++
>>>
>>> So I'm not sure about totally mirroring the file names in softmmu/user
>>> subdirs. I can see it makes sense in some cases where there are genuine
>>> functional differences between the two. However for everything that
>>> exists only for one mode we might as well throw the stubs into one file.
>>> Maybe target/tcg/user/stubs.c in this case?
>>
>>
>> Hi Alex, I think you are right, repeating the _softmmu , _user seems too much.
>>
>> On similar things in the past Paolo mentioned that he favours simpler naming.
>>
>> In this case I could do for example:
>>
>> target/i386/tcg/seg_helper.c          - seg helper common parts
>> target/i386/tcg/softmmu/seg_helper.c  - seg helper softmmu-only code
>> target/i386/tcg/user/seg_helper.c     - seg helper user-only code
> 
> What about:
> 
>   target/i386/tcg/seg_helper.c          - seg helper common parts
>   target/i386/tcg/seg_helper_softmmu.c  - seg helper softmmu-only code
>   target/i386/tcg/seg_helper_user.c     - seg helper user-only code

Hi Philippe,

I tried this one in particular, it looked a bit confusing and cluttered to me when looking at the overall result:

$ ls
bpt_helper.c
bpt_helper_softmmu.c
bpt_helper_user.c
cc_helper.c
cc_helper_softmmu.c
cc_helper_template.h
cc_helper_user.c
excp_helper.c
excp_helper_softmmu.c
excp_helper_user.c
fpu_helper.c
fpu_helper_softmmu.c
fpu_helper_user.c
helper-tcg.h
int_helper.c
int_helper_softmmu.c
int_helper_user.c
mem_helper.c
mem_helper_softmmu.c
mem_helper_user.c
meson.build
misc_helper.c
misc_helper_softmmu.c
misc_helper_user.c
mpx_helper.c
mpx_helper_softmmu.c
mpx_helper_user.c
seg_helper.c
seg_helper.h
seg_helper_softmmu.c
seg_helper_user.c
tcg-cpu.c
tcg-cpu.h
tcg-cpu-softmmu.c
tcg-cpu-user.c
tcg-stub.c
translate.c


> 
>> For the parts that are just stubs really (like here bpt for user), I would like to see if I can remove them completely if possible..
> 
> It is probably worth spend time on this first. If the helpers are not
> needed, why do we generate the code in the first place?

Worth a good look.

> 
>>
>> Overall though, I am wondering whether this kind of change (extended more to the rest of the target/ code) is an interesting approach,
>> or does it make harder to work with the *_helper code, as people have to chase down more files?
>>
>>
>> Thank you!
>>
>> Claudio

Thanks,

Claudio


  reply	other threads:[~2021-02-11 11:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10 15:28 [RFC v17 00/14] i386 cleanup PART 2 Claudio Fontana
2021-02-10 15:28 ` [RFC v17 01/14] i386: split cpu accelerators from cpu.c, using AccelCPUClass Claudio Fontana
2021-02-10 15:28 ` [RFC v17 02/14] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn Claudio Fontana
2021-02-10 15:28 ` [RFC v17 03/14] accel: introduce new accessor functions Claudio Fontana
2021-02-10 15:28 ` [RFC v17 04/14] target/i386: fix host_cpu_adjust_phys_bits error handling Claudio Fontana
2021-02-10 15:28 ` [RFC v17 05/14] accel-cpu: make cpu_realizefn return a bool Claudio Fontana
2021-02-10 15:28 ` [RFC v17 06/14] meson: add target_user_arch Claudio Fontana
2021-02-10 15:28 ` [RFC v17 07/14] i386: split user and softmmu functionality in tcg-cpu Claudio Fontana
2021-02-10 15:28 ` [RFC v17 08/14] i386: split smm helper (softmmu) Claudio Fontana
2021-02-10 15:28 ` [RFC v17 09/14] i386: split tcg excp_helper into softmmu and user parts Claudio Fontana
2021-02-10 15:28 ` [RFC v17 10/14] i386: split tcg btp_helper " Claudio Fontana
2021-02-10 16:28   ` Alex Bennée
2021-02-11 10:07     ` Claudio Fontana
2021-02-11 10:39       ` Philippe Mathieu-Daudé
2021-02-11 11:48         ` Claudio Fontana [this message]
2021-02-10 15:28 ` [RFC v17 11/14] i386: split misc helper into user and softmmu parts Claudio Fontana
2021-02-10 15:28 ` [RFC v17 12/14] i386: separate fpu_helper " Claudio Fontana
2021-02-10 15:28 ` [RFC v17 13/14] i386: slit svm_helper into softmmu and stub-only user Claudio Fontana
2021-02-10 15:28 ` [RFC v17 14/14] i386: split seg_helper into user-only and softmmu parts Claudio Fontana
2021-02-11 11:11 ` [RFC v17 00/14] i386 cleanup PART 2 no-reply

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=8df76510-3478-f315-bc84-bee6ddebdaa5@suse.de \
    --to=cfontana@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).