From: "Jürgen Groß" <jgross@suse.com>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
xen-devel@lists.xenproject.org, x86@kernel.org,
virtualization@lists.linux-foundation.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
kvm@vger.kernel.org
Cc: Deep Shah <sdeep@vmware.com>,
"VMware, Inc." <pv-drivers@vmware.com>,
Russell King <linux@armlinux.org.uk>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v5 02/12] x86/paravirt: switch time pvops functions to use static_call()
Date: Tue, 9 Mar 2021 07:14:37 +0100 [thread overview]
Message-ID: <5cea7551-ce84-c084-ddaf-e84075823bd8@suse.com> (raw)
In-Reply-To: <1346dbb1-c43e-9ac2-10e4-3c10cb2ead78@oracle.com>
[-- Attachment #1.1.1.1: Type: text/plain, Size: 2303 bytes --]
On 08.03.21 18:00, Boris Ostrovsky wrote:
>
> On 3/8/21 7:28 AM, Juergen Gross wrote:
>> --- a/arch/x86/xen/time.c
>> +++ b/arch/x86/xen/time.c
>> @@ -379,11 +379,6 @@ void xen_timer_resume(void)
>> }
>> }
>>
>> -static const struct pv_time_ops xen_time_ops __initconst = {
>> - .sched_clock = xen_sched_clock,
>> - .steal_clock = xen_steal_clock,
>> -};
>> -
>> static struct pvclock_vsyscall_time_info *xen_clock __read_mostly;
>> static u64 xen_clock_value_saved;
>>
>> @@ -528,7 +523,8 @@ static void __init xen_time_init(void)
>> void __init xen_init_time_ops(void)
>> {
>> xen_sched_clock_offset = xen_clocksource_read();
>> - pv_ops.time = xen_time_ops;
>> + static_call_update(pv_steal_clock, xen_steal_clock);
>> + paravirt_set_sched_clock(xen_sched_clock);
>>
>> x86_init.timers.timer_init = xen_time_init;
>> x86_init.timers.setup_percpu_clockev = x86_init_noop;
>> @@ -570,7 +566,8 @@ void __init xen_hvm_init_time_ops(void)
>> }
>>
>> xen_sched_clock_offset = xen_clocksource_read();
>> - pv_ops.time = xen_time_ops;
>> + static_call_update(pv_steal_clock, xen_steal_clock);
>> + paravirt_set_sched_clock(xen_sched_clock);
>> x86_init.timers.setup_percpu_clockev = xen_time_init;
>> x86_cpuinit.setup_percpu_clockev = xen_hvm_setup_cpu_clockevents;
>
>
> There is a bunch of stuff that's common between the two cases so it can be factored out.
Yes.
>
>
>>
>> diff --git a/drivers/xen/time.c b/drivers/xen/time.c
>> index 108edbcbc040..152dd33bb223 100644
>> --- a/drivers/xen/time.c
>> +++ b/drivers/xen/time.c
>> @@ -7,6 +7,7 @@
>> #include <linux/math64.h>
>> #include <linux/gfp.h>
>> #include <linux/slab.h>
>> +#include <linux/static_call.h>
>>
>> #include <asm/paravirt.h>
>> #include <asm/xen/hypervisor.h>
>> @@ -175,7 +176,7 @@ void __init xen_time_setup_guest(void)
>> xen_runstate_remote = !HYPERVISOR_vm_assist(VMASST_CMD_enable,
>> VMASST_TYPE_runstate_update_flag);
>>
>> - pv_ops.time.steal_clock = xen_steal_clock;
>> + static_call_update(pv_steal_clock, xen_steal_clock);
>>
>
>
> Do we actually need this? We've already set this up in xen_init_time_ops(). (But maybe for ARM).
Correct. Arm needs this.
Juergen
[-- Attachment #1.1.1.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-03-09 6:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 12:28 [PATCH v5 00/12] x86: major paravirt cleanup Juergen Gross
2021-03-08 12:28 ` [PATCH v5 02/12] x86/paravirt: switch time pvops functions to use static_call() Juergen Gross
2021-03-08 17:00 ` Boris Ostrovsky
2021-03-09 6:14 ` Jürgen Groß [this message]
2021-03-08 16:31 ` [PATCH v5 00/12] x86: major paravirt cleanup Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5cea7551-ce84-c084-ddaf-e84075823bd8@suse.com \
--to=jgross@suse.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=kys@microsoft.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=pv-drivers@vmware.com \
--cc=sdeep@vmware.com \
--cc=seanjc@google.com \
--cc=sstabellini@kernel.org \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=wei.liu@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).