Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp53429lfe; Fri, 15 Apr 2022 19:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl4z0kjkdfefNfUk4D2kOBduiNmexQD7lJ/JDK7DxWMw+2OHe8fKfelRUZpg8IOGJ99MQj X-Received: by 2002:a63:f642:0:b0:386:53e:9cd4 with SMTP id u2-20020a63f642000000b00386053e9cd4mr1325992pgj.265.1650074840302; Fri, 15 Apr 2022 19:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074840; cv=none; d=google.com; s=arc-20160816; b=AmWhHfKeFLow0nb2+TzagzklgGoaR8wAUgG6ofrh8u8z2UwYKcYf5MBUmkIC+46e9x nSM2JJJrdayAZY+bE/UHjOrZATDHpZQdhzIHE60YnQo3EKwWczuKA9/4nD4rd15afTvn YgJHoiu1kw2ANJbDAT9x6xLBBA3uGU7pYOL9WMSX3KPpKCeLLB45ZwcPLNosO6yBNr/D 3YMQ2yDDFPrhjv71w6YKznIa34BVkMPTk9cLCY7+PYr1/t/zoWPm6iuoP7QtXYAn6X6V 0SHf/yMCvAjw1lQdBu4TN5jPgXSVhrs2kjRHQg9/DcUUBAnDyDwDB0E/EoGK1Q35huL2 l1Yw== 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=9gqBon1sDqqv1Mso87dbXbhpfVbaV+fERFkHlpKdBCQ=; b=EvPXJK3MKkAuGHJXsmUvn2AYVQR/Czx0+vvKglKbelPU348pFJqG58i9CDqh+8lTl3 4QhNDaMWxwm/Q3kVcfOWzt5RWyaT0qm1Jh2UjKwaKCbHE+YHuxp4ez2nMPcJKuHmK4tb 3U/FTOFGq0mWtGJ1q892RDOLSU3NaziFRcVVIOY7te9FxaAE1aIeIFkeUdwWF54d/l2D JCD5dUHke2bj1hbSWEr1BqIigvLk6mO9NABq+fOmp60rdwqeg9gNYTOXScJfh9ZYjOvO v6b6Jnx7bGURQVeXnhubCKsaqyz4kU8XOelFVBEYK/xM2+0Xk3o2VwsQDrzRztUuDTKg ROlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=aBVKnyRr; 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 y4-20020a655284000000b0039d795733f6si2834607pgp.706.2022.04.15.19.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:07:20 -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=aBVKnyRr; 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 E29901DB8B2; Fri, 15 Apr 2022 18:25:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243638AbiDNOEQ (ORCPT + 99 others); Thu, 14 Apr 2022 10:04:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244930AbiDNN2T (ORCPT ); Thu, 14 Apr 2022 09:28:19 -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 A3B4EA889B for ; Thu, 14 Apr 2022 06:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649942478; 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=9gqBon1sDqqv1Mso87dbXbhpfVbaV+fERFkHlpKdBCQ=; b=aBVKnyRrfAB5L8QIWbudOUcw1nwE9ud/zzUW3SeN0H3JNnOWAcfv/XvTj5AAgVPnbFNaee yIbFYLHN2Tnxp1If7BiXARwlpmQU0el6R5ULZxr3WPzjxgzymqCz6J5GcKUSWOOhqBFKGY dVtP9fyYLiwtsy84Az1Lv4vgzpppSY8= 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-635-hFzAl0dKNSqyxRKkr0S17g-1; Thu, 14 Apr 2022 09:21:15 -0400 X-MC-Unique: hFzAl0dKNSqyxRKkr0S17g-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 6EFA13C11CC1; Thu, 14 Apr 2022 13:21:14 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.195.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CEDA7C55; Thu, 14 Apr 2022 13:21:12 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 28/34] KVM: selftests: nVMX: Allocate Hyper-V partition assist page Date: Thu, 14 Apr 2022 15:20:07 +0200 Message-Id: <20220414132013.1588929-29-vkuznets@redhat.com> In-Reply-To: <20220414132013.1588929-1-vkuznets@redhat.com> References: <20220414132013.1588929-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-2.0 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=no 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 In preparation to testing Hyper-V L2 TLB flush hypercalls, allocate so-called Partition assist page and link it to 'struct vmx_pages'. 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/testing/selftests/kvm/include/x86_64/vmx.h index 583ceb0d1457..f99922ca8259 100644 --- a/tools/testing/selftests/kvm/include/x86_64/vmx.h +++ b/tools/testing/selftests/kvm/include/x86_64/vmx.h @@ -567,6 +567,10 @@ struct vmx_pages { uint64_t enlightened_vmcs_gpa; void *enlightened_vmcs; + 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/selftests/kvm/lib/x86_64/vmx.c index d089d8b850b5..3db21e0e1a8f 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/vmx.c +++ b/tools/testing/selftests/kvm/lib/x86_64/vmx.c @@ -124,6 +124,13 @@ vcpu_alloc_vmx(struct kvm_vm *vm, vm_vaddr_t *p_vmx_gva) vmx->enlightened_vmcs_gpa = addr_gva2gpa(vm, (uintptr_t)vmx->enlightened_vmcs); + /* Setup of a region of guest memory for the partition assist page. */ + vmx->partition_assist = (void *)vm_vaddr_alloc_page(vm); + vmx->partition_assist_hva = + addr_gva2hva(vm, (uintptr_t)vmx->partition_assist); + vmx->partition_assist_gpa = + addr_gva2gpa(vm, (uintptr_t)vmx->partition_assist); + *p_vmx_gva = vmx_gva; return vmx; } -- 2.35.1