From patchwork Wed Feb 19 11:44:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11391277 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 54619109A for ; Wed, 19 Feb 2020 11:45:30 +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 306C024654 for ; Wed, 19 Feb 2020 11:45:30 +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="UCbom59F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 306C024654 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 1j4Nm5-000453-Hz; Wed, 19 Feb 2020 11:44:17 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4Nm4-00044x-Ap for xen-devel@lists.xenproject.org; Wed, 19 Feb 2020 11:44:16 +0000 X-Inumbo-ID: 27a86d80-530d-11ea-ade5-bc764e2007e4 Received: from mail-wr1-x442.google.com (unknown [2a00:1450:4864:20::442]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 27a86d80-530d-11ea-ade5-bc764e2007e4; Wed, 19 Feb 2020 11:44:15 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id n10so182349wrm.1 for ; Wed, 19 Feb 2020 03:44:15 -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=tqtA/at6nznMM8z1Ao2qqWvMCxIL6kTVX4e4Ch0v34w=; b=UCbom59FzofrG5ppKFh7CpQOJiHt7A7OJ2APStX98++OSh3+AsYSiUSIjsuLp0Hv/p YGSyYs66UUCzMGiPHpREOGbNOHimatSAkYgdyZv6srsovU3AlgTLnw9oHiXRUzbFLyaB cRsvsB1k72w60OU7z1AKIqfoeqLZAkPDkBeF8Z2NoPur8o4/DfmO/SVREZHSDCzGJkg6 rxe++IRul/5tdWQAGtGyWenYTXI4sfa3Et3e3A6bv2rv9ENSzTRX4Sgy7Cm9EFp6j92f 4dRsk4ACXxDV7CxN8XxWLOEfsuLzHTgCe3H+yk01UKVYJ4IAz1uGXxkvk5tbVa9p/t8w LSpQ== 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=tqtA/at6nznMM8z1Ao2qqWvMCxIL6kTVX4e4Ch0v34w=; b=AaZuQYAhBErQ0r6EWXTiPH+z0fVUe4VwoPkZIgxjpTKtfDVkH69mcBnsR7oHRZCuQE axIZ0QOJddX8Xejk3E682dfu2uEt9LVhU2ROsiijsjDQEuFJwvdrfcUDUW4/0mJXb8gQ HdCLtZXhf43MjbQQlJl8Y/+xB8CxIzD21//uPB/W0n8vGLxqcv2NXFOZMPX6V1iDzjOZ 0WLdTbnmT3QsHMThpRSrmGybAlW8RSSmIdKOLbh27aW3GPDbF96r3Cly1nBKWbGU5pNc qtlHjUQk1FgvnP8T17LICDvh3m7Gi/pdKY08+o81QpPEJCSv0xEU2rnCHd4Pk+Y9Nqyo mNXg== X-Gm-Message-State: APjAAAV4A4zANuuR307iUnDqFvrfM1ig3VPex6vni05AU3rRzML0Ngei 0WOK2CK1BlQ3n3nm2jrcobRf6Q1TGQE= X-Google-Smtp-Source: APXvYqzB1MIJojhopSa9T6g3GzBQTSOi0TrXs9DPvk+/eo3rIJPLeisiU6V6FZzDbcXfyRmXKz4+9Q== X-Received: by 2002:a5d:6445:: with SMTP id d5mr35036876wrw.244.1582112654601; Wed, 19 Feb 2020 03:44:14 -0800 (PST) Received: from localhost.localdomain (41.142.6.51.dyn.plus.net. [51.6.142.41]) by smtp.gmail.com with ESMTPSA id q3sm2534657wmj.38.2020.02.19.03.44.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 03:44:14 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Wed, 19 Feb 2020 11:44:08 +0000 Message-Id: <20200219114411.26922-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 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 | 12 ++ xen/arch/x86/guest/hyperv/tlb.c | 214 +++++++++++++++++++++++++ xen/arch/x86/guest/hyperv/util.c | 75 +++++++++ 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, 336 insertions(+), 11 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/tlb.c create mode 100644 xen/arch/x86/guest/hyperv/util.c