From patchwork Tue Nov 1 14:54:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vitaly Kuznetsov X-Patchwork-Id: 13727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3023523wru; Tue, 1 Nov 2022 08:02:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5FPSSGahThF4RCSvu5YCYxrWGqlnLd7OA9NCvrgU57YPNy/YtT4n0HYx7rHefH99Q/WAVO X-Received: by 2002:a17:906:6b90:b0:7ad:b6d3:3394 with SMTP id l16-20020a1709066b9000b007adb6d33394mr15825884ejr.497.1667314946257; Tue, 01 Nov 2022 08:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667314946; cv=none; d=google.com; s=arc-20160816; b=lN0bm5Sat5RPOf9gpAY7YvJdo5l48dj3kyvP/q7fPC41RtNQZ+Qvb3eJvkSqmwOUQB pX7zizrTDbuHJE5X2nLecOXj6QLJIdfa2cQiKFz/QJLAFrEyDQnoukIj5VktWScgiRk6 jNp5BfzvFCkFV9Kk2GMklCgRRawQZXp0hSVkEmF6oLJlX8rSzM/C6EPPsgEg5jlkzRrl eLU5SBPP6abaL5EbJYgOojffFYedd7PpNnCSLVv7TamdMy15+fiP/yRJxxtz3efihidN CeLDJYrSC7ksPPXj45K2Z2tRpsWIxvQAblcrHhpi6xSFhhZIhPEkTfLQST2j1iYZzV1x cS4w== 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=EODbDTkqTZBBymFnsXzTDVagmoVBHbitQaX3f99+ld8=; b=UDkE6YtEWpEQ7q2kWc7xDHp9GoYaNlgqpBSl2cD/1B/ZiELC73xrdPOBDoX/VuVels HaSOI7kElbHN9/ct1KrYJd5ZkV1IWPtIGQpbeSa4zYFzwbeunJ2QvWR3+P1i4CJMWijZ ZcDKH1Bdt1wMIOZUZSvaHmzPuWSle71/cngEmqzhgciEVlDU6jR937JvQOKFWO64cxbX 1kmRYwIlCYeVlbJbyYe12O763IIx7k5Uwp4LRQCRdOS4HoN7IeAiFXcevV/d1sMNWgql 5EsDYRzQmCF8mvBRIFeNbSP/vJlbfp/fb02W4xJJAZB3gm6xLSzAsoD5cpKZd34UWy1u Q/Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dq7j0wvD; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a0564021e8800b0046360343debsi8483309edf.153.2022.11.01.08.01.58; Tue, 01 Nov 2022 08:02:26 -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=dq7j0wvD; 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 S231358AbiKAPBZ (ORCPT + 99 others); Tue, 1 Nov 2022 11:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231191AbiKAPBJ (ORCPT ); Tue, 1 Nov 2022 11:01:09 -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 257831DDD9 for ; Tue, 1 Nov 2022 07:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667314601; 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=EODbDTkqTZBBymFnsXzTDVagmoVBHbitQaX3f99+ld8=; b=dq7j0wvDx3E5/LjhvOjf5qwdc8RKgt1Yu6U6cVg+ZPtKXAjv1v/K3hjuHoBb5O2WgX4aIp au7glpagEa851gQdn3+8lrf8/eEsHQJhh4rZkNPtSPFHMgqFGTrVpTRexisHzxC8FHMSYY /+USNkVkdVKwNndsg/uWO7aZTnuga8E= 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-487-f2DQYAPmN0eOuVbcNTz9Tw-1; Tue, 01 Nov 2022 10:56:38 -0400 X-MC-Unique: f2DQYAPmN0eOuVbcNTz9Tw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CAA5F1C0A58A; Tue, 1 Nov 2022 14:56:37 +0000 (UTC) Received: from ovpn-194-149.brq.redhat.com (ovpn-194-149.brq.redhat.com [10.40.194.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 500B4C2C8DB; Tue, 1 Nov 2022 14:56: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 v13 38/48] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Tue, 1 Nov 2022 15:54:16 +0100 Message-Id: <20221101145426.251680-39-vkuznets@redhat.com> In-Reply-To: <20221101145426.251680-1-vkuznets@redhat.com> References: <20221101145426.251680-1-vkuznets@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748306437125628152?= X-GMAIL-MSGID: =?utf-8?q?1748306437125628152?= '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 Reviewed-by: Sean Christopherson 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)