From patchwork Wed Feb 12 16:09: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: 11378697 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 0BAC41805 for ; Wed, 12 Feb 2020 16:10:50 +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 DC9D32082F for ; Wed, 12 Feb 2020 16:10:49 +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="vYOT17+h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC9D32082F 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 1j1uZo-0003MY-Ul; Wed, 12 Feb 2020 16:09:24 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j1uZn-0003MS-Ha for xen-devel@lists.xenproject.org; Wed, 12 Feb 2020 16:09:23 +0000 X-Inumbo-ID: 0814e4b8-4db2-11ea-bc8e-bc764e2007e4 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0814e4b8-4db2-11ea-bc8e-bc764e2007e4; Wed, 12 Feb 2020 16:09:22 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id w12so3071224wrt.2 for ; Wed, 12 Feb 2020 08:09:22 -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=FvtrUfESpP1af0D5iJuW1Q1zTMIMzEbM8jOIQcDUYbo=; b=vYOT17+hsC5UeKRyb2q0u/Za0fWM7jqmBC6Fm3q0H2WVxJm52c20sV5Yp7PGPM3WtZ E1jKVgGy3gn7wMayzgaSdfNJ2TIQDRTlVX3B1d5hUTA6xUsZB3KtVMUKbsrz1/ZnAvHY /JeJ+p+Pv3SKqBNA7kTQ9WbbsASG3skDDm7X4gn2OSAX7PzPZMd+a89bt3MKoE1PHKFu kTGnFPu53ltQ9O3NO/yJM87kRhETI0ZLX9EsmntR0Q1J6eVsdJOdRk5hYXg/LXPXgElk Oina0UR6/UZsHGiuHmqZLMwa4JFH1f8DOWcpEaw738xW6OFTjOXqM9Ah27g1Hv8jOpWP /vPw== 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=FvtrUfESpP1af0D5iJuW1Q1zTMIMzEbM8jOIQcDUYbo=; b=U0AfuT76KldGN2g2udmnt+7NSpTJDCyib8DYukENiwQlnltZTw4uoPaSWc+UljNRyl 7++2fIz0CpGvEa96+HLHH4sDilkSCO1Dpst5tZfZ0PdQll9odVPG0sXHk94j9EuCiTq4 4phSJXneJYhr11STHRzEgwvPZ5GlGYuQClixNNqtnh6+H7JA34BAaSnYV5lnq9Uo8Yj/ JWB3pV5MdmWgWcDTJLxofAqTwugieG67G14QbHOfI5PT+7tJN7xMJ3918NwHyaynUvVE PewXSv99dltM8uq6hDKz8n+A72UFjaE8qMCMszeEQkuGW2AT6Cr4s9PLxAzgEipyIOnf 4MPw== X-Gm-Message-State: APjAAAVQJG+U963Z6f0CV1MbymLi0Rnix/rWazU/+mvV4UHBhVs44Zaq FtGisS95X3a3JEY/agtJ9+YyMXHe X-Google-Smtp-Source: APXvYqwDeB6GxCiYmbAIgzvE4j26GLu4RfupTLMhtDy+yoCkPdJM92ui19Pt9fj+d8mA1ZmOS2V0Sg== X-Received: by 2002:a5d:474b:: with SMTP id o11mr16605677wrs.255.1581523761717; Wed, 12 Feb 2020 08:09:21 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id o4sm1142500wrx.25.2020.02.12.08.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2020 08:09:20 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Wed, 12 Feb 2020 16:09:14 +0000 Message-Id: <20200212160918.18470-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 0/4] 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 (4): x86/hyperv: misc cleanup 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 | 19 +- xen/arch/x86/guest/hyperv/private.h | 15 +- xen/arch/x86/guest/hyperv/tlb.c | 211 +++++++++++++++++++++++ xen/arch/x86/guest/hyperv/util.c | 72 ++++++++ xen/arch/x86/guest/hypervisor.c | 4 +- xen/arch/x86/guest/xen/xen.c | 2 +- xen/arch/x86/smp.c | 2 +- xen/include/asm-x86/guest/hyperv-hcall.h | 5 +- xen/include/asm-x86/guest/hypervisor.h | 10 +- 10 files changed, 329 insertions(+), 13 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/tlb.c create mode 100644 xen/arch/x86/guest/hyperv/util.c