lkml.org 
[lkml]   [2020]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/3] iommu/amd: Fix union of bitfields in intcapxt support
    Date
    From: David Woodhouse <dwmw@amazon.co.uk>

    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: b5c3786ee3704 ("iommu/amd: Use msi_msg shadow structs")
    Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
    ---
    drivers/iommu/amd/init.c | 16 +++++++++-------
    1 file changed, 9 insertions(+), 7 deletions(-)

    diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c
    index 90a8add186e0..a94b96f1e13a 100644
    --- a/drivers/iommu/amd/init.c
    +++ b/drivers/iommu/amd/init.c
    @@ -1969,13 +1969,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));

    /*
    --
    2.26.2
    \
     
     \ /
      Last update: 2020-11-11 15:44    [W:4.159 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site