Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp195556pxb; Wed, 20 Jan 2021 04:57:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3vYL7qJ4vW0uZSfG2JWUqEJlovK6nFeDzEt6qnR39gnWctItl6fX1OfIJcCTw0I1s2RLq X-Received: by 2002:a50:d60f:: with SMTP id x15mr7035960edi.224.1611147473876; Wed, 20 Jan 2021 04:57:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611147473; cv=none; d=google.com; s=arc-20160816; b=yX6THMTKCU9h/ltTrXKx6yATrvmZNkApD6Gza2EPSF7UM7DFkrdOFvcIRCmSJR4mtb tgdjnqo2mLBvG2BZn6SFU6S0tdbvOC0TZtgIxrTLsamduvpeOiSjjGNcM9UTeRnfI1yZ qHiw4VvOWqZcloJ6rtT4f8VR0W7DkieQCZEephpoM/B586OIxzdF/wHkdBoWeFow+fkB Y5MhhfdVeE1XjxaxyXeylR0cmcfYdjVRTaI7pdt2BxwAybtywt3IvByAIn87R+Zla/5I 22Uo0M5P7pNVcOSDSEHjneSCxX0CPQKM2Cb5uGnWTXNa5MCrbcnGEB2mzYu+h5J/ZsSb K5BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5A3GMg0kaUdhNbdjiZ51gEYmRqMxSWUTkm0nm29z41k=; b=rBVaiCe7CHhiC+rjDOAT8VhaD0VtROVJ6RuW89dzemt2qegHx5g7WlH/2Qs9503Tty 7nqVNJafXFoxzUBR7dQ8jjHRP+StdbdHYlrYfO5xMeK+iChxC9E/fsllxx4ygTFJ+e5C 7Pk4StDMK8uKoQvMwN4ooRsm0AwQ8DV2cr7W3JVW4l9e/TGCykCZAyONLHvxEEMSoz5d y8e6OzP6TExyIersdccod32Cntm5FKM5s/aPAsiRSOWfjkW5B8rKRk+dDRWCZL+bz5i0 zgfA6GCdUoghscWVB7h5qq9ed6mE4nur2OHkBBOJxs5tMeb0Sm/yt0/UJeU4AMuaF0gt YmHQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce16si844628edb.87.2021.01.20.04.57.28; Wed, 20 Jan 2021 04:57:53 -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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728452AbhATMze (ORCPT + 99 others); Wed, 20 Jan 2021 07:55:34 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:33007 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388968AbhATMJh (ORCPT ); Wed, 20 Jan 2021 07:09:37 -0500 Received: by mail-wm1-f49.google.com with SMTP id s24so3177337wmj.0; Wed, 20 Jan 2021 04:09:21 -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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5A3GMg0kaUdhNbdjiZ51gEYmRqMxSWUTkm0nm29z41k=; b=kAAZHac1+37YvXavuj8on0rR4tqGWcXE/b111YTWJwBAjN+hVOhO5MX+bsAmn+R6Vs f2mRkUDxg5hu5swXPQbDY36TorPjr/gmjm8Fb/O1ok4fpqWPjwYCS7N4+i7Ad8yj5q97 9rNfLPtvLMwG0fllkZUUzU17prYVY0dLB4OoRMdfpLvrWFt+j/m0R0Bv8BfAoCsU/dcp cvEsYjQA+uX58L1SJfmJWTVA+wOUGEvjF8ahY6yGXtGGJ5yJCF3St33ya7SAmWlPoigP 2Fq4kLPGLtbceimIx+uPcGzfC5o3Fh4qGtBXm9OY5jU8x3BsvdSKmmSnw/cKf/iqaBa/ bz5A== X-Gm-Message-State: AOAM530O5n6uOI+Vgwn/lM2r9xVb2ra+Hb6MUp9YLXymjVRBmWgwkp6b IIL+3wfYFDxEZTVCWjI7fKbNJ7X3D/M= X-Received: by 2002:a1c:1d8d:: with SMTP id d135mr4162973wmd.4.1611144066451; Wed, 20 Jan 2021 04:01:06 -0800 (PST) Received: from liuwe-devbox-debian-v2.j3c5onc20sse1dnehy4noqpfcg.zx.internal.cloudapp.net ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id x17sm3747671wro.40.2021.01.20.04.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 04:01:06 -0800 (PST) From: Wei Liu To: Linux on Hyper-V List Cc: virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , pasha.tatashin@soleen.com, Wei Liu , Daniel Lezcano , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner Subject: [PATCH v5 05/16] clocksource/hyperv: use MSR-based access if running as root Date: Wed, 20 Jan 2021 12:00:47 +0000 Message-Id: <20210120120058.29138-6-wei.liu@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210120120058.29138-1-wei.liu@kernel.org> References: <20210120120058.29138-1-wei.liu@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When Linux runs as the root partition, the setup required for TSC page is different. 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; + hv_read_reference_counter = read_hv_clock_tsc; phys_addr = virt_to_phys(hv_get_tsc_page()); -- 2.20.1