Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp245527ybl; Thu, 23 Jan 2020 22:52:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzXMbZCL3Dkp2Vdy6pkESXS+pf1NiIHeco4Xa3xHlO6rl9ydWv9G7nHMUfbZxMRjapim18+ X-Received: by 2002:a54:4595:: with SMTP id z21mr1137717oib.136.1579848741088; Thu, 23 Jan 2020 22:52:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579848741; cv=none; d=google.com; s=arc-20160816; b=k578Ub9GSrSghY4Pa/Q13FVF6YVvOyDJqQ4T21jufVMY9GHMLbfCEueQYfdqmYC5yO 3+qwiuiZnkljova5VB+UX5HJs1CcrkQfrgLoytgwGe8zoAcpZ+Jmn2SVFDN9n+vmCPlR quDKhQpOZJaS/aZn+8mt8xim3BJ2s5wvJeUDdgH3uR7us2iL3orbcFhMopzjt8Fi8/pB 7y6PV74ADoYC+TtUPvpDVdRHcEGda/LBNEwgoM4Ltwz0uUbkXTmG4OhwELmuQCWkQoWF 6WocsHL5ibSxRl0fz7NmYEtWSO42GPVarI23LSEm/dE1O5wE2kPhm4PLnB0H54eemxME 1TJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YSOjP9t3Qp0ku6Q8pEO918zSn1Ag2RAEJZlCm/7bInY=; b=HKV8v7Ji6+hcLOEIYvgUh24XMvihyLfzEpG8VRY5/+fDkvj7HuuhnlwMg8IOpYTWRp YRP6TufoSF4xXVX/eVYTsy4eDUFaXwGOU0+Dhlk2EojOlvgsUB5YdzzYCCoXg56s4v9Q oSzPfZ/g82Ig3m9JNkYxz2E9VZ1hec7PPrNjpdF1btD72OPJZNmMEmUmtXAz5/S0cnAr vSxESBGrFbZpDKO4hLIBMBoG0dW5xGoJRTMABhsA4AVvDemcqGnJP6JW3rAYWwhPbcVv X0wiQLLXUpZSvddcJ3VX8JHHIukJiHShAH5PL4/zu5yntje3vfEsbPeeuGMA57e/27fO 0z0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=leGy9UEY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si2419715otc.130.2020.01.23.22.51.57; Thu, 23 Jan 2020 22:52:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=leGy9UEY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730511AbgAXGcW (ORCPT + 99 others); Fri, 24 Jan 2020 01:32:22 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:33853 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgAXGcW (ORCPT ); Fri, 24 Jan 2020 01:32:22 -0500 Received: by mail-qt1-f196.google.com with SMTP id h12so756696qtu.1; Thu, 23 Jan 2020 22:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YSOjP9t3Qp0ku6Q8pEO918zSn1Ag2RAEJZlCm/7bInY=; b=leGy9UEYzaFConSl04EYhM42RL+3biH/D+bA8TOvdqfEaQTb96WtLj3lUwwEC3JmWM tlRdJSke1+218ugsYyGxHxcA46pO23GUHrNyOYocpRpI41btP5gqNyNcNLC/jeMMGwkO NANwPhkaJoGDSlGBfyAm2uKmw5l2mvMMFKjK+iFXkqxYR06ILnXuYQPploTOkumVxm+3 a91ELQC2OaR8aT798cQpRaRNBYnMKrPNM3RZbJPNQgfiw2YrQT+kW2WQFoPvf4lDytT7 DG7+0uPUtltHL8aOba4g9WaNenSWLtVTfMylpAGLOnYWBZPLpUQq3tisqfhxwAqwQg32 jImQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YSOjP9t3Qp0ku6Q8pEO918zSn1Ag2RAEJZlCm/7bInY=; b=oHuWisPiOVmt8jgoxOoZ7bxyuHhbrSXvonhultN/zlI1cLqPZARmQe7I3+riwN3WPP ZD/g0YghHh7httFfpXwej/Rseq3ebGU9fXhMv7d1VYTYervj8iWbB/2CuY/5wdJz7T6H dP6ZXremC7jyAcIR9QF446cURusbQzT0sP4NoXbujR9MuZEAx9LDGwFooG6CErh3g1Fb tRUm9DVulZhuNd9fU1Mv9sNY2RXH1Z3L84/7kYOM7Xz+mtDMzcxUaxZE4dW1tMEaZ9UY 9Hl/yeP8IivrMuJonI9R9jvEbUFJt5zE8orB9KTN7Jk5wPNr3zI418jWipq5So8+6Sz8 c6Hw== X-Gm-Message-State: APjAAAUjgtIoLulAOI4T/ZXNP6H7QkeLmxksMsyXS4jYZyppWoKwg4Fp 3tYmwzZvjd3IzVNBmvlgh5s= X-Received: by 2002:ac8:5555:: with SMTP id o21mr796978qtr.350.1579847541113; Thu, 23 Jan 2020 22:32:21 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id z6sm2417896qkz.101.2020.01.23.22.32.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jan 2020 22:32:20 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailauth.nyi.internal (Postfix) with ESMTP id 7C2FC21C28; Fri, 24 Jan 2020 01:32:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 24 Jan 2020 01:32:18 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrvdefgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucffohhmrghinh epkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhdpihhnfhhrrgguvggrugdrohhr ghenucfkphephedvrdduheehrdduuddurdejudenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhpvghr shhonhgrlhhithihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrdhfvg hngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghmvg X-ME-Proxy: Received: from localhost (unknown [52.155.111.71]) by mail.messagingengine.com (Postfix) with ESMTPA id D70F6328005A; Fri, 24 Jan 2020 01:32:16 -0500 (EST) Date: Fri, 24 Jan 2020 14:32:15 +0800 From: Boqun Feng To: Vincenzo Frascino Cc: linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sasha Levin , Stephen Hemminger , Catalin Marinas , Haiyang Zhang , Michael Kelley , Stefano Stabellini , xen-devel@lists.xenproject.org, Thomas Gleixner , "K. Y. Srinivasan" , Will Deacon Subject: Re: [RFC 0/6] vDSO support for Hyper-V guest on ARM64 Message-ID: <20200124063215.GA93938@debian-boqun.qqnc3lrjykvubdpftowmye0fmh.lx.internal.cloudapp.net> References: <20191216001922.23008-1-boqun.feng@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vincenzo, On Thu, Jan 23, 2020 at 10:48:07AM +0000, Vincenzo Frascino wrote: > Hi Boqun Feng, > > sorry for the late reply. > That's OK, thanks for your review ;-) > On 16/12/2019 00:19, Boqun Feng wrote: > > 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. > > > > I had a look to your patches and overall, I could not understand why we can't > use the arch_timer to do the same things you are doing with the one you > introduced in this series. What confuses me is that KVM works just fine with the > arch_timer which was designed with virtualization in mind. Why do we need > another one? Could you please explain? > Please note that the guest VM on Hyper-V for ARM64 doesn't use arch_timer as the clocksource. See: https://lore.kernel.org/linux-arm-kernel/1570129355-16005-7-git-send-email-mikelley@microsoft.com/ , ACPI_SIG_GTDT is used for setting up Hyper-V synthetic clocksource and other initialization work. So just to be clear, your suggestion is 1) Hyper-V guest on ARM64 should use arch_timer as clocksource and vDSO will just work. or 2) Even though arch_timer is not used as the clocksource, we can still use it for vDSO. ? Regards, Boqun > > 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 > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > > > > -- > Regards, > Vincenzo