Patch "x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     x86-hyperv-fix-struct-hv_enlightened_vmcs-definition.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c109ce8e9d10060efd9f604213b2281c4ae5bc50
Author: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
Date:   Tue Aug 30 15:37:05 2022 +0200

    x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition
    
    [ Upstream commit ea9da788a61e47e7ab9cbad397453e51cd82ac0d ]
    
    Section 1.9 of TLFS v6.0b says:
    
    "All structures are padded in such a way that fields are aligned
    naturally (that is, an 8-byte field is aligned to an offset of 8 bytes
    and so on)".
    
    'struct enlightened_vmcs' has a glitch:
    
    ...
            struct {
                    u32                nested_flush_hypercall:1; /*   836: 0  4 */
                    u32                msr_bitmap:1;         /*   836: 1  4 */
                    u32                reserved:30;          /*   836: 2  4 */
            } hv_enlightenments_control;                     /*   836     4 */
            u32                        hv_vp_id;             /*   840     4 */
            u64                        hv_vm_id;             /*   844     8 */
            u64                        partition_assist_page; /*   852     8 */
    ...
    
    And the observed values in 'partition_assist_page' make no sense at
    all. Fix the layout by padding the structure properly.
    
    Fixes: 68d1eb72ee99 ("x86/hyper-v: define struct hv_enlightened_vmcs and clean field bits")
    Reviewed-by: Maxim Levitsky <mlevitsk@xxxxxxxxxx>
    Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
    Signed-off-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
    Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220830133737.1539624-2-vkuznets@xxxxxxxxxx
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h
index 2322d6bd5883..b54b3e18d94b 100644
--- a/arch/x86/include/asm/hyperv-tlfs.h
+++ b/arch/x86/include/asm/hyperv-tlfs.h
@@ -529,7 +529,7 @@ struct hv_enlightened_vmcs {
 	u64 guest_rip;
 
 	u32 hv_clean_fields;
-	u32 hv_padding_32;
+	u32 padding32_1;
 	u32 hv_synthetic_controls;
 	struct {
 		u32 nested_flush_hypercall:1;
@@ -537,7 +537,7 @@ struct hv_enlightened_vmcs {
 		u32 reserved:30;
 	}  __packed hv_enlightenments_control;
 	u32 hv_vp_id;
-
+	u32 padding32_2;
 	u64 hv_vm_id;
 	u64 partition_assist_page;
 	u64 padding64_4[4];



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux