Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp346081pxb; Wed, 20 Jan 2021 08:21:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDs71ClsT46qB5v8z4nKdOsmLzSgequPw67prQ762nuDqXpcymQYgd4yn8o/8jh7eT/IoO X-Received: by 2002:a17:906:1d5a:: with SMTP id o26mr6684807ejh.301.1611159676684; Wed, 20 Jan 2021 08:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611159676; cv=none; d=google.com; s=arc-20160816; b=rJh/wI4Nx8yFmIlns/5u0laL0zMx6QeazLYv93X2jAn01Hva0YGmnzty09Wl39jbBt GS61HKsbDvtfK8iMhGQoGYkJ0GPvQVgCB7bkAsMDVOqm3zTJ+GulgkAJokWIniBPhq2t aRtSTtrPVuNAzld7Mu8Gkq2LywoHyKmjL0+/d8eBA6u3tRzDLxiTZbbpUXCKQlXcr5rZ J4b5eNsrUMW0q+556ipHIhKVP1o7tmzuA/Gyph8lNSp/nCznh6u9uPT8R5jOAZJPAfaG 0R1YaQjWIkKB/G8X5449smA3BnZrzbsPnvOAmonq0X140KlVOxR1rYRLup2XxqJd2o5l Kw9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Q3YaCJQ8LfKzkGjKHvvi/q44WKBCWlUY5g3M93ES9N4=; b=fCn9Ull6Nk1w2gpziWCSXDGjN6e+UqJvnO77Di7BCfc5xJaUjqt4oEmeMl064qRGe8 gbPznBWBftlv/y4Y09MUaH0M2APUtf/n7fcLmNivSWoDl+uj/xs/tVTJsguOayE4NyeW I9XuDA2dPqur50yA6IrRNttWmfYigLB0h0Q9+PqhlUHQaYzFbNxFK0YnICeTFExg06GJ 74bNRHaa1oS44djFxZRasqrothWOmHRvezs9FRh6aO99Nh5UewUkQDuaQvTzxQGRJ5/k g9jWtmadCc7U3HWkjPHSaBTgTaGQZjL1Jm1aBN17BGM/NOBi2yo4bsrCnEtQDWjW74dt qong== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Qt+31s0k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g23si822875ejo.55.2021.01.20.08.20.50; Wed, 20 Jan 2021 08:21:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=Qt+31s0k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391280AbhATQRp (ORCPT + 99 others); Wed, 20 Jan 2021 11:17:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391344AbhATQOq (ORCPT ); Wed, 20 Jan 2021 11:14:46 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC513C0613C1 for ; Wed, 20 Jan 2021 08:14:04 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id s11so19123297edd.5 for ; Wed, 20 Jan 2021 08:14:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q3YaCJQ8LfKzkGjKHvvi/q44WKBCWlUY5g3M93ES9N4=; b=Qt+31s0k7Mjn6X5fLAPTZQBwGj66PX2q4gx9kZJM9UU0Fj9zKf9iGeB0nLS2LYGKMg LWmex1RpYlfY9c7UusCIbs5ju8pv3J++sSocIjMB0TZeXaiOMpwKWUVIWcYTMDBCKshV KjCry0XhhdgozhMjbeK7T8OsOyK3HHOJ+FpG/iMZXDHOmzjR91e20ux83TWKRlkXNvni weYgzqBxlQMq5jxc7aAh1xOhFkoVzr449eIWCGojiBzCQMwEra67oRs/VMHKqTTvdp1/ WqdjBF3YCBKno8Fy90iju+Cvm4YwOeOtDaQ98rEw5RykZWJLVHF0vaAlgEtzzw2llV+X YTzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q3YaCJQ8LfKzkGjKHvvi/q44WKBCWlUY5g3M93ES9N4=; b=Om1Z2b5d3n+DlsibdVohrGnW61fVWxIeFbgHgeQHusoi2JgufmrfUcNL3ojVc5L4+y MwVEPiaQFRWaiJ9mNXjgIgiTT7SOjd6gKJwjK6XB07mEYvvhi20/qb2fbgjX3Mti3TLH Mz8GLZVUfT1IXRoHv+PBzpmaSXXnHDFgBqQhgPtSc0tBf7jaunmROlNF391AQWodbimL 7cXUwk0utk483o8Aj7KMmLdGvThUSlog7g22/wgPZc0PvAt3fKeR2NkpyojZceKUVG4+ yWTj8rwBr5XcgewpfMTZpPn/PlvCbOyjRwGlEti4WRwg4XWZEtq02s5oSAN3NlX2ZuZi T/6Q== X-Gm-Message-State: AOAM531TKmGjLYGr3JjRkDPNkJlnLLpb6dIrWhJ6DGQpapkNuO7NkPge IjfdfDQSuWQjrabAdB9DofGJ/50GWNRlJ11SJWwPnw== X-Received: by 2002:aa7:d803:: with SMTP id v3mr7702645edq.153.1611159243691; Wed, 20 Jan 2021 08:14:03 -0800 (PST) MIME-Version: 1.0 References: <20210120120058.29138-1-wei.liu@kernel.org> <20210120120058.29138-6-wei.liu@kernel.org> In-Reply-To: <20210120120058.29138-6-wei.liu@kernel.org> From: Pavel Tatashin Date: Wed, 20 Jan 2021 11:13:28 -0500 Message-ID: Subject: Re: [PATCH v5 05/16] clocksource/hyperv: use MSR-based access if running as root To: Wei Liu Cc: Linux on Hyper-V List , virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Daniel Lezcano , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 20, 2021 at 7:01 AM Wei Liu wrote: > > When Linux runs as the root partition, the setup required for TSC page > is different. Why would we need a TSC page as a clock source for root partition at all? I think the above can be removed. Luckily Linux also has access to the MSR based > clocksource. We can just disable the TSC page clocksource if Linux is > the root partition. > > Signed-off-by: Wei Liu > Acked-by: Daniel Lezcano > --- > drivers/clocksource/hyperv_timer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c > index ba04cb381cd3..269a691bd2c4 100644 > --- a/drivers/clocksource/hyperv_timer.c > +++ b/drivers/clocksource/hyperv_timer.c > @@ -426,6 +426,9 @@ static bool __init hv_init_tsc_clocksource(void) > if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE)) > return false; > > + if (hv_root_partition) > + return false; > + Reviewed-by: Pavel Tatashin