qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>,
	Pierrick Bouvier <pierrick.bouvier@linaro.org>,
	qemu-devel@nongnu.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Stefano Garzarella" <sgarzare@redhat.com>
Subject: Re: [PATCH v3 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures
Date: Tue, 10 Dec 2024 11:10:58 +0100	[thread overview]
Message-ID: <1424773d-1e06-4581-bd5b-6b216e4bad5b@linaro.org> (raw)
In-Reply-To: <a88854b4-5004-4734-9fc4-6f34eafba5a9@redhat.com>

On 10/12/24 08:52, Thomas Huth wrote:
> On 09/12/2024 21.33, Philippe Mathieu-Daudé wrote:
>> On 28/11/24 21:15, Pierrick Bouvier wrote:
>>> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
> ...
>>> +For this reason, we disallow usage of bitfields in packed structures 
>>> and in any
>>> +structures which are supposed to exactly match a specific layout in 
>>> guest
>>> +memory. Some existing code may use it, and we carefully ensured the 
>>> layout was
>>> +the one expected.
>>> +
>>> +We also suggest avoiding bitfields even in structures where the exact
>>> +layout does not matter, unless you can show that they provide a 
>>> significant
>>> +memory usage or usability benefit.
>>
>> I don't think we should mention "significant memory usage benefit".
> 
> Why not? That's the point of bitfields, isn't it? Or do you mean it's 
> included in "usability benefit" already?

To not generate a reactance effect :) Developers trying to optimize
memory usage via bit field uses is extremely rare (at least in the
QEMU community).

Anyhow, I don't object to this patch as is.


  reply	other threads:[~2024-12-10 10:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 20:15 [PATCH v3 0/3] Enable clang build on Windows Pierrick Bouvier
2024-11-28 20:15 ` [PATCH v3 1/3] win32: remove usage of attribute gcc_struct Pierrick Bouvier
2024-11-28 21:01   ` Richard Henderson
2024-11-28 20:15 ` [PATCH v3 2/3] docs/devel/style: add a section about bitfield, and disallow them for packed structures Pierrick Bouvier
2024-11-28 21:02   ` Richard Henderson
2024-12-09 20:33   ` Philippe Mathieu-Daudé
2024-12-09 22:15     ` Pierrick Bouvier
2024-12-10  7:52     ` Thomas Huth
2024-12-10 10:10       ` Philippe Mathieu-Daudé [this message]
2024-12-10 18:45         ` Pierrick Bouvier
2024-11-28 20:15 ` [PATCH v3 3/3] plugins: enable linking with clang/lld Pierrick Bouvier
2025-01-10  8:03   ` Philippe Mathieu-Daudé
2024-12-09 18:34 ` [PATCH v3 0/3] Enable clang build on Windows 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=1424773d-1e06-4581-bd5b-6b216e4bad5b@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=erdnaxe@crans.org \
    --cc=ma.mandourr@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --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).