Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp369252imn; Wed, 3 Aug 2022 07:21:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sDeYi0b5VX6Ut47vvrbRss0zfjw2ER3iz2a9s35FMtp4cT4ETUoJz+LZEgkkTADo9GLc9u X-Received: by 2002:a05:6a00:2193:b0:52b:f97b:ac6 with SMTP id h19-20020a056a00219300b0052bf97b0ac6mr26092921pfi.44.1659536518908; Wed, 03 Aug 2022 07:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659536518; cv=none; d=google.com; s=arc-20160816; b=mJ+ozEQJqAbgGzncckUpCk8LDdA+CtMF3OghPxpkn3VMXn8z9BrSAcKTmlbcmA7UVo oUlGiitfTHLHB/YZzbqOI5XnKzPyaBBt/opADNKNeTFLriE2DHzEwFExAobF2Gh5idOx ehwLiD9CA4Lwco/CR6BY1Xlp/3j87mAe4D+xYjbA8sZvs4opTFkH9XVATFoPFt0OasyX hLUWO4wsDjfCXWc15sIqFN3MpgxSV7ClFODZHjB4LvOvKHi+ncpZnccKyBMCjHmZsWwp T5jMVZ8YlPCdWXoAeOEjD96UjPRQ69N+X/wbDYfhtRLjDBEqvjURkJMiv8xtI1xqnc5h o/Qg== 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=Po6X1qwbVSYYhUlpNcgBCTKJG7wN/6Y9NKjEXzUYKYY=; b=t7Pe1YQNug97fsnE0XmHPqYzQqc4zhTczNjZEikfHSZhxsaaUDE+gobtqqhNvRQRA5 TvpA52rFuegnJUGhwq+nceJ/fyrARq+jJvM68NSmjfNDBLZIU1dnO5HfYV9/Iaxg9VrI FcghF2vr64zjsdLMCkcWHrZ3+qXYc9e7/i3WSl6mZ27fAh+REvZj8fFdN4EM9qQqfjW3 gkJyGZIF387/d6m4MBboIjWiT6+aqqdRjoRpD5Fpvmep6EAMh/+u/lNRHg4DWs5RJdyJ Dg2yVd6FVOlnubZt7wbWHwMsLKrLIb39k7n2Q/SVpch2+rv+CFQiVfm/BK4dHlEOADwn WwqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hGK89Tsv; 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 k14-20020a170902760e00b0016d572968fcsi2220331pll.118.2022.08.03.07.21.43; Wed, 03 Aug 2022 07:21:58 -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=hGK89Tsv; 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 S238393AbiHCNss (ORCPT + 99 others); Wed, 3 Aug 2022 09:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238261AbiHCNsL (ORCPT ); Wed, 3 Aug 2022 09:48:11 -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 87D7443E49 for ; Wed, 3 Aug 2022 06:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659534416; 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=Po6X1qwbVSYYhUlpNcgBCTKJG7wN/6Y9NKjEXzUYKYY=; b=hGK89TsvyiYoSvmfzhCTl795ZiWUnNpCKE5yXx32ptRXzoBIev4Mrwbgl/Q80UueonajiL E8+d6CZUMpGzgJA2UqyrdxzW+SCp2GjEoq9UlXKx/f/Uihj+6v1byj1pt3BkaoBGizXfja WvnzBQXXDQ4XNh2EoQ56tbvVWbm9ZFM= 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-356-0B5yUDPJPxOmbY64PJ4f_A-1; Wed, 03 Aug 2022 09:46:53 -0400 X-MC-Unique: 0B5yUDPJPxOmbY64PJ4f_A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D623B280EE2F; Wed, 3 Aug 2022 13:46:52 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.195.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4FAE141510F; Wed, 3 Aug 2022 13:46:50 +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 v9 32/40] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Wed, 3 Aug 2022 15:46:50 +0200 Message-Id: <20220803134650.399509-1-vkuznets@redhat.com> In-Reply-To: <20220803134110.397885-1-vkuznets@redhat.com> References: <20220803134110.397885-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-2.7 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=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 '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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/kvm/include/x86_64/evmcs.h b/tools/testing/selftests/kvm/include/x86_64/evmcs.h index 3c9260f8e116..367e027cd2a4 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,15 +197,15 @@ 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; u64 partition_assist_page; u64 padding64_4[4]; @@ -211,7 +213,7 @@ struct hv_enlightened_vmcs { u64 padding64_5[7]; u64 xss_exit_bitmap; u64 padding64_6[7]; -}; +} __packed; #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_NONE 0 #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_IO_BITMAP BIT(0) -- 2.35.3