[v12,38/46] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h
Message ID | 20221021153521.1216911-39-vkuznets@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp766276wrr; Fri, 21 Oct 2022 08:41:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4uRmXDeuj7fJaalEa+MS3T5317yMVsuW9T37Uat8UYWyQNh+kI/vwWtLIdQ3zWmoNTenTN X-Received: by 2002:a05:6402:28a1:b0:458:81c0:a379 with SMTP id eg33-20020a05640228a100b0045881c0a379mr17964875edb.388.1666366877393; Fri, 21 Oct 2022 08:41:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666366877; cv=none; d=google.com; s=arc-20160816; b=eDZDGr21f9nW+Tv0P/R7RREnT9c+6R3O8TsJPz/49p9VVutMSMpC7CpR6EQaKMgDiW zb/uwko7nhH8RKfY38kOXNrlEaLyzw9xGqwXliRZZwL5MBzBsZ+sTNm2x1+x9/fL1Yfb 7OmQe1DUO8i4OJeUQhLHd0dI4+KfbCss0obV4WKWl+Uv72QwFcaYIaP6QQ+EcRWH8Bks NvNAsNDpA9uW61+rb5UWD7+m1y+ZnLb4zVwTJRw4pLDbleQKecnbI3blugoFxLOlbZYV 2aPz5sNem6myd6FuMoVqlyPk8ZyLGe+a7XYepyTH+kHr2+NbDNyBbN6p4+44LrndOauX fqGw== 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=U/93vsIXlNmAJBDyQ4w/rErI2sHwQipsA00wSCT9rTRhpLSE8FZAgr4yhSeWpG5/N1 C3CQUJpjvr7Hl9rIEZliP4+iPlqyZpu3aWcImU7zXyvrc8aPfFblc0JZ1XR9Rv1e/46K k2Pl8myU2aHm2lqEJMFMw77cIsoe0fMfhKW3dEPuKSTUea5dFgMX8U2nm/C3UDNwrN16 9jLqG9xDqmzbkZGU1tvCwkLWEIrYcoUBTSJ2Lp/CLtKKuwx+7ePwYRi37/dZ4VWuwOoq XBIBIRy/bWiuSx6vSJV/BCF7xPVYAMS/G5FRhrGPB+BSiVYg2vd7z4bW/pyjUdhiCQth ucqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eFKOD+Uo; 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 ga13-20020a1709070c0d00b0073daf6b44a5si20663897ejc.775.2022.10.21.08.40.53; Fri, 21 Oct 2022 08:41:17 -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=eFKOD+Uo; 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 S231337AbiJUPkI (ORCPT <rfc822;mntrajkot1@gmail.com> + 99 others); Fri, 21 Oct 2022 11:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231339AbiJUPjU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 11:39:20 -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 6787127C95F for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 08:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666366626; 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=eFKOD+UoVTzXOcZLcxfCh9PCDI0KSvGnc/jXTO10HOKAUJwSEVkx1qu8wX9i/i/bqbcK/7 GqbSB6z9fkp3muOp1LceUEn5goNsImS5lJy+DJeBVBjGBs8m8ShvyyI3nWOLvVodxGCnYM amuo+2rtoF9B1R7xh/ZFv4QjzL3iyS8= 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-39-mDH1TTbnP1am_kNw_p6a6g-1; Fri, 21 Oct 2022 11:37:01 -0400 X-MC-Unique: mDH1TTbnP1am_kNw_p6a6g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 579C8811E81; Fri, 21 Oct 2022 15:37:00 +0000 (UTC) Received: from ovpn-192-65.brq.redhat.com (ovpn-192-65.brq.redhat.com [10.40.192.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E3A440CA41F; Fri, 21 Oct 2022 15:36:58 +0000 (UTC) From: Vitaly Kuznetsov <vkuznets@redhat.com> To: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com> Cc: Wanpeng Li <wanpengli@tencent.com>, Jim Mattson <jmattson@google.com>, Michael Kelley <mikelley@microsoft.com>, Siddharth Chandrasekaran <sidcha@amazon.de>, Yuan Yao <yuan.yao@linux.intel.com>, Maxim Levitsky <mlevitsk@redhat.com>, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v12 38/46] KVM: selftests: Sync 'struct hv_enlightened_vmcs' definition with hyperv-tlfs.h Date: Fri, 21 Oct 2022 17:35:13 +0200 Message-Id: <20221021153521.1216911-39-vkuznets@redhat.com> In-Reply-To: <20221021153521.1216911-1-vkuznets@redhat.com> References: <20221021153521.1216911-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.1 X-Spam-Status: No, score=-2.3 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747312314799137502?= X-GMAIL-MSGID: =?utf-8?q?1747312314799137502?= |
Series |
KVM: x86: hyper-v: Fine-grained TLB flush + L2 TLB flush features
|
|
Commit Message
Vitaly Kuznetsov
Oct. 21, 2022, 3:35 p.m. UTC
'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 <mlevitsk@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> --- 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)