Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp225716iof; Mon, 6 Jun 2022 02:03:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6TGo+uVZPHye+SiqaPHa6AfMXuuDmX3xLzmOcbhl4m0ZHw3oxCyUONHvIk0PyQ+QFwBFw X-Received: by 2002:a17:90b:3a87:b0:1e8:8079:b7e6 with SMTP id om7-20020a17090b3a8700b001e88079b7e6mr5210924pjb.139.1654506228144; Mon, 06 Jun 2022 02:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654506228; cv=none; d=google.com; s=arc-20160816; b=UbkiTOf2XHB40kOTmMBxrDDbo+5TVCsNtV0T52/+1kAckK9X77z6sLGcjV6lv0Xx51 sEiidrEgVu+VJk4G3aH/FZO4SZSuVzj17bEKMHse4OQ5YH9wrUirlgsdT9kCzz8XuPv4 H4HE86SIthUCpHwBNtlLdbZHJAcXvbwMFEX9uRl7dbnkhJsCwGqU9JtIe4AwX5yV6MaI SY4PfEmregy2+viznLpB3wGX55gyv7Ez0Itd+Xc1DPbMYwQRTbtwM2wNFFxgaGEubax3 7yaIhJqHd6NTGgHktS9rDcV/Mpfgri8MuOvr4hTbIZdfAbMmI2VVdGD76oGBUqd6VfUD T2VQ== 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=SdqS0NQPZCKEUwD2dIY/ynaHh6p2yecQUXwSGu03RVo=; b=yIIVJeTSAQQjP+ETJxdJadw2BfP9uWIfjvmlJEZRkDrvn4JSTug2VIZ3a/Boudby02 1LNeOOryuYeSMo+Ux8F9XjCjvHunxCb3QaGn3wBGvS/CgSzNHsWvwUX6kxA1/iIL0M8o +zCUJWDBQmnr2F+OBPFFuWHQ4ml0HPI6ZHVYeHJcnFQkpMgltbQLRlwohdW9OiP4aA04 EaOyfxEK0Xyxbs0QVgICfhTk0MsG3hDY6SqfWoN4HEq/29SfdTvKdBkXPpHIVqJ30oBE nxvKPOm/DtuYB8iEDVGGPwU473EuL0PEaBN0Q4ud996sqsiOFsUHx+odgNzAZA0gCh9x 8XYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V2XXkBUC; 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 w3-20020a6556c3000000b0039d94389fe6si19662848pgs.599.2022.06.06.02.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 02:03:48 -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=V2XXkBUC; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D3AACE3DEC; Mon, 6 Jun 2022 01:41:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232266AbiFFIkz (ORCPT + 99 others); Mon, 6 Jun 2022 04:40:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232158AbiFFIiX (ORCPT ); Mon, 6 Jun 2022 04:38:23 -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 4458021E11 for ; Mon, 6 Jun 2022 01:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504701; 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=SdqS0NQPZCKEUwD2dIY/ynaHh6p2yecQUXwSGu03RVo=; b=V2XXkBUC8FRaXdKlrtTs1qbuIite67tW1nOVVi6Ka5+tEuhpn1sPyFryF2tdt0sM7dp03n 7k+8Ahuz6w61J92xZ+35dfg3SdpEQnejUZtzW5uvxuvsA2F+UPXDS21im1GBxwzZfHwIJ/ e1iZJFXEbtlKm6xzIjuu/zqrPaUlggA= 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-108-q9yx1quzNZm_PlmaMxZwsA-1; Mon, 06 Jun 2022 04:38:14 -0400 X-MC-Unique: q9yx1quzNZm_PlmaMxZwsA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CABE2811E81; Mon, 6 Jun 2022 08:38:13 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EAE51121314; Mon, 6 Jun 2022 08:38:11 +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 v6 32/38] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Mon, 6 Jun 2022 10:36:49 +0200 Message-Id: <20220606083655.2014609-33-vkuznets@redhat.com> In-Reply-To: <20220606083655.2014609-1-vkuznets@redhat.com> References: <20220606083655.2014609-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.1 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=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 | 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 cc5d14a45702..b6067b555110 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