Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2206426imm; Thu, 19 Jul 2018 15:24:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeJACpwWF1Z9x7ze7CJ3rO/kKNNeEXBsJkXbmo5MGuZC1Vb9I+RW+VsGjqsQ3RU2lmcmgLR X-Received: by 2002:a63:6a45:: with SMTP id f66-v6mr11348236pgc.81.1532039067464; Thu, 19 Jul 2018 15:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532039067; cv=none; d=google.com; s=arc-20160816; b=JVJCSvwQ/7bsUQTEE0fjxeOFntNPVdBitCgR8uN89oFxSjEQngLLPYdBDiqhJK1ifx 8XbDLo+h9IwixOckHnWtlvw4C3So4SxDl+5/oa7PLXeat1dV8KKUM/xTcZ9AbnDsxP1+ 8/vVdHi5V932DlH0DsKtfANhIskm+TfgY1rCpEQB0+AM3MrsunjZ8x0g29e88GbSSIfw t2pnQIfzKO16uaXitYE1bS6dM9euMWG13cX7r05FpPphEPFCOAV7SKwCBEpNGRMQk9B3 7HZgo4TV5CUN+h/l0zQG5V5Zyjxd4tBuBtE7NnX5pfSr3gM8/iDwrfdxKej7oyIJbcM9 5yQg== 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:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=KJBm8asvlc2uXaTwjIqfiViLW1NbbjuwGLV8m5QbzjM=; b=nTfTGJg8JGfjUFXbREfbkzpKwWOZyhjjBeYNwylLCfK28UysZxD8VGKidVkn/QXTkt mRJXXorIpFMLUZTrpUQfs3kDumWeYRNJ7MY3egAN+w5u6n8o1Xx2kwgBGOHnk56c2Irp DKDPghYxdLZoe7xQUT7FbT8ywCHNP8KiknJZPIYBSMWZk1x3sJkT2OV+YojAu2nLAY3t 0J+ru75nmTQna7fM1IwFUZoxqhHe1+f7f9xw9CNu+F48zbt1dVXyW1R4Ih8MqdOGBOJc IndG07/ZCnpHWyjyoPGaQ/KaxDjIYAINLPUjpAzpJ2KpfUl26sCVQ+vKLQLWzUSGmG0p LAeQ== 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 v84-v6si288314pfa.103.2018.07.19.15.24.12; Thu, 19 Jul 2018 15:24:27 -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 S1731075AbeGSXID (ORCPT + 99 others); Thu, 19 Jul 2018 19:08:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:34581 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730383AbeGSXID (ORCPT ); Thu, 19 Jul 2018 19:08:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6JMMUsk2437027 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jul 2018 15:22:30 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6JMMUka2437022; Thu, 19 Jul 2018 15:22:30 -0700 Date: Thu, 19 Jul 2018 15:22:30 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Thomas Gleixner Message-ID: Cc: tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org, pasha.tatashin@oracle.com, mingo@kernel.org, pbonzini@redhat.com Reply-To: tglx@linutronix.de, pbonzini@redhat.com, pasha.tatashin@oracle.com, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <20180719205545.16512-3-pasha.tatashin@oracle.com> References: <20180719205545.16512-3-pasha.tatashin@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/timers] x86/kvmclock: Remove page size requirement from wall_clock Git-Commit-ID: 7ef363a39514ed8a6f2333fbae1875ac0953715a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 7ef363a39514ed8a6f2333fbae1875ac0953715a Gitweb: https://git.kernel.org/tip/7ef363a39514ed8a6f2333fbae1875ac0953715a Author: Thomas Gleixner AuthorDate: Thu, 19 Jul 2018 16:55:21 -0400 Committer: Thomas Gleixner CommitDate: Fri, 20 Jul 2018 00:02:36 +0200 x86/kvmclock: Remove page size requirement from wall_clock There is no requirement for wall_clock data to be page aligned or page sized. Signed-off-by: Thomas Gleixner Signed-off-by: Pavel Tatashin Acked-by: Paolo Bonzini Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Link: https://lkml.kernel.org/r/20180719205545.16512-3-pasha.tatashin@oracle.com --- arch/x86/kernel/kvmclock.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 1f6ac5aaa904..a995d7d7164c 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -46,14 +46,12 @@ early_param("no-kvmclock", parse_no_kvmclock); /* Aligned to page sizes to match whats mapped via vsyscalls to userspace */ #define HV_CLOCK_SIZE (sizeof(struct pvclock_vsyscall_time_info) * NR_CPUS) -#define WALL_CLOCK_SIZE (sizeof(struct pvclock_wall_clock)) static u8 hv_clock_mem[PAGE_ALIGN(HV_CLOCK_SIZE)] __aligned(PAGE_SIZE); -static u8 wall_clock_mem[PAGE_ALIGN(WALL_CLOCK_SIZE)] __aligned(PAGE_SIZE); /* The hypervisor will put information about time periodically here */ static struct pvclock_vsyscall_time_info *hv_clock; -static struct pvclock_wall_clock *wall_clock; +static struct pvclock_wall_clock wall_clock; /* * The wallclock is the time of day when we booted. Since then, some time may @@ -66,15 +64,15 @@ static void kvm_get_wallclock(struct timespec64 *now) int low, high; int cpu; - low = (int)slow_virt_to_phys(wall_clock); - high = ((u64)slow_virt_to_phys(wall_clock) >> 32); + low = (int)slow_virt_to_phys(&wall_clock); + high = ((u64)slow_virt_to_phys(&wall_clock) >> 32); native_write_msr(msr_kvm_wall_clock, low, high); cpu = get_cpu(); vcpu_time = &hv_clock[cpu].pvti; - pvclock_read_wallclock(wall_clock, vcpu_time, now); + pvclock_read_wallclock(&wall_clock, vcpu_time, now); put_cpu(); } @@ -267,12 +265,10 @@ void __init kvmclock_init(void) } else if (!(kvmclock && kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE))) return; - wall_clock = (struct pvclock_wall_clock *)wall_clock_mem; hv_clock = (struct pvclock_vsyscall_time_info *)hv_clock_mem; if (kvm_register_clock("primary cpu clock")) { hv_clock = NULL; - wall_clock = NULL; return; }