From patchwork Wed Jun 10 05:32:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kelsey Skunberg X-Patchwork-Id: 1306464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49hbHT56SVz9sSF; Wed, 10 Jun 2020 15:33:08 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jitMF-0000wq-ES; Wed, 10 Jun 2020 05:33:03 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jitMD-0000vV-I6 for kernel-team@lists.ubuntu.com; Wed, 10 Jun 2020 05:33:01 +0000 Received: from mail-oi1-f197.google.com ([209.85.167.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jitMD-0005If-6O for kernel-team@lists.ubuntu.com; Wed, 10 Jun 2020 05:33:01 +0000 Received: by mail-oi1-f197.google.com with SMTP id l197so541716oih.11 for ; Tue, 09 Jun 2020 22:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8+gwsbUY3Bv9Sy0uj3B0ieURV7I8eJp8KWRp4QC9bdc=; b=EYPGraZN03jQmWYR+7us0jQUmWXtFLL23mX7hPe6cJ9zEMovrE7/0QxVjtLkmC5AHx vCaZir/c7dCIbmybAutnZdSmvZ9Sp6Mk9JA6LP94wDAqctxfq8sOdYLU0t/NtCdNJNAp F/J9QtcoOGs0Ef5inGuydAgEW6C5qG8va69FUtWDAQMnxiMrAp6sbzJt+Vr9WzZeQsBy ZVCwX6mPeHvTXe0gRRC+5sxRM/0oeNRXuYN8z0D+3SsFKeBP1t0bl18BrmKsAEATfh4O wRrNg5Jo1v4VCJIZtsgacjuY0A1JgSZ7KQmMNHenUkUr9Q2DhFHIYdfZTEQDqN14Y8+E xWqQ== X-Gm-Message-State: AOAM532kWCvEsJrknsDH1XX/Ga1hrp6rDAca3naZrfttgJboo6LCyj6k dpEid9/bBrFDhV8Y1J9HHFLFNZyGbT33H/U+nBEvTTChs2JEJTOwrFrcBN5ZieCCEeeympxPTFm hY+TqlTJF2LY1oCC23JRHyNCx8qUU9rkCVLeGwcnZkQ== X-Received: by 2002:a05:6830:6:: with SMTP id c6mr1308033otp.62.1591767179879; Tue, 09 Jun 2020 22:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlKTt0Wdodt2FmCwUMrXVtiiyyLzBoezBG87N0TrY2lL6Z1SEe69eD+QottiuDRFgkRDzlLA== X-Received: by 2002:a05:6830:6:: with SMTP id c6mr1308025otp.62.1591767179608; Tue, 09 Jun 2020 22:32:59 -0700 (PDT) Received: from localhost.localdomain (c-73-243-191-173.hsd1.co.comcast.net. [73.243.191.173]) by smtp.gmail.com with ESMTPSA id w185sm3696583oiw.14.2020.06.09.22.32.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 22:32:59 -0700 (PDT) From: Kelsey Skunberg To: kernel-team@lists.ubuntu.com Subject: [focal:linux-azure/eoan:linux-azure][PATCH 2/2] clocksource/drivers/hyper-v: Set TSC clocksource as default w/ InvariantTSC Date: Tue, 9 Jun 2020 23:32:55 -0600 Message-Id: <20200610053255.68140-3-kelsey.skunberg@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200610053255.68140-1-kelsey.skunberg@canonical.com> References: <20200610053255.68140-1-kelsey.skunberg@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Andrea Parri BugLink: http://bugs.launchpad.net/bugs/1875467 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 (cherry picked from commit 9e0333ae38eeb42249e10f95d209244a6e22ac9f) Signed-off-by: Kelsey Skunberg --- 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 ba2c79e6a0ee..5abc3872bba1 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -207,6 +207,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. */ struct clocksource *hyperv_cs; @@ -239,7 +247,7 @@ static u64 read_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, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS, @@ -265,7 +273,7 @@ static u64 read_hv_clock_msr(struct clocksource *arg) static struct clocksource hyperv_cs_msr = { .name = "hyperv_clocksource_msr", - .rating = 400, + .rating = 250, .read = read_hv_clock_msr, .mask = CLOCKSOURCE_MASK(64), .flags = CLOCK_SOURCE_IS_CONTINUOUS,