Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp478281rwb; Tue, 4 Oct 2022 06:42:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ipMQgJf+8AGeJdvxtr+Pf/4rCWlAMJ66dwmSRIM4PIDve8cEwo9JkTKfID72jV/IZ995q X-Received: by 2002:a05:6402:5ca:b0:445:c80a:3c2 with SMTP id n10-20020a05640205ca00b00445c80a03c2mr23283654edx.247.1664890955952; Tue, 04 Oct 2022 06:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664890955; cv=none; d=google.com; s=arc-20160816; b=blI/g45UqtMaWlxw9iwyL6vhsYTsoCwDknbhEHTQqmbPl5+1toUMpVkt2NWbwkkn1a 2Cr+gEAY5hbKhv0Fz74zskFgii/J16iPAV4j3zWyWM1411TPDr6RgXgUAqHrgSLSc5bE LpuWEknSZdQ3cL1yfYPQ/3yEQoSM79zWjBoFinto0dStrYPkr/b7ttIq831AqxPuzPl4 QEOgjg+OJ6hPdTVZVDxD9p67wvy/+dmw+XE8sVcQEYMBZJ/XA8f3vQoVgZ1sklhp7QGl 16ojOpEAeCitwer1vwYnD7zEJshqYnKry5k8CFDYd0cyx7AITYQG3ya4Z8I5TXh75oYQ vcjQ== 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=QFxOQ3PtGIbBD+RVLQskRjxlIhD002VdmDFB8+zh1fI=; b=VTOszLV2jE/zPW5murPUFq6FrD4oOMyj9YIBqKcr38cw2q+QBER6hriZiTLobs5RsT lEJ3iDkYuwAs5NiTa/BKBftRoHGMTgdP11PAlSmgNIhmuCgTW4FMklrRLAW7q3fCFXXF vZt3PJHwaCZQMVoMGBUf4mkqst5TkIaBhr7Geq3MLuNvMuM3rt23Ua3zLebUNgNP1mGL VblXR4mIpAiuN+G2Lc4KhOLThuTgJosvUeNSFRceeOuD6Lk7uLpohZwzPbgpk3wN+lW6 d7TN7Ht/xhA9WTMGgTEU0bRmik1M1M6NZyryQD5A1qp/prprG5Q6arqAEfICBweP7JXN leMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YTkflXP6; 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 o17-20020aa7c511000000b00458d94f1a45si6137422edq.413.2022.10.04.06.42.11; Tue, 04 Oct 2022 06:42:35 -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=YTkflXP6; 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 S229751AbiJDMkX (ORCPT + 99 others); Tue, 4 Oct 2022 08:40:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiJDMkO (ORCPT ); Tue, 4 Oct 2022 08:40:14 -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 ESMTPS id 256631E3CF for ; Tue, 4 Oct 2022 05:40:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664887212; 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=QFxOQ3PtGIbBD+RVLQskRjxlIhD002VdmDFB8+zh1fI=; b=YTkflXP6qHclkTqpUUNSuInp/LJ8V+gQISXG71oYCYVAfhDeZuqoJR+/pQTHg1fctvQY6z Nc8Hgos8GKEenjlzGIoElIzLzUO3xWwfxlb2Ut/tGp370G8AbmLRN01X6q/NjKSW56igSV bdtdDAFZoeTi9pELuLzlgLboYn425KQ= 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-258-iR1D0m3ANmKc_vWxhQYfXQ-1; Tue, 04 Oct 2022 08:40:07 -0400 X-MC-Unique: iR1D0m3ANmKc_vWxhQYfXQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EFEE3882821; Tue, 4 Oct 2022 12:40:05 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2765A7AE5; Tue, 4 Oct 2022 12:40:04 +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 v11 02/46] KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h Date: Tue, 4 Oct 2022 14:39:12 +0200 Message-Id: <20221004123956.188909-3-vkuznets@redhat.com> In-Reply-To: <20221004123956.188909-1-vkuznets@redhat.com> References: <20221004123956.188909-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.5 X-Spam-Status: No, score=-2.1 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=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 From: Sean Christopherson Move Hyper-V's VMCB "struct hv_enlightenments" to the svm.h header so that the struct can be referenced in "struct vmcb_control_area". Alternatively, a dedicated header for SVM+Hyper-V could be added, a la x86_64/evmcs.h, but it doesn't appear that Hyper-V will end up needing a wholesale replacement for the VMCB. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov --- .../testing/selftests/kvm/include/x86_64/svm.h | 17 +++++++++++++++++ .../selftests/kvm/x86_64/hyperv_svm_test.c | 18 ------------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/kvm/include/x86_64/svm.h b/tools/testing/selftests/kvm/include/x86_64/svm.h index c8343ff84f7f..89ce2c6b57fe 100644 --- a/tools/testing/selftests/kvm/include/x86_64/svm.h +++ b/tools/testing/selftests/kvm/include/x86_64/svm.h @@ -58,6 +58,23 @@ enum { INTERCEPT_RDPRU, }; +struct hv_enlightenments { + struct __packed hv_enlightenments_control { + u32 nested_flush_hypercall:1; + u32 msr_bitmap:1; + u32 enlightened_npt_tlb: 1; + u32 reserved:29; + } __packed hv_enlightenments_control; + u32 hv_vp_id; + u64 hv_vm_id; + u64 partition_assist_page; + u64 reserved; +} __packed; + +/* + * Hyper-V uses the software reserved clean bit in VMCB + */ +#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31) struct __attribute__ ((__packed__)) vmcb_control_area { u32 intercept_cr; diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c index 5060fcfe1760..2fd64b419928 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c @@ -23,24 +23,6 @@ #define L2_GUEST_STACK_SIZE 256 -struct hv_enlightenments { - struct __packed hv_enlightenments_control { - u32 nested_flush_hypercall:1; - u32 msr_bitmap:1; - u32 enlightened_npt_tlb: 1; - u32 reserved:29; - } __packed hv_enlightenments_control; - u32 hv_vp_id; - u64 hv_vm_id; - u64 partition_assist_page; - u64 reserved; -} __packed; - -/* - * Hyper-V uses the software reserved clean bit in VMCB - */ -#define HV_VMCB_NESTED_ENLIGHTENMENTS (1U << 31) - void l2_guest_code(void) { GUEST_SYNC(3); -- 2.37.3