Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1264882ybl; Fri, 23 Aug 2019 16:30:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYgm24jGfVIDJQDWdx5sTIEkRCzYdEvgarzM1loSOznlCzGnsi74SBjY0wCOCN6sYfpFTA X-Received: by 2002:a17:90a:ff04:: with SMTP id ce4mr7775605pjb.77.1566603031268; Fri, 23 Aug 2019 16:30:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603031; cv=none; d=google.com; s=arc-20160816; b=rdZ+LByBbrJWv+ObQdrau4eCDGpETD0PLIKsU1+17LDTjHkgBiVmqbVZKt2avztj8U fZO9Z5cnnxDnWnehiiTzojZdKxV2DPdIRqjTs9ogNWZRznwMPmXo93mMI32uPijfW0zV hjVaNiefHSrp/aYDBsTgoUb1HxH2IqJJd/OvmnT/wgz0nHZabB3KHTyozWQJBqt/eGDr 6ystZDhl54Q+yfPRoZhzibHjlkCpzwaIW+LX/z2BlmCbCPXcx/oNdILUiAz7y5blXOYX YT1NF34jO2c3P1K6iEr9xSgSOPfHERkUxMr0dJIGghAiSa6q+OK4BeeM4D5ussRsv+zt HV0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:robot-unsubscribe:robot-id:message-id :mime-version:references:in-reply-to:cc:subject:to:reply-to:from :date; bh=HVnVNGmzYpZzXDHSmOx/1o/AAiah0jvIdCu5wJzWbC8=; b=xEhX8uGJ8ydytCvEl+reCJBvNIMfZyhnFv/iKYwIYODvR4FnPIdRvF7+1QE46qLgEu esLJTdrZve2lMTFPhDwuR4AHRlVo+wwm6uaYUt5/Dv1Q+KFZeQVAk6xgKq/+JslFQ3t3 KZccasnsMN6W8cuTiYjoU5+6Qc+iUgbU5SpPSKEkUGeQEkUn2kGWIxAcBj/IPwkj/uOz rDZ0BX3YxF0pAXbH5hvhhG2gEKAlVO0PsEq/ztpGZYKJpadmlnI5h3QySDhfF1MQUci6 U5eKFGuOclBDWvH9JB3cKJvMczFB1SqY+XYe1SmxRV/5Rmtgdb8Sc8PhkbP6V4AIbijn lAuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si3903571pfm.145.2019.08.23.16.30.16; Fri, 23 Aug 2019 16:30:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394272AbfHWPEI (ORCPT + 99 others); Fri, 23 Aug 2019 11:04:08 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:35897 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394179AbfHWPEI (ORCPT ); Fri, 23 Aug 2019 11:04:08 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i1B6g-0004l4-MB; Fri, 23 Aug 2019 17:04:02 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 589BD1C04F3; Fri, 23 Aug 2019 17:04:02 +0200 (CEST) Date: Fri, 23 Aug 2019 15:04:02 -0000 From: tip-bot2 for Tianyu Lan Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/hyperv: Allocate Hyper-V TSC page statically Cc: Tianyu Lan , Thomas Gleixner , Daniel Lezcano , Ingo Molnar , linux-kernel@vger.kernel.org In-Reply-To: <20190814123216.32245-2-Tianyu.Lan@microsoft.com> References: <20190814123216.32245-2-Tianyu.Lan@microsoft.com> MIME-Version: 1.0 Message-ID: <156657264215.8396.8735760182496390490.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: adb87ff4f96c9700718e09c97a804124d5cd61ff Gitweb: https://git.kernel.org/tip/adb87ff4f96c9700718e09c97a804124d5cd61ff Author: Tianyu Lan AuthorDate: Wed, 14 Aug 2019 20:32:15 +08:00 Committer: Thomas Gleixner CommitterDate: Fri, 23 Aug 2019 16:59:53 +02:00 clocksource/drivers/hyperv: Allocate Hyper-V TSC page statically Prepare to add Hyper-V sched clock callback and move Hyper-V Reference TSC initialization much earlier in the boot process. Earlier initialization is needed so that it happens while the timestamp value is still 0 and no discontinuity in the timestamp will occur when pv_ops.time.sched_clock calculates its offset. The earlier initialization requires that the Hyper-V TSC page be allocated statically instead of with vmalloc(), so fixup the references to the TSC page and the method of getting its physical address. Signed-off-by: Tianyu Lan Signed-off-by: Thomas Gleixner Acked-by: Daniel Lezcano Link: https://lkml.kernel.org/r/20190814123216.32245-2-Tianyu.Lan@microsoft.com --- arch/x86/entry/vdso/vma.c | 2 +- drivers/clocksource/hyperv_timer.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 349a61d..f593774 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -122,7 +122,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm, if (tsc_pg && vclock_was_used(VCLOCK_HVCLOCK)) return vmf_insert_pfn(vma, vmf->address, - vmalloc_to_pfn(tsc_pg)); + virt_to_phys(tsc_pg) >> PAGE_SHIFT); } return VM_FAULT_SIGBUS; diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c index ba2c79e..432aa33 100644 --- a/drivers/clocksource/hyperv_timer.c +++ b/drivers/clocksource/hyperv_timer.c @@ -214,17 +214,17 @@ EXPORT_SYMBOL_GPL(hyperv_cs); #ifdef CONFIG_HYPERV_TSCPAGE -static struct ms_hyperv_tsc_page *tsc_pg; +static struct ms_hyperv_tsc_page tsc_pg __aligned(PAGE_SIZE); struct ms_hyperv_tsc_page *hv_get_tsc_page(void) { - return tsc_pg; + return &tsc_pg; } EXPORT_SYMBOL_GPL(hv_get_tsc_page); static u64 notrace read_hv_sched_clock_tsc(void) { - u64 current_tick = hv_read_tsc_page(tsc_pg); + u64 current_tick = hv_read_tsc_page(&tsc_pg); if (current_tick == U64_MAX) hv_get_time_ref_count(current_tick); @@ -280,12 +280,8 @@ static bool __init hv_init_tsc_clocksource(void) if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE)) return false; - tsc_pg = vmalloc(PAGE_SIZE); - if (!tsc_pg) - return false; - hyperv_cs = &hyperv_cs_tsc; - phys_addr = page_to_phys(vmalloc_to_page(tsc_pg)); + phys_addr = virt_to_phys(&tsc_pg); /* * The Hyper-V TLFS specifies to preserve the value of reserved