Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3953354pxb; Mon, 4 Oct 2021 13:32:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzobEJfgRG72CgVhCS+G/DKo9DvP8CaZFi7bd4yEddJcrCE37Co1MHBl8xeuU+L9MFbyAut X-Received: by 2002:a17:90a:307:: with SMTP id 7mr32401280pje.176.1633379571055; Mon, 04 Oct 2021 13:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633379571; cv=none; d=google.com; s=arc-20160816; b=jr8JIqVVIn24Ia5+j2oFESckhRORVqpKXBobUkxI6eE9KBaIHiWBs9nTMwyK2TBLtm keqO3claucZIYGbUTlabycsvgNFbroypJ61v0DAYiLZYI++o8e+/CxCn51xSk2hLed+2 y1HOqBNlzlVyASXbYVDi9haBwXQb8XaTMLKk3d6T3JGYEJGR9myg8LIKAejwSr09gmR0 gbpeQ07GdfejLya2bec8AHrt/k+11jbmJkLfpvfyn9JxBmwd1hPRf0EkagBAkXJ5egKE RCWcFghK5Wdy/5OhoE7j/SiLX42OrVpBZvXWD0nyPIALCnrF48uXNnSPrslhUv+rby0B vmhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HaFoYQ5ryJbst4rPCQ+bzewJrpqUI2KWW+SOCkI1G3w=; b=aU5OuDcF2qu2qhdMhGwE8A33ZauSpq6UOoAQw2poS1YH+2RuAf4z3p2yofDjcG3vWe mKuumhsAdjpLL0Z7r6PkyECbHfO6eRtJX8Mw7iY4K+egxasYLdg/OiblCVDxq+hsR1Yw exdlenkEXOTxTKg0E5bj7Fo+Vgh8jNl/b/n0R8D7bJKlmmFo3rhIsa/A75xCV3UmuV05 PA4F+XzrYh7ZpRX2u2PQ805SiEkjH/ryDEmefiXunid5RVhr/1LplhRqlPuUyzStOH8m 4EkbnGiwIOn6sg9K/D4Jc/7869ocQ5XsGy07LSMo9EMpHaxWRiaMzdcw5ZRZXo91vjkQ h8sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ig7hShOK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si18267103pjg.71.2021.10.04.13.32.38; Mon, 04 Oct 2021 13:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ig7hShOK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237610AbhJDNcj (ORCPT + 99 others); Mon, 4 Oct 2021 09:32:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:43788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237788AbhJDNaf (ORCPT ); Mon, 4 Oct 2021 09:30:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CEC576320F; Mon, 4 Oct 2021 13:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353236; bh=if5UTbY3SkLutXxHO4a+zixpDnUYo3FZvKQYgN+ta9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ig7hShOKyPe+NbnsDAUeLbQLkzhagfhRfpG+FWpqytDqrQng34ubD+iYekr990TGJ 6OXnY8RH+Rc3W/zJYVrxBDIYESFHd5CtHYnw+D9pI2WvOCWRLeSpMSuoBEpD55fNts tVszByO8pqCngBBFIAqLVgt0sLaUFoI54rXpNfxY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zelin Deng , Paolo Bonzini Subject: [PATCH 5.14 048/172] x86/kvmclock: Move this_cpu_pvti into kvmclock.h Date: Mon, 4 Oct 2021 14:51:38 +0200 Message-Id: <20211004125046.540227130@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zelin Deng commit ad9af930680bb396c87582edc172b3a7cf2a3fbf upstream. There're other modules might use hv_clock_per_cpu variable like ptp_kvm, so move it into kvmclock.h and export the symbol to make it visiable to other modules. Signed-off-by: Zelin Deng Cc: Message-Id: <1632892429-101194-2-git-send-email-zelin.deng@linux.alibaba.com> Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/kvmclock.h | 14 ++++++++++++++ arch/x86/kernel/kvmclock.c | 13 ++----------- 2 files changed, 16 insertions(+), 11 deletions(-) --- a/arch/x86/include/asm/kvmclock.h +++ b/arch/x86/include/asm/kvmclock.h @@ -2,6 +2,20 @@ #ifndef _ASM_X86_KVM_CLOCK_H #define _ASM_X86_KVM_CLOCK_H +#include + extern struct clocksource kvm_clock; +DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); + +static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void) +{ + return &this_cpu_read(hv_clock_per_cpu)->pvti; +} + +static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void) +{ + return this_cpu_read(hv_clock_per_cpu); +} + #endif /* _ASM_X86_KVM_CLOCK_H */ --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -49,18 +49,9 @@ early_param("no-kvmclock-vsyscall", pars static struct pvclock_vsyscall_time_info hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __bss_decrypted __aligned(PAGE_SIZE); static struct pvclock_wall_clock wall_clock __bss_decrypted; -static DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); static struct pvclock_vsyscall_time_info *hvclock_mem; - -static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void) -{ - return &this_cpu_read(hv_clock_per_cpu)->pvti; -} - -static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void) -{ - return this_cpu_read(hv_clock_per_cpu); -} +DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); +EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu); /* * The wallclock is the time of day when we booted. Since then, some time may