Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp7809imm; Tue, 17 Jul 2018 19:24:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpedCXYuPcWnGZu3Bgmwc4wFCw+/Ctn+pRy+F4s5h6bWreHLv/rT8na/H+r5WMLuUQH9tDfW X-Received: by 2002:a17:902:b58f:: with SMTP id a15-v6mr4023701pls.76.1531880660377; Tue, 17 Jul 2018 19:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531880660; cv=none; d=google.com; s=arc-20160816; b=kGEg/JQLxx4G2WDSWOWgTLMl04IgMB+vkQvrYSYLYx8Y0Qe9hmTp74gkQBIETLHee8 jIorkVL8rCfbalGuuqUeMM2C189NYeadG4s6vbVN+SOaXvnL5lZnvX3PpHr6kdnryT+R EG8SkuSIhTEMdnsi22DhkWTCeQg3IIqkKHcule+uF7AuintXhkEuF+Ilabmp7p1Ak3ek ZuyI1YGarJAJX8L4bT7/8o0he8bZdBelX9+ATjhV8FpIBXvhCoXs4bIKXIqDQKuGNZJl Flo1xJ45fJNGIXNIkXeF4v+dKsTxyyVx4Drz2HroeXSxTO2gy7C7qPkKwB9B22RgaWbg necw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=2/2mUIP1useLQ8rBekcLf5mLbx3AV7Bin4FelnnmozY=; b=kF48xMT+EPbPqwZud8AIlhrLwScbj6uQFTH9r7G8WaZiVJDlAm9wEbf9UGEl82v+ko 6SNeeFQnw7K/dPjNwRzzGHxiukZt1K7MsRCocz1msG97pgM1+h9W0VXk0Kdi2zPH+WW6 9V4p9UXDCi0lMDHGsmnzwQu0oKiZ9fRsbj+m+2f6mb0rAJVJ/TPuA9kfLot7cFQmQNoA GF6awp3Bbs0cjhPp7HwNqaizXN8LRcDzZAszdiB99wtunFCaCHPu7XaY1uB0MZteBhMe MzoLxUECvf1aMZua4ZTp1Wlx91pYHQHHMVlyv3zERVV1phZDpIYp5Llq+M1WynPh0nlH o8mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=LqG0AL4S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si2273148plb.2.2018.07.17.19.24.04; Tue, 17 Jul 2018 19:24:20 -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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=LqG0AL4S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731624AbeGRC6r (ORCPT + 99 others); Tue, 17 Jul 2018 22:58:47 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:44418 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731225AbeGRC6q (ORCPT ); Tue, 17 Jul 2018 22:58:46 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6I2JWFw196557; Wed, 18 Jul 2018 02:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=2/2mUIP1useLQ8rBekcLf5mLbx3AV7Bin4FelnnmozY=; b=LqG0AL4Sn0zVHCPcal5joYCXBtidq7LHextpEYnhuUrW1xhqYLn0HWS/l5pdSpCO5kzy +CMGUuqCa7hMuRBD/IbQ2vMlbuBqJs/q91MUEqXNTjAqJM2OGGrz6EdljjuzPP0d0ERv iUrQOekfvLsnO2olNw0a2neeUmzXXNYpraPsTEPQwxrwvfxg10MdOGv91W8H6sZEo4rs SsG8xCi4TIxRZ1yOpVpUlDYWmpIs3MjZWMKeDm9gz4STBseo3YuBAYmEAhekvsLN8Hu2 riTXJHIky79aohvUeCMzmG77WvjlAVkjuB8ooraxpjZp5uD/u4W8yI6bgIQYKl0kz5vc tg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2k7a3t34cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:22:25 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w6I2MPbt023118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:22:25 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6I2MOP0020545; Wed, 18 Jul 2018 02:22:24 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jul 2018 19:22:23 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, pasha.tatashin@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: [PATCH v14 02/25] x86/kvmclock: Remove page size requirement from wall_clock Date: Tue, 17 Jul 2018 22:21:48 -0400 Message-Id: <20180718022211.6259-3-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718022211.6259-1-pasha.tatashin@oracle.com> References: <20180718022211.6259-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8957 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807180026 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner 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 --- 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 890e9e58e4bf..e9863639312c 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(); } @@ -266,12 +264,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; } -- 2.18.0