Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp16849iob; Wed, 11 May 2022 08:40:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtgBod9t5S8erXyXM1wtAfyctDcFglVwutqvJLdmH2hENmdoJDnl1C/bPaO2Z0ecEXEImx X-Received: by 2002:a17:902:7884:b0:15e:e6a8:346 with SMTP id q4-20020a170902788400b0015ee6a80346mr26047355pll.151.1652283634160; Wed, 11 May 2022 08:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652283634; cv=none; d=google.com; s=arc-20160816; b=cQQk0XpNc/2Ki8avLcEhY1srgQda0AqXfnXQS/96Ghrvm16WvwLbVj41AwyT1tmthq KcTwDXLfk3OwnarOBHRchmCE8aFUSB2kTLpvGxKWEV2S9qVRNWB5FR4g0iuyWHmhHo5B tu9dmtCubf0XS3P7HkUvwZTZ3rBit7PxhwpEthkjZ2YmyrJN9Jgsheehz8fk4tXZLT+T QPjvoEfCYfAe2qHm/klEV8VITzCjcLX0zIY5sXWx+Ry+4nvAY1mrtF+/UcR7FJwrWRvJ dkVCZAAOD0y+olpFDjbT9auVBpwL+s9Z5END7lFdbkR0rY9Pbel8Ohtht3t2XhE+3Ig1 AU6Q== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=skbETg0V9ztle8rerb+4K92+T6NFEIjseKb98Cse8og=; b=TD04lAp8BADsSvsA6QRW6mxkK7a01PHq0odDEJwIqWQL4C2bo+XJHSt3+BmleaDB9s S+uTzl3v5JgXXrvF22is+/PSIOOB9F6vjA9eYMIl34yxO+uW18tk54GbhCUG1a/Frhyy iWJ7mXCNbp1M+beiwEkDewIvP53f322cFdGm8Qny5cv9MTID7yPJ0YJdCsTmvyR+AWCB Sjg79GT9lqoU4+/S3HZtHWA687Xxij0Kr4C6v70EXU91QUM5JJkYqp4i9tDez4Ofx1AT n9DG5nAD9o3DOK9xoNQ2XA4eto9tiDgRnZPTFhVs31LTxBETN4E/tk9G18i1lJd7c2T+ 2QMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dEckqiU+; 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 j3-20020a17090a7e8300b001c6d5497bb9si179008pjl.28.2022.05.11.08.40.22; Wed, 11 May 2022 08:40:34 -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=dEckqiU+; 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 S242122AbiEKMSE (ORCPT + 99 others); Wed, 11 May 2022 08:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241942AbiEKMRt (ORCPT ); Wed, 11 May 2022 08:17:49 -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 5CA5A4F9D3 for ; Wed, 11 May 2022 05:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652271462; 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=skbETg0V9ztle8rerb+4K92+T6NFEIjseKb98Cse8og=; b=dEckqiU+Qr28/68felTYGYOBB8netN4wQQlJ3C7C06vwOCWzcutEfGA8y/VnFGrD8NiUQF 1xvpAp+DPWqGJudwtaIY7WVLvKBWnbpPkreHoeYuQe903NWiakfGX//g9VfaUIyF0tYo51 NPa+fCFqWmBcS1Eo40I1J7oOLO3AM0U= 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-569-AH0IfOvKOOCjvgSu8HxyCw-1; Wed, 11 May 2022 08:17:39 -0400 X-MC-Unique: AH0IfOvKOOCjvgSu8HxyCw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7123D80B717; Wed, 11 May 2022 12:17:38 +0000 (UTC) Received: from starship (unknown [10.40.192.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2988E2026D6A; Wed, 11 May 2022 12:17:35 +0000 (UTC) Message-ID: Subject: Re: [PATCH v3 28/34] KVM: selftests: nVMX: Allocate Hyper-V partition assist page From: Maxim Levitsky To: Vitaly Kuznetsov , 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 Date: Wed, 11 May 2022 15:17:35 +0300 In-Reply-To: <20220414132013.1588929-29-vkuznets@redhat.com> References: <20220414132013.1588929-1-vkuznets@redhat.com> <20220414132013.1588929-29-vkuznets@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-3.4 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,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 On Thu, 2022-04-14 at 15:20 +0200, Vitaly Kuznetsov wrote: > 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; > } Reviewed-by: Maxim Levitsky Best regards, Maxim Levitsky