Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1964732imm; Fri, 6 Jul 2018 09:27:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcqwY9hGhJw0Hb7IztsehUOUvxtCMVjAkt26E4rjRzmr0JvMDfNucIyQLnW80RIb5FMz78Q X-Received: by 2002:a17:902:3124:: with SMTP id w33-v6mr10855845plb.235.1530894435975; Fri, 06 Jul 2018 09:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530894435; cv=none; d=google.com; s=arc-20160816; b=t/8Dd00+qxmP9+hmMGDh84CkWqwXMZhf2Mg2Zj3lyk4vdB9xImaVLwcYrePE+jNLq1 t/HXVv9EEhtVUTec733F1PzKoTlAtwNAJEN9run9Vcd0OgBi2OHULSBxhnXlf8PvIOoP MJ2L8aThhTdIB4O49TxjQGoWmLaXmfpfvFhDh4iqqO4cQ6Z5HzwktXz7+Us8rcZtIBaC qvz4vfGvZ4v7E7XlB/4JIZlOdIMoqdKpRRYFCvQv1DSCJl94AZ6hDIApOXt7i1JFLM23 whAC6a7mb8dvztaP1lvr7BkWe+Levq68SluOuYgE6EpoofbhiH4Kk+L765htglr1xeji xxHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :references:subject:cc:to:from:date:user-agent:message-id :arc-authentication-results; bh=jKBiNGzRfcgzAtsM6Nvk7zUXYprnh8kSDtwCHBcjAgM=; b=K/k8AAmn8/QRm6HwFiQUVYmGKWsIRj8Yg4U8ZEP2RsXfzwFgoLL9ws/cxw9pgwM9Ht 3n5aMQcb6eqFdOpLkCJyy6mttgqfLMWvbcM8uU117I+yitZRHvunu3tkPgPEEM6bsgq7 oYRIFdVrUhHvSOxU4knoeEnvJN/NvUqcIP+RW9sPOtwtcZodr+BZ4a0WfNscqKH/kwQ1 ftDicJYA8emBIZbrcAK2etZ8MsZ+cQPD6NhA/RdFJNpAtcOvJT5KUxSt4TZRXrSmtfTt y6l2vGMilWmnZQ7TMJbyBQZVfJM+NCNZ2xUQsAi1pKcqxOmaeh5kgHBqx3U/ejdBN5pb 9mhQ== 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 f8-v6si8757962plb.381.2018.07.06.09.27.01; Fri, 06 Jul 2018 09:27:15 -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 S933637AbeGFQYt (ORCPT + 99 others); Fri, 6 Jul 2018 12:24:49 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:55145 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933743AbeGFQXb (ORCPT ); Fri, 6 Jul 2018 12:23:31 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fbTVq-000067-Ol; Fri, 06 Jul 2018 18:23:15 +0200 Message-ID: <20180706162049.387233770@linutronix.de> User-Agent: quilt/0.65 Date: Fri, 06 Jul 2018 18:13:09 +0200 From: Thomas Gleixner To: LKML Cc: Paolo Bonzini , Radim Krcmar , Peter Zijlstra , Juergen Gross , Pavel Tatashin , steven.sistare@oracle.com, daniel.m.jordan@oracle.com, x86@kernel.org, kvm@vger.kernel.org Subject: [patch 2/7] x86/kvmclock: Remove page size requirement from wall_clock References: <20180706161307.733337643@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no requirement for wall_clock data to be page aligned or page sized. Signed-off-by: Thomas Gleixner Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Peter Zijlstra Cc: Juergen Gross Cc: Pavel Tatashin Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: x86@kernel.org Cc: kvm@vger.kernel.org --- arch/x86/kernel/kvmclock.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -46,14 +46,12 @@ early_param("no-kvmclock", parse_no_kvmc /* 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 tim 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; }