Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3923062pxb; Mon, 4 Oct 2021 12:44:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzh2Kkbn8vkyprMumuSq43s7OZFIXq0OGMh7G3QNQPlHDNBhrIjKtFnquisvmbTwVGXNAiw X-Received: by 2002:a17:906:b303:: with SMTP id n3mr6457977ejz.267.1633376668590; Mon, 04 Oct 2021 12:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633376668; cv=none; d=google.com; s=arc-20160816; b=iDQNUykjpHqMGRF+5E6XaFB3FPhTJ0zP1PLvtTt2t5vETW4e6Swbds34XRkqJGU4Q8 Rai+xsCl9ARTSwNyxS6hFH74ezGdUMWUh0qHUrXPnPj6Md/Azm6krUWj8qDC7hwWHugV KArew2z6R6Ip/BhXyLB1vOzgWj5wQw5iInhyNnL/CkF++G+iru1vA2s3RCYNHOWVSbbU Zg8GNq7f0h+8WpLHaWEHSNLQMdpEBfeGwr3nlD3gOt90mVFabOxdvA9yHtVH9xFCI2kL 8L4mQKK04V3D2Z3DPfoXuumUCc1z8M5izMSw7LkdPtl5mFOudzqkXFpjcPRFznGt8LuX B22A== 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=a6QWMFeXHbdryFJhHNuh26kTWPMFvBYAKP6lRVVAU2E=; b=jn2CVMOjlgEJfR432HQm/pho/fcOz6Q2MAmT718Cct7iKtVt1k+ctjzICduAHxQQNS GenVLCKLyKV7cZ5HCSicYdGK1FKRg+fCUau7DbYuuGGoQTg8qikDkvfUOTlLqa/L5FY6 YtBSgoMeffk6n0I8E0D4LyKorHVSTblR+1PCLWk3JJXCfCpSX2WyfM+uS2rap3oaviUY 6Wq7dpOn+eaXQ2OJP0Ey7RUrlbKqqPfZHZcwiWoaeKOEBYduJdcuck9xQzU7NUeyK2wH L0Pibc5X8xP69ZM1qZF08nTAcw8VP9fYHxC1nq7tn9a1cs2AETQhG02oNWwCL9b8WKl2 LpJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bAvMt5yp; 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 c19si23654328ede.102.2021.10.04.12.44.03; Mon, 04 Oct 2021 12:44:28 -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=bAvMt5yp; 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 S235979AbhJDNP2 (ORCPT + 99 others); Mon, 4 Oct 2021 09:15:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:47310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236172AbhJDNNc (ORCPT ); Mon, 4 Oct 2021 09:13:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17BAD61B3E; Mon, 4 Oct 2021 13:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633352714; bh=cXgnBP+vUWeCWYi2Pza35xjs8y6lEZ4xs4PTc/6Z69s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bAvMt5yphjJSAG9KHzrnxa/X7Sd/hPKuGHUF8LR5ONO239zXkrTlF4NEICqogBOHo 2xxItbkdC57iF3ZnUN/htkhKV+M19zfCt9X4Uwo+RCFtXj6bbBMLTuYEZVI1STENGw ttnGveqFaNga2+hb2hXDRJ+DlmLiOduyKUk/xlwc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zelin Deng , Paolo Bonzini Subject: [PATCH 4.19 60/95] x86/kvmclock: Move this_cpu_pvti into kvmclock.h Date: Mon, 4 Oct 2021 14:52:30 +0200 Message-Id: <20211004125035.538640579@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125033.572932188@linuxfoundation.org> References: <20211004125033.572932188@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 @@ -64,18 +64,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