From patchwork Mon Dec 16 00:19:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boqun Feng X-Patchwork-Id: 11293253 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 8D5DF112B for ; Mon, 16 Dec 2019 00:21:03 +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 682DF24682 for ; Mon, 16 Dec 2019 00:21:03 +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="Gmb45a2r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 682DF24682 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 1ige6o-0006hX-FJ; Mon, 16 Dec 2019 00:19:34 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ige6n-0006hS-Nn for xen-devel@lists.xenproject.org; Mon, 16 Dec 2019 00:19:33 +0000 X-Inumbo-ID: bbd8e982-1f99-11ea-88e7-bc764e2007e4 Received: from mail-qk1-x744.google.com (unknown [2607:f8b0:4864:20::744]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id bbd8e982-1f99-11ea-88e7-bc764e2007e4; Mon, 16 Dec 2019 00:19:33 +0000 (UTC) Received: by mail-qk1-x744.google.com with SMTP id x1so3866108qkl.12 for ; Sun, 15 Dec 2019 16:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aZ6sGO0KS0Q8EYVwWz/tNENQC8GnXFZ6xRDHj7knL74=; b=Gmb45a2redl2v2Psqc9UmK5BWjcPglzmbzjDpsikHLbmggLKdOVorJeLzaOihAp93n dZuMPP9Yq0XhR4kkhOpXSkhSDgDY7Q1xUpGZhMf6Ogg+p7xlsNEqI8pOq07smNJIb729 KRa4FwyruYu+W4RNN1PJgXm4h6Ulv+MJjNPQcDIV0FZh4+eA8lE6SlNe6p65GE7u3Z6k Wa+wg8XDsBh++bc/vo63jVSfEKICDmwU/S4INp786dJO2HHJnWsMRwktN9Y0UajVgbpm NrNsEFU0hxV8nLsegKRlsf3oghWVDY2nCi+m+2Fp1dRlscQL+URlyVJ1jR+XgzFXJbZM L3dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aZ6sGO0KS0Q8EYVwWz/tNENQC8GnXFZ6xRDHj7knL74=; b=OrrNwpDMu5znlMNrYKP6vPeY1GoTuwEDa4KpHFP5scdx/sTXoV2eeP8zySIuOduTzt 4Ls1Raa+JD52AanptRyjt9xFeU2f3jpBADdePMihDhon2WfYTH6arZy8STBENPdpBCCA wstOFGTu8ZLvawh1MNXG15VGDuudFhz+FV89L3B0VVhKfvw1NFPtev9ULrmVpFVNXTUR HRY7S1tYzhuRy+OHdefj3D8b1G+Avd4xsXBl4ioBtOBdwbgIldvhXFEGVwA4Qun2M2GR b+Nxf8zmoPp1dsmJ0l2gcGbTipclz+OsDmIdBHzin6NqSYdEUFw1M8z/wfkFNWYjoOCe 0Yng== X-Gm-Message-State: APjAAAXJAcijln10E+GaVLZUNu73jY8pZF0df9r1de7UIU1poo3jkClz cV5fsYDvcNP2e7L1S1zHw4+BWNLZ X-Google-Smtp-Source: APXvYqzAQwy89lyacoeuw+asSDBQYlTp0vqfLPII18paqb1S/uBBbW6TqUEv6w6/z3AIjjLrHyaopg== X-Received: by 2002:a37:48f:: with SMTP id 137mr24677846qke.25.1576455572728; Sun, 15 Dec 2019 16:19:32 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id e2sm5376739qkl.3.2019.12.15.16.19.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 15 Dec 2019 16:19:31 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 7111D22430; Sun, 15 Dec 2019 19:19:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 15 Dec 2019 19:19:30 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtgedgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhorhhtvggutfgvtghiphdvucdlgedtmdenucfjughrpefhvffufffkofgggfestdek redtredttdenucfhrhhomhepuehoqhhunhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgse hgmhgrihhlrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhgihhthhhu sgdrtghomhenucfkphephedvrdduheehrdduuddurdejudenucfrrghrrghmpehmrghilh hfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieel vdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtg homhesfhhigihmvgdrnhgrmhgvnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id 992E780062; Sun, 15 Dec 2019 19:19:28 -0500 (EST) From: Boqun Feng To: linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Mon, 16 Dec 2019 08:19:16 +0800 Message-Id: <20191216001922.23008-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Subject: [Xen-devel] [RFC 0/6] vDSO support for Hyper-V guest on ARM64 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: Sasha Levin , Vincenzo Frascino , Stephen Hemminger , Catalin Marinas , Haiyang Zhang , Michael Kelley , Stefano Stabellini , xen-devel@lists.xenproject.org, Thomas Gleixner , "K. Y. Srinivasan" , Will Deacon , Boqun Feng Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi, This is the RFC patchset for vDSO support in ARM64 Hyper-V guest. To test it, Michael's ARM64 support patchset: https://lore.kernel.org/linux-arm-kernel/1570129355-16005-1-git-send-email-mikelley@microsoft.com/ is needed. Similar as x86, Hyper-V on ARM64 use a TSC page for guests to read the virtualized hardware timer, this TSC page is read-only for the guests, so could be used for vDSO data page. And the vDSO (userspace) code could use the same code for timer reading as kernel, since they read the same TSC page. This patchset therefore extends ARM64's __vsdo_init() to allow multiple data pages and introduces the vclock_mode concept similar to x86 to allow different platforms (bare-metal, Hyper-V, etc.) to switch to different __arch_get_hw_counter() implementations. The rest of this patchset does the necessary setup for Hyper-V guests: mapping tsc page, enabling userspace to read cntvct, etc. to enable vDSO. This patchset consists of 6 patches: patch #1 allows hv_get_raw_timer() definition to be overridden for userspace and kernel to share the same hv_read_tsc_page() definition. patch #2 extends ARM64 to support multiple vDSO data pages. patch #3 introduces vclock_mode similiar to x86 to allow different __arch_get_hw_counter() implementations for different clocksources. patch #4 maps Hyper-V TSC page into vDSO data page. patch #5 allows userspace to read cntvct, so that userspace can efficiently read the clocksource. patch #6 enables the vDSO for ARM64 Hyper-V guest. The whole patchset is based on v5.5-rc1 plus Michael's ARM64 support patchset, and I've done a few tests with: https://github.com/nlynch-mentor/vdsotest Comments and suggestions are welcome! Regards, Boqun