Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp474136rwb; Tue, 4 Oct 2022 06:39:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Wro3xCfAf521gxFpYuhNmesCtBm8OFYzhOaAtGULzqvv02D3BqRn484eF3hibgyMuF4hl X-Received: by 2002:a05:6402:493:b0:445:b5f0:7a0f with SMTP id k19-20020a056402049300b00445b5f07a0fmr23464625edv.120.1664890765518; Tue, 04 Oct 2022 06:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664890765; cv=none; d=google.com; s=arc-20160816; b=OKrjUbBfe5BRQI1Y7GMho3xhea0sUbQMyZ7DyEMMtfzuMqmyo7e5LATJhh895eghOm jrTZ8E/IQqFRgBNiWr4YCfKapfc0rT2S/81IQX4Nqe7P/GaSdcsgjv43OC90KWAYAv92 RT0bmQM1UsB/ENW5aN3njTE6ou3AWj7XKtH+t5TzBv2mGp3kjikV1NzrBNYNx0gAa6TL tivovTzkABZeofugrhNGs715VSgzeXrLFvTsFe4Z+vXUfNDRlgSfdXM2NdDH5ZtEEuVx PKoYt+jQ2+K3b23E2kj+HDWkrPg/VUQXg1A/uYktlEBaA1Oxdq6lQVRCW65fczgHQOY6 5YlQ== 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=q/mBUp5om8+lhF+564fXSbS6jTR1Ky4c+482nYxEp3g=; b=z7yT+QEs/2JK09XhSKexHsWE+eDo51sOaTE/o4E4ZivBN2T1D4ioiLSvSYv8/WivXX wvbCN/6Zd7pYq6ySBBPPNrQsdHE7+EDdiiqQdl5JGTRZriLzwQ4lkg4DFBYjvJ//jqmw PpbJiHXInxmeId6bb1byAJXjtrCQtZm+wV7mIhxAfFNQGFiB4Eb+7KDjCU8SC5HB+kEb e3NuT6egvjNbQY/CbmiUH3RLJM1cVuLh1PJ+Fu4h5TDZ1gNC1N9cGrEc+neIR3ckRxuS 4JLv4Wdssrb78+KPZ8Di7CmmaWfJIFRyYJaWWvOEELfQyuUdeY6H1HlntPbaRf7Fi62R ru0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dMqVFFJG; 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 sd16-20020a1709076e1000b00781dbee4273si10768747ejc.514.2022.10.04.06.38.58; Tue, 04 Oct 2022 06:39:25 -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=dMqVFFJG; 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 S230151AbiJDMpP (ORCPT + 99 others); Tue, 4 Oct 2022 08:45:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbiJDMoo (ORCPT ); Tue, 4 Oct 2022 08:44:44 -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 6F8145E317 for ; Tue, 4 Oct 2022 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664887312; 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=q/mBUp5om8+lhF+564fXSbS6jTR1Ky4c+482nYxEp3g=; b=dMqVFFJGFKSwso1tjQ8ESSd78dlmRlFRcJVx2U8e/WsP9SkULqutg6zeS6U2xaR4+GOur7 yHLHhL2AJLvbEx7XqGFfY6ov3s2d7ftUn5kwqyulIiYU17JUoZJlLCdVFAXOS1Aku193Tu JOt49shQg4Q78TWxOgfvCmJzeUH8sFw= 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-471-eeRVb9qOO_iAWlMIdd-BDA-1; Tue, 04 Oct 2022 08:41:48 -0400 X-MC-Unique: eeRVb9qOO_iAWlMIdd-BDA-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 08F76811E67; Tue, 4 Oct 2022 12:41:48 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.255]) by smtp.corp.redhat.com (Postfix) with ESMTP id A28BD7AE5; Tue, 4 Oct 2022 12:41:45 +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 43/46] KVM: selftests: Allocate Hyper-V partition assist page Date: Tue, 4 Oct 2022 14:39:53 +0200 Message-Id: <20221004123956.188909-44-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.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 In preparation to testing Hyper-V L2 TLB flush hypercalls, allocate so-called Partition assist page. Signed-off-by: Vitaly Kuznetsov --- tools/testing/selftests/kvm/include/x86_64/hyperv.h | 5 +++++ tools/testing/selftests/kvm/lib/x86_64/hyperv.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/testing/selftests/kvm/include/x86_64/hyperv.h b/tools/testing/selftests/kvm/include/x86_64/hyperv.h index 186f3aab888f..ffe28a78c8a3 100644 --- a/tools/testing/selftests/kvm/include/x86_64/hyperv.h +++ b/tools/testing/selftests/kvm/include/x86_64/hyperv.h @@ -273,6 +273,11 @@ struct hyperv_test_pages { uint64_t vp_assist_gpa; void *vp_assist; + /* Partition assist page */ + void *partition_assist_hva; + uint64_t partition_assist_gpa; + void *partition_assist; + /* Enlightened VMCS */ void *enlightened_vmcs_hva; uint64_t enlightened_vmcs_gpa; diff --git a/tools/testing/selftests/kvm/lib/x86_64/hyperv.c b/tools/testing/selftests/kvm/lib/x86_64/hyperv.c index a2fc083c65ef..efb7e7a1354d 100644 --- a/tools/testing/selftests/kvm/lib/x86_64/hyperv.c +++ b/tools/testing/selftests/kvm/lib/x86_64/hyperv.c @@ -19,6 +19,11 @@ struct hyperv_test_pages *vcpu_alloc_hyperv_test_pages(struct kvm_vm *vm, hv->vp_assist_hva = addr_gva2hva(vm, (uintptr_t)hv->vp_assist); hv->vp_assist_gpa = addr_gva2gpa(vm, (uintptr_t)hv->vp_assist); + /* Setup of a region of guest memory for the partition assist page. */ + hv->partition_assist = (void *)vm_vaddr_alloc_page(vm); + hv->partition_assist_hva = addr_gva2hva(vm, (uintptr_t)hv->partition_assist); + hv->partition_assist_gpa = addr_gva2gpa(vm, (uintptr_t)hv->partition_assist); + /* Setup of a region of guest memory for the enlightened VMCS. */ hv->enlightened_vmcs = (void *)vm_vaddr_alloc_page(vm); hv->enlightened_vmcs_hva = addr_gva2hva(vm, (uintptr_t)hv->enlightened_vmcs); -- 2.37.3