Bug 4508 - x86/paravirt: Ensure proper alignment
Summary: x86/paravirt: Ensure proper alignment
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: virt (show other bugs) virt
Version: 5.10.y-9
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-14 14:18 UTC by YTFD-oa
Modified: 2023-03-14 14:18 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YTFD-oa 2023-03-14 14:18:50 UTC
Description of problem:
x86/paravirt: Ensure proper alignment
    
The entries in the .parainstructions sections are 8 byte aligned and the
corresponding C struct paravirt_patch_site makes the array offset 16
bytes.

Though the pushed entries are only using 12 bytes, __parainstructions_end
is therefore 4 bytes short.

That works by chance because it's only used in a loop:

        for (p = start; p < end; p++)

But this falls flat when calculating the number of elements:

    n = end - start

That's obviously off by one.

Ensure that the gap is filled and the last entry is occupying 16 bytes.

see upstream: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f92ff8f5dca2acfa475842c71212657b0703c3be