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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 30B04C33CAF for ; Thu, 16 Jan 2020 18:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 098A3217F4 for ; Thu, 16 Jan 2020 18:23:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="RKc8ugzO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436613AbgAPSX6 (ORCPT ); Thu, 16 Jan 2020 13:23:58 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37685 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404275AbgAPSXu (ORCPT ); Thu, 16 Jan 2020 13:23:50 -0500 Received: by mail-wm1-f68.google.com with SMTP id f129so4860623wmf.2 for ; Thu, 16 Jan 2020 10:23:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pVwlqM68NaLq0oW83NYHHXkFWXShBvMo0oSKnK8wMuo=; b=RKc8ugzOjzsjjVfFnB1IDrwwop0QPgA1IVze1YUH5uR4ScFD634GD24lcW0+dnMNHj L1b6kQFNZQ3CQGjv0YZVklOZLjnNZzSqURkcJOSGjHKauYCp3ytva5IMyBYzMhLCmnBY KgvDqgH8x2hWCvj+00eLhQmy/ulUwLU7JHlm917qV6FcwX92/7myhl98nbQdTXjCH09r qTFGYJFqVDV9B8f4rjTrXYybFFat/rSIgQcUuAinYvvAY5gaeb5B2mhhJlfLlqkzdl7m orzscL0pv9Xs6pkgsP2wBhuTj6zm6CVK4rTgrUFBS1m+PwVU3WEJMAyx2BZeexZNXR5J JjcA== 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:in-reply-to :references; bh=pVwlqM68NaLq0oW83NYHHXkFWXShBvMo0oSKnK8wMuo=; b=emrhRe9dZ0ub0WeYmkbmPI6sEuYf03XF+vtGwRRjrh2hQHTw1w2dhHYfX4q80TM9yU cmdzvIEdl2w6micmlgysLmUQJv+GsfHmQE9Fcv6zUjlQol9UnGtS6Xg5P9Tjr+9MIYpq aLkx6uwKPu8KA/FMuvBr6U9BiBHHcCZrP3msdQFaTKmJLE9CdK6sgNMq+UVznSKvI7ja 2YxLexgoq8NHAz/kxfpXyjyADjFOT9czpUneVeiYyMY0oh8aWD3d8sBuZk2ccollRJzs GyaGyUxRRNei9cLk1Qm2U/H1+erZS1frmBPTPFh77c8Z6CWB5+JE+LXypCWlIsElsMpu szWQ== X-Gm-Message-State: APjAAAWezmN2naNeCl+AfoBq0bjezcWBkJfpBj/PVTTYqZoyAfW82lgs Hd4yStR/0552OlJK5mSKteypSw== X-Google-Smtp-Source: APXvYqzgmn1aYDt825s41tAgYAKaz3HwAeFgJJc9DZ9GCouYy0HrqiVB9wuMBSlJc58M07r/x1p+gw== X-Received: by 2002:a1c:dc85:: with SMTP id t127mr399860wmg.16.1579199027961; Thu, 16 Jan 2020 10:23:47 -0800 (PST) Received: from mai.imgcgcw.net ([2a01:e34:ed2f:f020:6c63:1b50:1156:7f0f]) by smtp.gmail.com with ESMTPSA id b137sm1087920wme.26.2020.01.16.10.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 10:23:47 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Andrea Parri , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , linux-hyperv@vger.kernel.org (open list:Hyper-V CORE AND DRIVERS) Subject: [PATCH 17/17] clocksource/drivers/hyper-v: Set TSC clocksource as default w/ InvariantTSC Date: Thu, 16 Jan 2020 19:23:04 +0100 Message-Id: <20200116182304.4926-17-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200116182304.4926-1-daniel.lezcano@linaro.org> References: <74bf7170-401f-2962-ea5a-1e21431a9349@linaro.org> <20200116182304.4926-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrea Parri Change the Hyper-V clocksource ratings to 250, below the TSC clocksource rating of 300. In configurations where Hyper-V offers an InvariantTSC, the TSC is not marked "unstable", so the TSC clocksource is available and preferred. With the higher rating, it will be the default. On older hardware and Hyper-V versions, the TSC is marked "unstable", so no TSC clocksource is created and the selected Hyper-V clocksource will be the default. Signed-off-by: Andrea Parri Reviewed-by: Michael Kelley Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200109160650.16150-3-parri.andrea@gmail.com --- drivers/clocksource/hyperv_timer.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index 42748adccc98..9d808d595ca8 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -302,6 +302,14 @@ EXPORT_SYMBOL_GPL(hv_stimer_global_cleanup); * the other that uses the TSC reference page feature as defined in the * TLFS. The MSR version is for compatibility with old versions of * Hyper-V and 32-bit x86. The TSC reference page version is preferred. + * + * The Hyper-V clocksource ratings of 250 are chosen to be below the + * TSC clocksource rating of 300. In configurations where Hyper-V offers + * an InvariantTSC, the TSC is not marked "unstable", so the TSC clocksource + * is available and preferred. With the higher rating, it will be the + * default. On older hardware and Hyper-V versions, the TSC is marked + * "unstable", so no TSC clocksource is created and the selected Hyper-V + * clocksource will be the default. */ u64 (*hv_read_reference_counter)(void); @@ -363,7 +371,7 @@ static void resume_hv_clock_tsc(struct clocksource *arg) static struct clocksource hyperv_cs_tsc = { .name = "hyperv_clocksource_tsc_page", - .rating = 400, + .rating = 250, .read = read_hv_clock_tsc_cs, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, @@ -395,7 +403,7 @@ static u64 read_hv_sched_clock_msr(void) static struct clocksource hyperv_cs_msr = { .name = "hyperv_clocksource_msr", - .rating = 400, + .rating = 250, .read = read_hv_clock_msr_cs, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, -- 2.17.1