From patchwork Fri Feb 14 12:34:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11382195 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 34A681820 for ; Fri, 14 Feb 2020 12:35:39 +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 10B0A2086A for ; Fri, 14 Feb 2020 12:35:38 +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="cAK4NTV/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10B0A2086A 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 1j2aB1-0007VB-IM; Fri, 14 Feb 2020 12:34:35 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j2aB0-0007V3-Mf for xen-devel@lists.xenproject.org; Fri, 14 Feb 2020 12:34:34 +0000 X-Inumbo-ID: 5a9542f8-4f26-11ea-ade5-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5a9542f8-4f26-11ea-ade5-bc764e2007e4; Fri, 14 Feb 2020 12:34:34 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id p9so9800028wmc.2 for ; Fri, 14 Feb 2020 04:34:33 -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=p/Wt7Y3GJzoaX+6gybvaJ5i+iBu/CB+t4yTWKOaZqoU=; b=cAK4NTV/IeMGRH74ImXeDqpm33q3okDUdjnMM8swaoATlMy+6j0H3o7CN3nHoMhHaX /09SZUr3N5XhIxhTy2nZAoZGQocEcU0sdgNOREuYT4n013WBwomv/DA6fzixqL4jX8pp 7SQMCGlKlfDYcistQsCvLlT7xCpfvMnXcV6dKUbIvF7CES0JdGuZT5MogyS5cPL606W8 b19pwB0yITktiHPIbU5BL2nXJGeExuTMfBXw7j4PcD1LNJgR5J9hStlZlsos26yLxDx1 wUofsyETqaOw9vCWS7bJc+Q4PtUiNVVRmpv0NXtuqqe50eCQ3XHxyLvudtICBJsYjWdq ezxQ== 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=p/Wt7Y3GJzoaX+6gybvaJ5i+iBu/CB+t4yTWKOaZqoU=; b=FI4i0YdwjOGumJDu6u3ODFVA4swm8YdlnpCf/sSKnkB6X+KyaGVptAKnxeoA+XbTKO bIWvh0VOZUNAukba1pj9BUyLEVrhJmhNAASwAgZNB/HDBQwPHz22kA2ehxczjV59bBqP bdlV1x/4pJFkcGTHKTNx78AvxjNVjEX4rE+FELXsS0LAFfnLU1DHygc9zBGf9m1ge8Rg DcbDGCJH9wtqe6HKL+ZL5wbOc7G0IpUR/qfanKjVGelTt/hdO1MpeeoE53Z0PhgXF2kE 1BQPz8UGmUPcedckjW9QnffngT/DPIN+RD5kzjFmgEDnke1mGqiw9W+0OGXerPb9FekM tFEw== X-Gm-Message-State: APjAAAXw7t6W0mDScVu50kNVIYZkHF7/l5f51WA5ljmFcrNdn6XsYRlx 91hO68rj/WS/5dKtlrLtayQHKqB6V2Q= X-Google-Smtp-Source: APXvYqxyL9ALydl6h/fDQi+RM434uYZbijkjKdWL78OdC42JKAnW7FtN6w2Pq4+6o0P1gItF9TqjOw== X-Received: by 2002:a1c:65d6:: with SMTP id z205mr4389921wmb.38.1581683673011; Fri, 14 Feb 2020 04:34:33 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id x11sm7035566wmg.46.2020.02.14.04.34.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 04:34:32 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Fri, 14 Feb 2020 12:34:27 +0000 Message-Id: <20200214123430.4942-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2 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 | 211 +++++++++++++++++++++++++ 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, 333 insertions(+), 11 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/tlb.c create mode 100644 xen/arch/x86/guest/hyperv/util.c