Skip to content

Commit

Permalink
iommu/amd: Fix union of bitfields in intcapxt support
Browse files Browse the repository at this point in the history
All the bitfields in here are overlaid on top of each other since
they're a union. Change the second u64 to be in a struct so it does
the intended thing.

Fixes: b5c3786 ("iommu/amd: Use msi_msg shadow structs")
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
dwmw2 authored and KAGA-KOKO committed Nov 11, 2020
1 parent aec8da0 commit 2fb6acf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/iommu/amd/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1967,13 +1967,15 @@ static int iommu_setup_msi(struct amd_iommu *iommu)

union intcapxt {
u64 capxt;
u64 reserved_0 : 2,
dest_mode_logical : 1,
reserved_1 : 5,
destid_0_23 : 24,
vector : 8,
reserved_2 : 16,
destid_24_31 : 8;
struct {
u64 reserved_0 : 2,
dest_mode_logical : 1,
reserved_1 : 5,
destid_0_23 : 24,
vector : 8,
reserved_2 : 16,
destid_24_31 : 8;
};
} __attribute__ ((packed));

/*
Expand Down

0 comments on commit 2fb6acf

Please sign in to comment.