Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp225761iof; Mon, 6 Jun 2022 02:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOQwBGrxWRNHFTk6nnwkpnsduhkgM+DldmvXMDky5GOPJCm0rwPkfy26uRREweAcfuFJGm X-Received: by 2002:a17:90b:4b90:b0:1e8:48bd:453 with SMTP id lr16-20020a17090b4b9000b001e848bd0453mr14410624pjb.86.1654506232365; Mon, 06 Jun 2022 02:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654506232; cv=none; d=google.com; s=arc-20160816; b=iqrNuuglNpD9jwpaZfm6IN/mVTAQjQpDJmkOPvFhp3dWTMGUb3EIzHMfN/QoqjZSK9 ajM142qHUW5M0YjpGoqKyZ9AuEoadmGSOOps3w5DJTJTEsF7gQtF6ilfHTEV2mBmNIBg +au7qK5M9fvT52mGzppMxy9hFBWr7mHYb65op9Fa5VZreNTybN0MgUdYQ5na40Roy6Sd C2s1Sy6fzjIE7Numv0IwfEV717o562rmpIR85xAJ2/Yc7AdAa2nU4us79LxYHIOd+AR+ lAdf7/CF9o0gFqQ4ruRqHXCeBfqoCu4KjIr/TQSnDpjfWPBFoIs9Ym8Nl/GWtQzyicW4 hweg== 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=da7nS1EdTAInnQ5mYClBlXrsAp+Wl4jzAQ2Ex+71s1o=; b=kFWDf+XTYjgjQ1z79vLxhJ/BUhulFwaLOJf1hpTZ6B98LegqKf1StDpHYrtVRIuoch tM20DUklMXXk54Bjr2cI6RVPITvB5r1C5kmxHip5K0lwEp7IXd7wnXpyHNvKTeNwDNa/ O/jiGUpgs6EPury/+ypQyjpaxkqqlsAuMJ4ihLj2OqhfcFiZVdzE935iLN3V8Dzkeh19 5KBGbXVpVPmZtXwYsihdZTMjnxv7jT3hFfFT0aLxKqC1KaIkP/8GPCvz1E+Y8jeCPgZ3 ClKIxfjvLlNzCwWRirCidvOIdU/IBYcj9gmdIBkQWbI1Ly5cWp9Jxmnb93X+QccVd6g/ +huw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WAFvLN44; 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 t4-20020a170902bc4400b00161bcc37999si19294176plz.96.2022.06.06.02.03.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 02:03:52 -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=WAFvLN44; 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 A9507DFF58; Mon, 6 Jun 2022 01:41:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232295AbiFFIlA (ORCPT + 99 others); Mon, 6 Jun 2022 04:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231934AbiFFIi0 (ORCPT ); Mon, 6 Jun 2022 04:38:26 -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 EE56232044 for ; Mon, 6 Jun 2022 01:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654504701; 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=da7nS1EdTAInnQ5mYClBlXrsAp+Wl4jzAQ2Ex+71s1o=; b=WAFvLN44cJHLDsxtfm952xSxn1pnal7nc2GkhR84rCdTfCNRyRaAdXFMSYUaZKJqiwigRi LVesfKXiCHVRZbBN/RKUwatZpNglENHAGe5wc40jFtU4kbBJ/TUchd71idNDvHpo5bIE9Z hv189HMfaIAbE48kszbFjUBPlnFSBSs= 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-589-10mz35SqMOK0asE-vW0eLg-1; Mon, 06 Jun 2022 04:38:17 -0400 X-MC-Unique: 10mz35SqMOK0asE-vW0eLg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 69FE1811E75; Mon, 6 Jun 2022 08:38:16 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.193.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AD901121314; Mon, 6 Jun 2022 08:38:13 +0000 (UTC) From: Vitaly Kuznetsov To: kvm@vger.kernel.org, Paolo Bonzini Cc: Sean Christopherson , Wanpeng Li , Jim Mattson , Michael Kelley , Siddharth Chandrasekaran , Yuan Yao , Maxim Levitsky , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 33/38] KVM: selftests: nVMX: Allocate Hyper-V partition assist page Date: Mon, 6 Jun 2022 10:36:50 +0200 Message-Id: <20220606083655.2014609-34-vkuznets@redhat.com> In-Reply-To: <20220606083655.2014609-1-vkuznets@redhat.com> References: <20220606083655.2014609-1-vkuznets@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Spam-Status: No, score=-3.1 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=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 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/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.3