From nobody Mon Feb 9 00:27:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3C8FCCA480 for ; Mon, 13 Jun 2022 17:55:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242748AbiFMRzQ (ORCPT ); Mon, 13 Jun 2022 13:55:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242788AbiFMRyN (ORCPT ); Mon, 13 Jun 2022 13:54:13 -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 ESMTP id E0F8678EDF for ; Mon, 13 Jun 2022 06:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655127663; 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=ZrLLxTItRf1Oo1WC5yZKeev7MmpLreUJVxMh/idkMow=; b=XBzs/wcx9zRmV/Nj41wIaOgcphHi7p2yWJMO8NWrCyn2c0tBT8J+Pr4YxjqEAQYNq4+irw FAQJ3xnLLltlClxtJclnQL63ReGYE0JwmdWhvJKXA8XSvrxMghNQW4vB30u04TXio0c9ER fIf/xBtZG+Q/B0ydGKDzMU7pCsC10rM= 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-385-pJT4nZDtOO-ilx4EsnsRdw-1; Mon, 13 Jun 2022 09:40:57 -0400 X-MC-Unique: pJT4nZDtOO-ilx4EsnsRdw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CAB391C0897C; Mon, 13 Jun 2022 13:40:55 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.194.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EDC7492CA2; Mon, 13 Jun 2022 13:40:53 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Maxim Levitsky , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 33/39] KVM: selftests: nVMX: Allocate Hyper-V partition assist page Date: Mon, 13 Jun 2022 15:39:16 +0200 Message-Id: <20220613133922.2875594-34-vkuznets@redhat.com> In-Reply-To: <20220613133922.2875594-1-vkuznets@redhat.com> References: <20220613133922.2875594-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In preparation to testing Hyper-V L2 TLB flush hypercalls, allocate so-called Partition assist page and link it to 'struct vmx_pages'. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/include/x86_64/vmx.h | 4 ++++ tools/testing/selftests/kvm/lib/x86_64/vmx.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tools/testing/selftests/kvm/include/x86_64/vmx.h b/tools/testi= ng/selftests/kvm/include/x86_64/vmx.h index cc3604f8f1d3..f7c8184c1de8 100644 --- a/tools/testing/selftests/kvm/include/x86_64/vmx.h +++ b/tools/testing/selftests/kvm/include/x86_64/vmx.h @@ -570,6 +570,10 @@ struct vmx_pages { uint64_t enlightened_vmcs_gpa; void *enlightened_vmcs; =20 + void *partition_assist_hva; + uint64_t partition_assist_gpa; + void *partition_assist; + void *eptp_hva; uint64_t eptp_gpa; void *eptp; diff --git a/tools/testing/selftests/kvm/lib/x86_64/vmx.c b/tools/testing/s= elftests/kvm/lib/x86_64/vmx.c index 381432741df4..2655450dd4dd 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/vmx.c +++ b/tools/testing/selftests/kvm/lib/x86_64/vmx.c @@ -119,6 +119,13 @@ vcpu_alloc_vmx(struct kvm_vm *vm, vm_vaddr_t *p_vmx_gv= a) vmx->enlightened_vmcs_gpa =3D addr_gva2gpa(vm, (uintptr_t)vmx->enlightened_vmcs); =20 + /* Setup of a region of guest memory for the partition assist page. */ + vmx->partition_assist =3D (void *)vm_vaddr_alloc_page(vm); + vmx->partition_assist_hva =3D + addr_gva2hva(vm, (uintptr_t)vmx->partition_assist); + vmx->partition_assist_gpa =3D + addr_gva2gpa(vm, (uintptr_t)vmx->partition_assist); + *p_vmx_gva =3D vmx_gva; return vmx; } --=20 2.35.3