Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5589860rwb; Wed, 21 Sep 2022 09:42:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sgzDPb2QoYJ4Jso1K7m8xRx2jyQeDYVJb9G4i0ZV74gDclt9++9jygu4rmUM+pGkgzAWd X-Received: by 2002:a17:902:850a:b0:178:b276:aab8 with SMTP id bj10-20020a170902850a00b00178b276aab8mr5701449plb.15.1663778530400; Wed, 21 Sep 2022 09:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663778530; cv=none; d=google.com; s=arc-20160816; b=sSTXL3IPJ49F6logdeKfX9Wq6RHxoPII2cR4jru10WRseAfRYuFqr5AK0AGLOnlzfy PD152njmnI8x4JlKRYD2SOLuocxGyybZATlFqYSKqcKU6tx/pVBbAM3ig6vLHlZqGR0f HBW/E9Up/8QBUb2WnJzHqArOacLo8B9UzXYoNppxgjY6Yvbc7jxVWwJgzS8GOCR4lub7 DuWCQwWntRIPARtoD8vnHgg8YT5hk0fqKwpwFM3/VrQYV0UMdGDwjcw4tWvlrBBVvcG0 xZJAwufZfp9fp9zHP2xv0jtyHj+aILQTlFZZkc8P9MD/0DLt/73T/8/uIgiD+jPhgwrs 0P5Q== 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=iyENMeBJqVUiieQtHGShGjdpZsxe++9NETEtH4IBHXYlKcmPUhuHEmDVRtDiobjB4M JaMDh2/5n7ywViE2BJ5sV5K2jbEdYJIaDQjpOX03/uKrE9yf71G4H/E3sGKB0lcGZjnS HDHRxen3pTlNT7HVizrDBubI8eWz+NE+NoiifCWBHxpYoDqqA+6AjRtsihF2AAdkHL4g LfhO1T/oJaQavR71RDTbJbjzeKUK/BgMIXutgfzk8sihp/myi6+867nESPNTJwFIMJcg FMzOaXKf4x4PSETxSUYQG1dN34BydgfF0/N2rteg8i50idwt6wQObo7kKjEMY0vJ1/mG b6/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PVtARRNh; 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 t15-20020a635f0f000000b004197e33daf5si3527729pgb.863.2022.09.21.09.41.58; Wed, 21 Sep 2022 09:42:10 -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=PVtARRNh; 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 S231416AbiIUP2w (ORCPT + 99 others); Wed, 21 Sep 2022 11:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231268AbiIUP2A (ORCPT ); Wed, 21 Sep 2022 11:28:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C27792F1 for ; Wed, 21 Sep 2022 08:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663773966; 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=PVtARRNhtYj1xRj/fdyDfCZvO+E1cCr17DofovbhtZDoDUKe/XynqHULtQCwWgXlJsvtSq S0QuVRxmz97IWmaQj5Xi7EY07gh5bR1yfXn/3hn/gP4IQCwLI+0lJ96e0hV56RlIVCv/53 t6JY/FVOM2+DnCdVm+aZYD/rtj4Ygt0= 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-45-PkIZAVVhONebP7dwMFujCQ-1; Wed, 21 Sep 2022 11:26:01 -0400 X-MC-Unique: PkIZAVVhONebP7dwMFujCQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D489800B30; Wed, 21 Sep 2022 15:26:00 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.194.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60DB42166B29; Wed, 21 Sep 2022 15:25:58 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v10 31/39] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Wed, 21 Sep 2022 17:24:28 +0200 Message-Id: <20220921152436.3673454-32-vkuznets@redhat.com> In-Reply-To: <20220921152436.3673454-1-vkuznets@redhat.com> References: <20220921152436.3673454-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.6 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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