All of lore.kernel.org
 help / color / mirror / Atom feed
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: 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.2: OpenPGP_0xB0DE9DD628BF132F.asc --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Jürgen Groß via Virtualization" <virtualization@lists.linux-foundation.org>
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: Wei Liu <wei.liu@kernel.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"VMware, Inc." <pv-drivers@vmware.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Sean Christopherson <seanjc@google.com>,
	Joerg Roedel <joro@8bytes.org>,
	Russell King <linux@armlinux.org.uk>,
	Wanpeng Li <wanpengli@tencent.com>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Will Deacon <will@kernel.org>, Jim Mattson <jmattson@google.com>
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: 183 bytes --]

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

WARNING: multiple messages have this Message-ID (diff)
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

  reply	other threads:[~2021-03-09  6:15 UTC|newest]

Thread overview: 38+ 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 ` Juergen Gross
2021-03-08 12:28 ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 01/12] staticcall: move struct static_call_key definition to static_call_types.h Juergen Gross
2021-03-08 16:27   ` Peter Zijlstra
2021-03-08 12:28 ` [PATCH v5 02/12] x86/paravirt: switch time pvops functions to use static_call() Juergen Gross
2021-03-08 12:28   ` Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 17:00   ` Boris Ostrovsky
2021-03-08 17:00     ` Boris Ostrovsky
2021-03-08 17:00     ` Boris Ostrovsky
2021-03-09  6:14     ` Jürgen Groß [this message]
2021-03-09  6:14       ` Jürgen Groß
2021-03-09  6:14       ` Jürgen Groß via Virtualization
2021-03-08 12:28 ` [PATCH v5 03/12] x86/alternative: drop feature parameter from ALTINSTR_REPLACEMENT() Juergen Gross
2021-03-08 12:28 ` [PATCH v5 04/12] x86/alternative: support not-feature Juergen Gross
2021-03-08 12:28 ` [PATCH v5 05/12] x86/alternative: support ALTERNATIVE_TERNARY Juergen Gross
2021-03-08 12:28 ` [PATCH v5 06/12] x86: add new features for paravirt patching Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 07/12] x86/paravirt: remove no longer needed 32-bit pvops cruft Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 08/12] x86/paravirt: simplify paravirt macros Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 09/12] x86/paravirt: switch iret pvops to ALTERNATIVE Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 10/12] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 12:28 ` [PATCH v5 11/12] x86/paravirt: switch functions with custom code to ALTERNATIVE Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 18:30   ` Borislav Petkov
2021-03-08 18:30     ` Borislav Petkov
2021-03-09  6:21     ` Jürgen Groß
2021-03-09  6:21       ` Jürgen Groß via Virtualization
2021-03-08 12:28 ` [PATCH v5 12/12] x86/paravirt: have only one paravirt patch function Juergen Gross
2021-03-08 12:28   ` Juergen Gross via Virtualization
2021-03-08 16:31 ` [PATCH v5 00/12] x86: major paravirt cleanup Peter Zijlstra
2021-03-08 16:31   ` Peter Zijlstra
2021-03-08 16:31   ` 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.