Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2138299imm; Thu, 19 Jul 2018 13:58:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeqARgEFOT9HTbS2F7vrQtjNqwM3j4qXknJxoFdlaUgLeqkSdlsV2ieTvkMpQI42YZt8+Id X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr11417623plo.281.1532033938272; Thu, 19 Jul 2018 13:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532033938; cv=none; d=google.com; s=arc-20160816; b=zTBqPOegK5HyXOwyeOEjgSYbTdoDYuiVi5je2qFqBs62seTVEMaI306xaB/cg5sqTj NaVx95hhgf3sZ+9d8aAFqkH1qSQKMdAzUl3txs/ZQ8v6qIdepPUkilRUgOw7f4NXiCeV KwweZ3WEirMkT6YDFiu6P+9dhy0qcoLwXGBYlGOhWvMG98qpmv38AjNmfpvNdqNS1frE 4DPqYWUaHQdZDxt+mx8onOdbvlBNkdq85mP/e7dbr+eB6IU1Vh25hYCvqeEBqwEEkTGw noYhkFBs+wuZv+rFwQMK2Myu/CXb9p1a0oeI4p7avIsCJRfxZ/ZTr/ib0nUieKoSY2o4 jOmQ== 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=TdQZF7r/9oVT6kp1JYCs+50mmqZpU0o6ct7b8JU5Nto=; b=A1mFAexD+gZTGCnoruZHp6Mm8vryiTkun2BI3WetKmkJ+YIh2OGJk3ZJY1sTXAFlGe 0W/d3nYGtJADQFizItTIouWNwaL8btha9Ixv3SDDNRun3Y6Gb2XMlQ0nMtEtlmL0yWHZ gz+uQNE9YyBj39VKFGf2ax81ZTW0gbl431+Rb9WNfFNjTTXtzaYxjQiFyPXlDHHqZESZ DYs135q72UJ91H6XJQSebjchWbD50+TaOdITbLD/9pnpEwaIJJAQrJb228mChJR53NeO DA1ZMOh05XaecO00fq8fF/+/WiS0kVi+Chd1taW1pufum6KyCcGqVuLNAgiHU3vDsaC8 72/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=wHDKbq3B; 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 g7-v6si109966plt.149.2018.07.19.13.58.43; Thu, 19 Jul 2018 13:58:58 -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=wHDKbq3B; 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 S1730998AbeGSVmC (ORCPT + 99 others); Thu, 19 Jul 2018 17:42:02 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:50810 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730505AbeGSVmB (ORCPT ); Thu, 19 Jul 2018 17:42:01 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6JKs5u5156711; Thu, 19 Jul 2018 20:56:16 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=TdQZF7r/9oVT6kp1JYCs+50mmqZpU0o6ct7b8JU5Nto=; b=wHDKbq3BKE9ZjnYPSCpsYOt6f+yswzrJXyANrHNRkv2IbrpWs/CqYC81NMNvOBTs51at 1WPr/+z6ObjHVS7ASlZOljMNrdCfNEWZN5em4LGis6r6bMOF9kGOVrWv4YTQPqCbWHHN pttnc/RqQ72CXx1xfswT6SrJwLixD5g+FnpGCtxqeOKP8du7vI6WpVFVibkL7HsPz/+d f9Sgppepq6Q11ep0oZPDnWXejf0QSTbX2be8MzftCZwbC2ps83fm5BcJ1GibRgnCNiU/ YXUisDyZSUxqlHomr5d+oec7TCsuqupUqkN9MzBePnmwJFu91eHWctspe9dKvfo2gLdE Gg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2k9yjx8uty-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jul 2018 20:56:16 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6JKuFxT009666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Jul 2018 20:56:15 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6JKuENW026638; Thu, 19 Jul 2018 20:56:14 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 19 Jul 2018 20:56:14 +0000 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 v15 02/26] x86/kvmclock: Remove page size requirement from wall_clock Date: Thu, 19 Jul 2018 16:55:21 -0400 Message-Id: <20180719205545.16512-3-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180719205545.16512-1-pasha.tatashin@oracle.com> References: <20180719205545.16512-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8959 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-1807190218 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 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; } -- 2.18.0