Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6818048rwi; Mon, 24 Oct 2022 06:32:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6IBbi5Q/H310lpHVoIsIOqj9dMUXZh85nRrWCLJSPM6y9LK5NtMcbWOTH0ViCw5enEGABz X-Received: by 2002:a17:906:4fca:b0:78d:b042:eeca with SMTP id i10-20020a1709064fca00b0078db042eecamr26626760ejw.685.1666618325127; Mon, 24 Oct 2022 06:32:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618325; cv=none; d=google.com; s=arc-20160816; b=twZ46aIo0k5LlyatgQV5DHkboKZElkBRZ4+ABC6gFJNTdBGx5I4ZrqOfXfRgb1wCzv MhlvgKL8DFL3RTYWFUO6W2UTPDIlq0qVIbZLLurhRCODAl1mlr+vKt33ePB6M9d2rAoc EbZeP7zI7GC7XejHC36dM3Ke8goTQf9D7Hv3b6jXnulyrill3hOrjINCZPgreDvW+f7B fmylS4yPK3qfIei1iaau1s9TrJB0+NcDQh/ILrQd2sCt4qNAL51unaIi9/bh2XpJvpGu psU0qaBUo4e6XAUtBApRvNpxlTcsGISAlYgpccBAQJp78XjhEsos1uC6Bi04V6ZfR4/k z+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8rRmmPRy5vnqeKjgu2GVAIu0qw/osPYHd20kUWrPW04=; b=pw2FWwbNz4saoouaaJbQGaMekLkwpcYk21Ip8Ii0UKXrXNWQvC+yFbbAr3ezf7Vgwr jV/R+V9LH31pCNMncgpCbH9cWTyvj6QTuFMNY15hNaEVFuFj72Ia17CyAND14rE30qdx WicwHW2m4RaBaYOB2qMT+Jg8JirRlI8IMD5C6DPcrEj+RZvSiSqUt2WJVHIZ5eEXH9Jn nlsCZDoCWvMkyjNvez18E18oruO5+1jskO8XFD2TNodCHRf7V7GLxZx1WZ7wX4fQ1nxL zEUZTMrIIo2lP/cd/k0dxTaQelkZhUHxQPDgp10cunzvQv5+3EmxzqykdRnT4bqykSyw Xlgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vtL4AwDL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz42-20020a1709077daa00b0077ed84da316si29479017ejc.217.2022.10.24.06.31.40; Mon, 24 Oct 2022 06:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vtL4AwDL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233897AbiJXMhn (ORCPT + 99 others); Mon, 24 Oct 2022 08:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233885AbiJXMbc (ORCPT ); Mon, 24 Oct 2022 08:31:32 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D5071B7B9; Mon, 24 Oct 2022 05:04:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ED2F8B811BD; Mon, 24 Oct 2022 12:01:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 472C3C433D6; Mon, 24 Oct 2022 12:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612901; bh=U9hmnfSWoenhvdy2bUmTLhdEgICpln2VqpEzU8ILty0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vtL4AwDLcrrSCDC8i2a+6MAdWPBoqAFuGWzC0l795KKzV0E7W6pYfacwq0xJwlm4j cnWyA3kpkkhq98w4fWqLBxJ4pYyw/pwjFH3PFVhrXUrFcb9oCsP3EcaVZJkpr2eYos Cnx2atOoWelDJq01/qhtIgQWJtUahWOTktCv0zDo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Levitsky , Michael Kelley , Vitaly Kuznetsov , Sean Christopherson , Paolo Bonzini , Sasha Levin Subject: [PATCH 4.19 163/229] x86/hyperv: Fix struct hv_enlightened_vmcs definition Date: Mon, 24 Oct 2022 13:31:22 +0200 Message-Id: <20221024113004.332368675@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov [ 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 Reviewed-by: Michael Kelley Signed-off-by: Vitaly Kuznetsov Signed-off-by: Sean Christopherson Link: https://lore.kernel.org/r/20220830133737.1539624-2-vkuznets@redhat.com Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/include/asm/hyperv-tlfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h index 00e01d215f74..e1bd23641fc6 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -682,7 +682,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; @@ -690,7 +690,7 @@ struct hv_enlightened_vmcs { u32 reserved:30; } hv_enlightenments_control; u32 hv_vp_id; - + u32 padding32_2; u64 hv_vm_id; u64 partition_assist_page; u64 padding64_4[4]; -- 2.35.1