Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp480273rwb; Tue, 4 Oct 2022 06:44:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64cF8qBhwtcG7TSuUCDvJ/NauMX+gUqz/HJeJ9JW0JWJF8hbGsBY/Jdkya8KkyjYjZBdd0 X-Received: by 2002:a05:6402:3786:b0:451:24da:f8c9 with SMTP id et6-20020a056402378600b0045124daf8c9mr23514181edb.250.1664891054689; Tue, 04 Oct 2022 06:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664891054; cv=none; d=google.com; s=arc-20160816; b=ZGNYTjzkT38U3sMIRx8xuztKmpSvSbQ4OqUbWhL8DncIYeUgiA+6jDiejv+IUb3NjZ rompYktn5GXexK/qtL1Hiz8GKC5ujm3ScFl7/AEqboFin9eJIKh1nKRYXGsEBCy6tHoD jZrKGuvVgDnkLsE/mc7+lvH8kVxSq4g7mhRCtjYvz1dHdZoXWoNTQLxsdwTck5aggoG6 LnBkkFTIk+OjrXU/z0amH3aQWkugvV/IYcSaApAKvCTY8dbiwkJ7rm78Onjbhsvt1b6x EJVs2gkzGuZi1ECGMqcgghyykom//XJkWc9/R1L99qB3ODDbwsqwvPrfnu45nXRgilO1 i+rA== 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=xjfiBlRnH5bRxvhiJsegFt2pqquYJdUJUbrJQOgmVu0=; b=CGPwGHp4hNZYM2VNmQylp5t+vTXcaFt8uMaHm1zV0g1yfZa9ROrtHuDTHSkqi0cHJi 2brdl4/UUrwccJpX3CHp5j3cJ2UxwKY5SwLYGX+3efLOMYam3cwGmHcFdb2vUH1IaNAe g8vCiwygya8fmumIri6YU1Dt3goEN0MXmn41SSmkHrlFQssBh67CaAPGGdf5bCPId8Xp QAZihbwZ50FbroXV0wD3hzeoO/8sxBAu0vc3gkOzgoPf8OWVu/wWpbyHkPTINj6bZF+q 0p9G/pYSLDh33nlw9vFL9+JGYb3VRNm5z0kZJ5bAStOzIZP1VYmRZtrEq8T7dxLQDTsI 8hlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cDJJdFz4; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la9-20020a170907780900b0073d71124609si9163818ejc.182.2022.10.04.06.43.49; Tue, 04 Oct 2022 06:44:14 -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=@redhat.com header.s=mimecast20190719 header.b=cDJJdFz4; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229641AbiJDMwl (ORCPT + 99 others); Tue, 4 Oct 2022 08:52:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiJDMwI (ORCPT ); Tue, 4 Oct 2022 08:52:08 -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 ESMTPS id 0F51B10573 for ; Tue, 4 Oct 2022 05:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664887722; 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=xjfiBlRnH5bRxvhiJsegFt2pqquYJdUJUbrJQOgmVu0=; b=cDJJdFz4kWE1XPlq1m5llzKFLHaHsqvXtbbR0y68OXNopGsvwxbvNxy3WCdh/aS2RQgB7b 0dZ1i0RlMkEWtFXmhsScx6VarR0W2AjWD9SfYkDxeF3MNJYvWzWyOgBaGgiY0As8yXkr18 3ccNiAomO/nlQ87OikFKADffUhHLF7Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-310-FzFAOcUQMpe5mHHG0-amTw-1; Tue, 04 Oct 2022 08:41:35 -0400 X-MC-Unique: FzFAOcUQMpe5mHHG0-amTw-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 CA55885A5A6; Tue, 4 Oct 2022 12:41:34 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 572537AE5; Tue, 4 Oct 2022 12:41:32 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini , Sean Christopherson Cc: Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v11 38/46] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Tue, 4 Oct 2022 14:39:48 +0200 Message-Id: <20221004123956.188909-39-vkuznets@redhat.com> In-Reply-To: <20221004123956.188909-1-vkuznets@redhat.com> References: <20221004123956.188909-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 'struct hv_enlightened_vmcs' definition in selftests is not '__packed' and so we rely on the compiler doing the right padding. This is not obvious so it seems beneficial to use the same definition as in kernel. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/include/x86_64/evmcs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kvm/include/x86_64/evmcs.h b/tools/testing/selftests/kvm/include/x86_64/evmcs.h index 58db74f68af2..4b6840df2979 100644 --- a/tools/testing/selftests/kvm/include/x86_64/evmcs.h +++ b/tools/testing/selftests/kvm/include/x86_64/evmcs.h @@ -41,6 +41,8 @@ struct hv_enlightened_vmcs { u16 host_gs_selector; u16 host_tr_selector; + u16 padding16_1; + u64 host_ia32_pat; u64 host_ia32_efer; @@ -159,7 +161,7 @@ struct hv_enlightened_vmcs { u64 ept_pointer; u16 virtual_processor_id; - u16 padding16[3]; + u16 padding16_2[3]; u64 padding64_2[5]; u64 guest_physical_address; @@ -195,13 +197,13 @@ 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; u32 msr_bitmap:1; u32 reserved:30; - } hv_enlightenments_control; + } __packed hv_enlightenments_control; u32 hv_vp_id; u32 padding32_2; u64 hv_vm_id; @@ -222,7 +224,7 @@ struct hv_enlightened_vmcs { u64 host_ssp; u64 host_ia32_int_ssp_table_addr; u64 padding64_6; -}; +} __packed; #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_NONE 0 #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_IO_BITMAP BIT(0) -- 2.37.3