Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1030489pxb; Fri, 15 Apr 2022 18:57:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMRRkWSD5Mc2UHaum7u93VsJgxfPvcd+6wEqvyhMgVnXDNxbmY8c5JLeWS+m+V2yjJcyuZ X-Received: by 2002:a17:902:6b87:b0:158:a0d9:9bd with SMTP id p7-20020a1709026b8700b00158a0d909bdmr1466006plk.156.1650074237724; Fri, 15 Apr 2022 18:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074237; cv=none; d=google.com; s=arc-20160816; b=0j472lbCBMOnji5WKMceu78HCQmCYfj/CuYck5kBe1kWmR8/XV94/Kq9/Rf4SRyzZF Pw00Jc2rDxvF5bnsMpCV1J9OpebpNepQNXmMpwWhFWYSVvsmomXoTjsVqRDYbShXgRbm tlKt75PwJwBeLzgs1j0ySvqlH7AtVRO9IiBW9A7g3bpYzVLAJkH+a4yYxYStE91WDSz9 xHk3/8+Kma/RAuJ+3eTsRizngGGwwl3WL9+OhtuH6hTh1PjVZgqcDLMqx+1ernFXJEjw 5R8/pxwqZZGOLOZfjF6zSxbodIYyC1j/U6cpECrGPJC9WyH6pDp2oPxq+Gnw0jcS8QZO D4lg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ymMl8hA8K/esTw1tg/apm+DYb9LQJWsl4/Hevby8goQ=; b=pyev9JYDz6UcuRslJ92hQoS7uWKxF8paqOiJ0PAhF71KkisFru+5PHgKEA8aH8cnQI EIrknKKZ71mhvWf4LVheEWnK/q3jpt3E9bMIlMyKZZXiFe6c9rUuD7esogiXBy0CxcHn w5SB+zeYquJ+lfqkcZPp5vSulT5bKQtXG0qvurtLGs6y/MENSUmHvN4dpwRM/KfOgVwR NU5zwC7GEy5EAtNKH0kS6nHallz7Rf9oO7ZezXou0bHWkupE+nPjfzwXYr1KI9ueXjTK JCywM5pW8lTXS/t+5HP9rPZJaC238XZdQGF7aN1IsIqzaLK09MekW8YfDODdQngf3woK 21TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qc7WmYkJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h71-20020a63834a000000b00399028c6b02si2837535pge.179.2022.04.15.18.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:57:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qc7WmYkJ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3B26C13C708; Fri, 15 Apr 2022 18:17:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344118AbiDNNjz (ORCPT + 99 others); Thu, 14 Apr 2022 09:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244906AbiDNN2P (ORCPT ); Thu, 14 Apr 2022 09:28:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 997DDA7771 for ; Thu, 14 Apr 2022 06:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649942477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ymMl8hA8K/esTw1tg/apm+DYb9LQJWsl4/Hevby8goQ=; b=Qc7WmYkJ/XDUFJQUxy3fUOtuVYsSOknpTY5mf6Ekz6fxbwo7MKknsLoHXAzrvg+fddAxEi x+T5fBXJmRHaGbVriX6JO3p1mCfl/TQOoMVXOKIy7lhj1rjBHtKXxSMoKd/p0LgzT5TArb yOe2idevwhJFwG1qADsUd+v4O+ABV8c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-480-9uE9hCFMNhWH1RBS7kJ8pQ-1; Thu, 14 Apr 2022 09:21:12 -0400 X-MC-Unique: 9uE9hCFMNhWH1RBS7kJ8pQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39C212A5957A; Thu, 14 Apr 2022 13:20:53 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.195.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A01C7C28; Thu, 14 Apr 2022 13:20:51 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 18/34] x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition Date: Thu, 14 Apr 2022 15:19:57 +0200 Message-Id: <20220414132013.1588929-19-vkuznets@redhat.com> In-Reply-To: <20220414132013.1588929-1-vkuznets@redhat.com> References: <20220414132013.1588929-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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: Michael Kelley Signed-off-by: Vitaly Kuznetsov --- 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 5225a85c08c3..e7ddae8e02c6 100644 --- a/arch/x86/include/asm/hyperv-tlfs.h +++ b/arch/x86/include/asm/hyperv-tlfs.h @@ -548,7 +548,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; @@ -556,7 +556,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]; -- 2.35.1