From patchwork Mon Feb 17 13:55:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11386523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 681DF139A for ; Mon, 17 Feb 2020 13:56:35 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 442EE2070B for ; Mon, 17 Feb 2020 13:56:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rMiLNzdw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 442EE2070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j3grq-0006Cx-Lw; Mon, 17 Feb 2020 13:55:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j3grq-0006Cr-0O for xen-devel@lists.xenproject.org; Mon, 17 Feb 2020 13:55:22 +0000 X-Inumbo-ID: 23173098-518d-11ea-ade5-bc764e2007e4 Received: from mail-wr1-x443.google.com (unknown [2a00:1450:4864:20::443]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 23173098-518d-11ea-ade5-bc764e2007e4; Mon, 17 Feb 2020 13:55:21 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id z7so19812083wrl.13 for ; Mon, 17 Feb 2020 05:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4GBIcTraS0ta6AuFWJddkEuCpCR+lEdK7LyTAKv4Eus=; b=rMiLNzdwHKibG/0U3fCr33LwhRRDtjzXW8Zn+nFXqMvMF1k6uUCpZ86Ehh2P4+V/cN KfvupOTjdqIXbA4xwjIG5/qjcHDAl2QAsneBWRbPaanhTumCXOtur4sNo3qWQZP8UF3f nv/j/Ooy4o0w7pgqqQ19IhQwjWZbmZTt+UObVNPrRD/8b4KeG+MTymSydktwsVy1Pa/u UdWRrEKhfjNVuMhfZR0pZ8DuR3DlTT3e5n7gkvD7sEhKA4fzD8aUjp8ZV+iPdkZzJ7Yp P1A1m7Fws8wcF/Q6euIELPShPL/NYpfP1eUI0qKEjrl6iV36NtcMd+AfAyYkUwfgZJpQ 50+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=4GBIcTraS0ta6AuFWJddkEuCpCR+lEdK7LyTAKv4Eus=; b=OmgWqsE9ZYvZs81XugfTf34xewUuBRrNNVU8ktYSKVFCFjTJZEDFUa2eUMalc4UnDh 0vvKWuYC5nTV6fhOq/9y+Sis2XhnfUY+aJgQDura+D+jbaHIaS2uKkpCbi1zjzL/zHJl bZJp5NzU8WUSbZ4xfbk1lC/iB81qlhO+r2AY+GLS04vGJ2/04ENstZap2IeVP6aWsvPd 51KEKsx694s9VxL/e7MOYWaOabYqeZ1Gq8HTNctS7Jc3dpckoFrSrze+wGzsuP6qjzOp IRln1BuiBVRx3a4a1GRWk5BMk+nxJ5DLPM0DpQDtDEdJKImtX4N564C2KcP5qBTEPIQ9 0VKw== X-Gm-Message-State: APjAAAUTvIdK0wGDOCsCYhv47zhi1U4oP1l/cJiJh2kgLxuhB8zvEaXF 5G/8rmFKAhmkgqDLC57/6kos5SDS X-Google-Smtp-Source: APXvYqzEASfQIAvhqO0KlQFRyoOClqW8T4xtw88b+lPzHXeqmJEx8vRq1kIsMVXdsNXRD+fYn4Q3jg== X-Received: by 2002:a5d:640d:: with SMTP id z13mr21518935wru.181.1581947720385; Mon, 17 Feb 2020 05:55:20 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id m3sm1021533wrs.53.2020.02.17.05.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 05:55:19 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 17 Feb 2020 13:55:14 +0000 Message-Id: <20200217135517.5826-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 0/3] Xen on Hyper-V: Implement L0 assisted TLB flush X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Andrew Cooper , Paul Durrant , Michael Kelley , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all This seris is based on Roger's L0 assisted flush series. I have done some testing against a Linux on Hyper-V in a 32-vcpu VM. All builds were done with -j32. Building Xen on Linux: real 0m45.376s user 2m28.156s sys 0m51.672s Building Xen on Linux on Xen on Hyper-V, no assisted flush: real 3m8.762s user 10m46.787s sys 30m14.492s Building Xen on Linux on Xen on Hyper-V, with assisted flush: real 0m44.369s user 3m16.231s sys 3m3.330s Building Linux x86_64_defconfig on Linux: real 0m59.698s user 21m14.014s sys 2m58.742s Building Linux x86_64_defconfig on Linux on Xen on Hyper-V, no assisted flush: real 2m6.284s user 31m18.706s sys 20m31.106s Building Linux x86_64_defconfig on Linux on Xen on Hyper-V, with assisted flush: real 1m38.968s user 28m40.398s sys 11m20.151s There are various degrees of improvement depending on the workload. Xen can perhaps be optmised a bit more because it currently doesn't pass the address space id (cr3) to Hyper-V, but that requires reworking TLB flush APIs within Xen. Wei. Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: Roger Pau Monné Cc: Michael Kelley Cc: Paul Durrant Wei Liu (3): x86/hypervisor: pass flags to hypervisor_flush_tlb x86/hyperv: skeleton for L0 assisted TLB flush x86/hyperv: L0 assisted TLB flush xen/arch/x86/guest/hyperv/Makefile | 2 + xen/arch/x86/guest/hyperv/hyperv.c | 17 ++ xen/arch/x86/guest/hyperv/private.h | 13 ++ xen/arch/x86/guest/hyperv/tlb.c | 212 +++++++++++++++++++++++++ xen/arch/x86/guest/hyperv/util.c | 74 +++++++++ xen/arch/x86/guest/hypervisor.c | 7 +- xen/arch/x86/guest/xen/xen.c | 2 +- xen/arch/x86/smp.c | 5 +- xen/include/asm-x86/flushtlb.h | 3 + xen/include/asm-x86/guest/hypervisor.h | 10 +- 10 files changed, 334 insertions(+), 11 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/tlb.c create mode 100644 xen/arch/x86/guest/hyperv/util.c