All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: Supporting clang on windows
Date: Mon, 25 Nov 2024 07:31:13 +0100	[thread overview]
Message-ID: <2f9c5255-a6cf-4b39-bdc5-eaca63ce11da@redhat.com> (raw)
In-Reply-To: <ae79e5a8-d875-41c5-ace0-911be633d8c5@linaro.org>

On 24/11/2024 13.28, Philippe Mathieu-Daudé wrote:
> On 24/11/24 01:21, Pierrick Bouvier wrote:
>> Hi all,
> 
> 
>> After thinking about it, a simple, exhaustive and reliable way to find 
>> this type information is the debug (dwarf) info.
>> By compiling qemu binaries with --enable-debug, and extracting info using 
>> llvm-dwarfdump plus a custom filter [4], we can obtain a text 
>> representation of all structures QEMU uses.
>>
>> As expected, turning the option globally has an effect. The exact list of 
>> structures impacted (those having bitfields, and not being packed) can be 
>> seen for each binary here: [5].
>> As there is a lot of repetition between all qemu binaries, the reduced 
>> list of structs concerned is [6]:
>> +name:ArduinoMachineClass size:0x0198
>> +name:ARMCacheAttrs size:0x04
>> +name:ARMVAParameters size:0x04
>> +name:AspeedMachineClass size:0x01d0
>> +name:_GIOChannel size:0x70
>> +name:MachineClass size:0x0188
>> +name:MicrovmMachineClass size:0x01a0
>> +name:MPS2MachineClass size:0x01a8
>> +name:MPS2TZMachineClass size:0x01e8
>> +name:MPS3RMachineClass size:0x01a0
>> +name:MuscaMachineClass size:0x01a8
>> +name:NPCM7xxMachineClass size:0x0190
>> +name:PCMachineClass size:0x01c0
>> +name:PnvMachineClass size:0x01b0
>> +name:PPCE500MachineClass size:0x01e0
>> +name:RaspiBaseMachineClass size:0x0190
>> +name:RxGdbSimMachineClass size:0x0198
>> +name:S390CcwMachineClass size:0x0190
>> +name:SpaprMachineClass size:0x01d0
>> +name:Sun4mMachineClass size:0x0190
>> +name:TriBoardMachineClass size:0x01a0
>> +name:VexpressMachineClass size:0x0190
>> +name:VirtMachineClass size:0x01a0
>> +name:X86MachineClass size:0x0190
> 
> The *MachineClass ones come from [*]:
> 
>    struct MachineClass {
>        ...
>        unsigned int no_serial:1,
>            no_parallel:1,
>            no_floppy:1,
>            no_cdrom:1,
>            no_sdcard:1,
>            pci_allow_0_address:1,
>            legacy_fw_cfg_order:1;
> 
> IMHO Using bitfield to manually micro-optimize memory size seems
> a bit a waste of developer time/focus, I'd rather see compilers
> doing that for us.
> 
> Regards,
> 
> Phil.
> 
> [*] Interestingly Thomas is also looking at those fields:
> 
> https://lore.kernel.org/qemu-devel/20241122084923.1542743-1-thuth@redhat.com/

Yes, I got curious by the msbitfield discussion last week and remembered 
that we had a look at the differences of the structs with "pahole" in the 
past already, so I wondered what might be the difference nowadays, and the 
machine class is the most prominent difference, indeed, that's why I came up 
with that patch.

  Thomas



  parent reply	other threads:[~2024-11-25  6:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-24  0:21 Supporting clang on windows Pierrick Bouvier
2024-11-24 12:10 ` Paolo Bonzini
2024-11-24 20:23   ` Pierrick Bouvier
2024-11-25  7:00     ` Paolo Bonzini
2024-11-25  9:34       ` Daniel P. Berrangé
2024-11-25  9:39         ` Paolo Bonzini
2024-11-25 10:42           ` Peter Maydell
2024-11-25 11:19           ` Thomas Huth
2024-11-25 16:48             ` Pierrick Bouvier
2024-11-25 17:05               ` Peter Maydell
2024-11-25 21:47                 ` Pierrick Bouvier
2024-11-26 21:24                   ` Pierrick Bouvier
2024-11-25 16:55       ` Pierrick Bouvier
2024-11-25  7:15     ` Thomas Huth
2024-11-24 12:28 ` Philippe Mathieu-Daudé
2024-11-24 20:24   ` Pierrick Bouvier
2024-11-25  6:31   ` Thomas Huth [this message]
2024-11-25 14:04 ` Richard Henderson
2024-11-25 16:19   ` Pierrick Bouvier

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=2f9c5255-a6cf-4b39-bdc5-eaca63ce11da@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.