From: Jan Beulich <jbeulich@suse.com>
To: Andrii Sultanov <sultanovandriy@gmail.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t
Date: Mon, 17 Mar 2025 17:17:16 +0100 [thread overview]
Message-ID: <6d1d75f5-2884-4e93-b4e2-3ea9c2f4b6a4@suse.com> (raw)
In-Reply-To: <3dfb3e32d06f204f9eb2087ea0d570140c95feda.1742063500.git.sultanovandriy@gmail.com>
On 16.03.2025 11:08, Andrii Sultanov wrote:
> Following a similar change to amd_iommu struct, make two more structs
> take pci_sbdf_t directly instead of seg and bdf separately. This lets us
> drop several conversions from the latter to the former and simplifies
> several comparisons and assignments.
>
> Signed-off-by: Andrii Sultanov <sultanovandriy@gmail.com>
>
> ---
>
> This particular commit does not have any effect on code size:
> add/remove: 0/0 grow/shrink: 2/6 up/down: 96/-96 (0)
> Function old new delta
> _einittext 22092 22156 +64
I'm puzzled by this: _einittext being last (and not itself a function);
how can it grow? What follows it (as per the linker script) is
.altinstr_replacement, yet I wouldn't expect that to change in size.
> --- a/xen/drivers/passthrough/amd/iommu.h
> +++ b/xen/drivers/passthrough/amd/iommu.h
> @@ -268,7 +268,13 @@ int cf_check amd_setup_hpet_msi(struct msi_desc *msi_desc);
> void cf_check amd_iommu_dump_intremap_tables(unsigned char key);
>
> extern struct ioapic_sbdf {
> - u16 bdf, seg;
> + union {
> + struct {
> + uint16_t bdf;
> + uint16_t seg;
> + };
> + pci_sbdf_t sbdf;
> + };
> u8 id;
> bool cmdline;
> u16 *pin_2_idx;
> @@ -279,7 +285,14 @@ unsigned int ioapic_id_to_index(unsigned int apic_id);
> unsigned int get_next_ioapic_sbdf_index(void);
>
> extern struct hpet_sbdf {
> - u16 bdf, seg, id;
> + union {
> + struct {
> + uint16_t bdf;
> + uint16_t seg;
> + };
> + pci_sbdf_t sbdf;
> + };
> + uint16_t id;
> enum {
> HPET_NONE,
> HPET_CMDL,
Oh, yet more fragile aliasing. No, please don't. Just have a single pci_sbdf_t
there.
Jan
prev parent reply other threads:[~2025-03-17 16:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-16 10:08 [PATCH v2 0/3] drivers: Simplify handling of pci_sbdf_t in passthrough/amd Andrii Sultanov
2025-03-16 10:08 ` [PATCH v2 1/3] drivers: Change amd_iommu struct to contain pci_sbdf_t, simplify code Andrii Sultanov
2025-03-17 15:55 ` Jan Beulich
2025-03-16 10:08 ` [PATCH v2 2/3] drivers: Change find_iommu_for_device function to take " Andrii Sultanov
2025-03-17 16:07 ` Jan Beulich
2025-03-16 10:08 ` [PATCH v2 3/3] drivers: Make ioapic_sbdf and hpet_sbdf contain pci_sbdf_t Andrii Sultanov
2025-03-17 16:17 ` Jan Beulich [this message]
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=6d1d75f5-2884-4e93-b4e2-3ea9c2f4b6a4@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=roger.pau@citrix.com \
--cc=sultanovandriy@gmail.com \
--cc=xen-devel@lists.xenproject.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.