From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46D50C2D0A3 for ; Thu, 12 Nov 2020 15:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB57722248 for ; Thu, 12 Nov 2020 15:31:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="i8rjBmP0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbgKLPbE (ORCPT ); Thu, 12 Nov 2020 10:31:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:32238 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbgKLPbE (ORCPT ); Thu, 12 Nov 2020 10:31:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605195062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XHp7Bo10vm0UfwNZa83vSvzkaRjk9257JvNRreDbMPA=; b=i8rjBmP0C5zRz7t2g6S6Rlh54z0DHobnsdzqi4eX+B1pbt39811kEnI2Y13hSIF0+UqbM3 7mLfSldlK1pa2GmpHL+Uj1NdW0hncsEqbSBzJ27xm0rXVhd1uGh62oy5sSUK8d9KgM7z5A PtFdw58GYpV1bTIOLMvPPH+gvH67NM8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-kvtycSgHMp-nscENdOn-uA-1; Thu, 12 Nov 2020 10:31:00 -0500 X-MC-Unique: kvtycSgHMp-nscENdOn-uA-1 Received: by mail-wm1-f71.google.com with SMTP id y26so1865503wmj.7 for ; Thu, 12 Nov 2020 07:31:00 -0800 (PST) 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:in-reply-to:references:date :message-id:mime-version; bh=XHp7Bo10vm0UfwNZa83vSvzkaRjk9257JvNRreDbMPA=; b=XYOFFHAUzN5d1J3H1H1PF50tpLXB1LQMlpel8lprDRDlrO9/triqFmVyGz3+ZXk8oy LeDU6eekKv1FVfsCDNcMSU1y9yogVlMAJnWioW1v+m210GV2oPlse63yxR8qKU1ixAaG k4m/gvQjPmtUZbHnfIbCs86BiBaL3+mYm84PpxyliVJvwjd0GpeGYNB7tmE2tk+zf9oT AnRay+P/SKtBA13eUvr2toa8IAqAIG2rWBf5JeOkZHtDWgiCOt+M/s1WzKOxQlZc1cur DA9VnKjvenbiZK5GMekl9YFP0GXPQUMEMVc3rqyiJLp3mBzbTi0UHs3Rw5rLWmL/i1gF 9nmA== X-Gm-Message-State: AOAM531VLOdHKPfnzbQVihOwdG2evtWwwmiZ/qSpnhjLzRS+u4umfa2D 3u1sPQvc/OQXd9vMIfdO5hRoObBJvkcTWBPMdstDqqBg9GlOdOvpo8T41KzPsMt1BJScCCT6rBH qw6B4HNeHmTCvYwAUlb5wyuuA X-Received: by 2002:adf:f542:: with SMTP id j2mr56187wrp.107.1605195059652; Thu, 12 Nov 2020 07:30:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1OngyKpQAS+Q4bbI3Hywakt2LTSLrDkVsSOy8wiQ/1aW5MGElsPEZVtZPjFlyvRpBGUIsaQ== X-Received: by 2002:adf:f542:: with SMTP id j2mr56174wrp.107.1605195059474; Thu, 12 Nov 2020 07:30:59 -0800 (PST) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id c129sm7158288wmd.7.2020.11.12.07.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:30:58 -0800 (PST) From: Vitaly Kuznetsov To: Wei Liu , Linux on Hyper-V List Cc: virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Wei Liu , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Daniel Lezcano , Thomas Gleixner Subject: Re: [PATCH v2 05/17] clocksource/hyperv: use MSR-based access if running as root In-Reply-To: <20201105165814.29233-6-wei.liu@kernel.org> References: <20201105165814.29233-1-wei.liu@kernel.org> <20201105165814.29233-6-wei.liu@kernel.org> Date: Thu, 12 Nov 2020 16:30:57 +0100 Message-ID: <87d00iy4lq.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org Wei Liu writes: > Signed-off-by: Wei Liu In the missing commit message I'd like to see why we don't use 'TSC page' clocksource for the root partition. My guess would be that it's not available and actually we're supposed to use raw TSC value (because root partitions never migrate) but please spell it out. > --- > 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; > + > hv_read_reference_counter = read_hv_clock_tsc; > phys_addr = virt_to_phys(hv_get_tsc_page()); -- Vitaly From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DAEC6C56201 for ; Thu, 12 Nov 2020 15:31:08 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 475692224A for ; Thu, 12 Nov 2020 15:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Vrvz+NsP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 475692224A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4A80385344; Thu, 12 Nov 2020 15:31:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lGDw1UpFUerQ; Thu, 12 Nov 2020 15:31:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id B7D5A87811; Thu, 12 Nov 2020 15:31:06 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A4F52C088B; Thu, 12 Nov 2020 15:31:06 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id F086AC016F for ; Thu, 12 Nov 2020 15:31:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E191487135 for ; Thu, 12 Nov 2020 15:31:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZgAxzZr0bX8Y for ; Thu, 12 Nov 2020 15:31:04 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by whitealder.osuosl.org (Postfix) with ESMTPS id 56D2587132 for ; Thu, 12 Nov 2020 15:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605195063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XHp7Bo10vm0UfwNZa83vSvzkaRjk9257JvNRreDbMPA=; b=Vrvz+NsPN9uNUq4lzcKkf8LCw48MoU6+Pta8F4tYeXk/SiM7P8qnDEuuV613OC9cluyyqn EiqiY0+++mc41Z3odwBT3yZx2m7U1HvTz0D8gTZpOqx7GCHJctNS71Bzk+UsaY9lQgG+nl 6FclgK9GsjlFHlcvXV2L0Yx+yrYmY+4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-465-f0ixWdjoPKSWXiDCvdslHg-1; Thu, 12 Nov 2020 10:31:00 -0500 X-MC-Unique: f0ixWdjoPKSWXiDCvdslHg-1 Received: by mail-wr1-f72.google.com with SMTP id k1so2080066wrg.12 for ; Thu, 12 Nov 2020 07:31:00 -0800 (PST) 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:in-reply-to:references:date :message-id:mime-version; bh=XHp7Bo10vm0UfwNZa83vSvzkaRjk9257JvNRreDbMPA=; b=Ybxqwo0fDHyTWpK/Ksv241kD7QpUL096R7LyFzr+P/WWJaGMKg3MJiqZTZ5Wzw9kni uKVLZcBhBZXh88si/YAZRoz6/Vol73ArI0dmzXMUszp6nLyyg+iXQzIZAQB1JifZgFlw GDgoVP9pkCQaf+v/Ptj5+TjD4ogFXZr+FSUAvUGwiqUBhUr1BrUE7A0qbCJmXhdw0ZUA oid4RSWLNp4eulQbIY4eLUYC99EoaLzUfQ9EJDRgYwEnAxOqh8zKMTW8SniwEw5/qRxI TsFXu7nSDUcg+8H5XGa7/vKV9SalJVA0exhsgClVJevG7DqrK6gTSU48Gixs1KAP7LiY KZMQ== X-Gm-Message-State: AOAM5319vQFVsd03ngv/NRH/1C++d61B3vfUNunBELIOGhz4CEWcNdIf 8TqsvIfpOoh5iI8cegjEnoVeJYjQqrv8x7UsRLdqOCLK29g7yMHm6L4G7hBbOzp+r4WfZfAFtgS Z2KIoLcNi7g08dqRQKMRn0WOkhyHGUYssv+rlzUdOJw== X-Received: by 2002:adf:f542:: with SMTP id j2mr56196wrp.107.1605195059653; Thu, 12 Nov 2020 07:30:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1OngyKpQAS+Q4bbI3Hywakt2LTSLrDkVsSOy8wiQ/1aW5MGElsPEZVtZPjFlyvRpBGUIsaQ== X-Received: by 2002:adf:f542:: with SMTP id j2mr56174wrp.107.1605195059474; Thu, 12 Nov 2020 07:30:59 -0800 (PST) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id c129sm7158288wmd.7.2020.11.12.07.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Nov 2020 07:30:58 -0800 (PST) From: Vitaly Kuznetsov To: Wei Liu , Linux on Hyper-V List Subject: Re: [PATCH v2 05/17] clocksource/hyperv: use MSR-based access if running as root In-Reply-To: <20201105165814.29233-6-wei.liu@kernel.org> References: <20201105165814.29233-1-wei.liu@kernel.org> <20201105165814.29233-6-wei.liu@kernel.org> Date: Thu, 12 Nov 2020 16:30:57 +0100 Message-ID: <87d00iy4lq.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vkuznets@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Wei Liu , Stephen Hemminger , Haiyang Zhang , Daniel Lezcano , Linux Kernel List , Michael Kelley , Nuno Das Neves , Sunil Muthuswamy , virtualization@lists.linux-foundation.org, Vineeth Pillai , Thomas Gleixner X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" Wei Liu writes: > Signed-off-by: Wei Liu In the missing commit message I'd like to see why we don't use 'TSC page' clocksource for the root partition. My guess would be that it's not available and actually we're supposed to use raw TSC value (because root partitions never migrate) but please spell it out. > --- > 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; > + > hv_read_reference_counter = read_hv_clock_tsc; > phys_addr = virt_to_phys(hv_get_tsc_page()); -- Vitaly _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization