mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early
       [not found] ` <1792170392.8631fc262581453bbf619ec5b2062170.1a145adfbff0008425@vates.tech>
@ 2026-10-16 17:33   ` Andrew Cooper
  2026-10-16 18:04     ` Andrew Cooper
  2026-10-19  9:20     ` Teddy Astie
  0 siblings, 2 replies; 9+ messages in thread
From: Andrew Cooper @ 2026-10-16 17:33 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Andrew Cooper, Juergen Gross, Boris Ostrovsky,
	Stefano Stabellini, Oleksandr Tyshchenko, David Woodhouse, x86,
	linux-kernel

On 16/10/2026 6:06 pm, Teddy Astie wrote:
> This is no longer required since [1].
>
> At this moment of boot, per_cpu areas are not initialized, which prevents
> using VCPUOP_register_runstate_phys_area as per_cpu_ptr_to_phys() would
> misbehave in this case.

This isn't really correct.

The per-cpu area for the BSP is within the main image, which is why the
logic functions today.  What's missing is the call to
pcpu_setup_first_chunk() which tells per_cpu_ptr_to_phys() about where
the BSP data is.

I think you want to say:

"A future change wants to use per_cpu_ptr_to_phys() in
xen_setup_runstate_info(), but this call is too early.  It turns out to
be no longer required since ..."

>
> [1] 8a22b9996b00 ("xen: drop xen_sched_clock in favour of using plain wallclock time")
> ---

Missing SoB.

~Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early
  2026-10-16 17:33   ` [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early Andrew Cooper
@ 2026-10-16 18:04     ` Andrew Cooper
  2026-10-19  9:06       ` Teddy Astie
  2026-10-19  9:20     ` Teddy Astie
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Cooper @ 2026-10-16 18:04 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Andrew Cooper, Juergen Gross, Boris Ostrovsky,
	Stefano Stabellini, Oleksandr Tyshchenko, David Woodhouse, x86,
	linux-kernel

On 16/10/2026 6:33 pm, Andrew Cooper wrote:
> On 16/10/2026 6:06 pm, Teddy Astie wrote:
>> This is no longer required since [1].
>>
>> At this moment of boot, per_cpu areas are not initialized, which prevents
>> using VCPUOP_register_runstate_phys_area as per_cpu_ptr_to_phys() would
>> misbehave in this case.
> This isn't really correct.
>
> The per-cpu area for the BSP is within the main image, which is why the
> logic functions today.  What's missing is the call to
> pcpu_setup_first_chunk() which tells per_cpu_ptr_to_phys() about where
> the BSP data is.
>
> I think you want to say:
>
> "A future change wants to use per_cpu_ptr_to_phys() in
> xen_setup_runstate_info(), but this call is too early.  It turns out to
> be no longer required since ..."
>
>> [1] 8a22b9996b00 ("xen: drop xen_sched_clock in favour of using plain wallclock time")
>> ---
> Missing SoB.
>
> ~Andrew

But this does pose another question...   Linux only ever registers time
referencing vCPU 0.  Why are the targets of the registration in the
per-cpu area?  That's presumably wasted space on all APs.

~Andrew

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early
  2026-10-16 18:04     ` Andrew Cooper
@ 2026-10-19  9:06       ` Teddy Astie
  0 siblings, 0 replies; 9+ messages in thread
From: Teddy Astie @ 2026-10-19  9:06 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel
  Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini,
	Oleksandr Tyshchenko, David Woodhouse, x86, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1437 bytes --]

Le 16/10/2026 à 20:04, Andrew Cooper a écrit :
> On 16/10/2026 6:33 pm, Andrew Cooper wrote:
>> On 16/10/2026 6:06 pm, Teddy Astie wrote:
>>> This is no longer required since [1].
>>>
>>> At this moment of boot, per_cpu areas are not initialized, which prevents
>>> using VCPUOP_register_runstate_phys_area as per_cpu_ptr_to_phys() would
>>> misbehave in this case.
>> This isn't really correct.
>>
>> The per-cpu area for the BSP is within the main image, which is why the
>> logic functions today.  What's missing is the call to
>> pcpu_setup_first_chunk() which tells per_cpu_ptr_to_phys() about where
>> the BSP data is.
>>
>> I think you want to say:
>>
>> "A future change wants to use per_cpu_ptr_to_phys() in
>> xen_setup_runstate_info(), but this call is too early.  It turns out to
>> be no longer required since ..."
>>
>>> [1] 8a22b9996b00 ("xen: drop xen_sched_clock in favour of using plain wallclock time")
>>> ---
>> Missing SoB.
>>
>> ~Andrew
> 
> But this does pose another question...   Linux only ever registers time
> referencing vCPU 0.  Why are the targets of the registration in the
> per-cpu area?  That's presumably wasted space on all APs.
> 

Yes but only for this early PV case, there are other places where 
xen_setup_runstate_info() is called for other APs.

But looking at it, there may be redundant calls of 
xen_setup_runstate_info().

> ~Andrew

Teddy

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early
  2026-10-16 17:33   ` [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early Andrew Cooper
  2026-10-16 18:04     ` Andrew Cooper
@ 2026-10-19  9:20     ` Teddy Astie
  1 sibling, 0 replies; 9+ messages in thread
From: Teddy Astie @ 2026-10-19  9:20 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel
  Cc: Juergen Gross, Boris Ostrovsky, Stefano Stabellini,
	Oleksandr Tyshchenko, David Woodhouse, x86, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]

Le 16/10/2026 à 19:34, Andrew Cooper a écrit :
> On 16/10/2026 6:06 pm, Teddy Astie wrote:
>> This is no longer required since [1].
>>
>> At this moment of boot, per_cpu areas are not initialized, which prevents
>> using VCPUOP_register_runstate_phys_area as per_cpu_ptr_to_phys() would
>> misbehave in this case.
> 
> This isn't really correct.
> 
> The per-cpu area for the BSP is within the main image, which is why the
> logic functions today.  What's missing is the call to
> pcpu_setup_first_chunk() which tells per_cpu_ptr_to_phys() about where
> the BSP data is.
> 
> I think you want to say:
> 
> "A future change wants to use per_cpu_ptr_to_phys() in
> xen_setup_runstate_info(), but this call is too early.  It turns out to
> be no longer required since ..."
> 

Right, I was thinking that the use of the per_cpu was incorrect at this 
point. But that's not exactly the issue here.

Will adjust for the v3.

>>
>> [1] 8a22b9996b00 ("xen: drop xen_sched_clock in favour of using plain wallclock time")
>> ---
> 
> Missing SoB.
> 
> ~Andrew

Teddy

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 2/8] xen: Refactor xen/features{.c,.h}
       [not found]   ` <1792170394.8631fc262581453bbf619ec5b2062170.1a145ae01ed0008425@vates.tech>
@ 2026-11-11  6:36     ` Juergen Gross
  0 siblings, 0 replies; 9+ messages in thread
From: Juergen Gross @ 2026-11-11  6:36 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Andrew Cooper, Boris Ostrovsky, Stefano Stabellini,
	Oleksandr Tyshchenko, x86, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]

On 16.10.26 19:06, Teddy Astie wrote:
> Improve various aspects of xen/features{.c,.h}
>   * Use a bitmap instead of a array of u8 (effectively bool).
>   * Mark xen_setup_features as __init, as it's only called in __init
>     paths.
>   * Return bool instead of int in xen_feature()
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 3/8] xen: Add gpa conversion helpers
       [not found]   ` <1792170395.8631fc262581453bbf619ec5b2062170.1a145ae07870008425@vates.tech>
@ 2026-11-11  6:48     ` Juergen Gross
  0 siblings, 0 replies; 9+ messages in thread
From: Juergen Gross @ 2026-11-11  6:48 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Boris Ostrovsky, Stefano Stabellini, Oleksandr Tyshchenko, x86,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 878 bytes --]

On 16.10.26 19:06, Teddy Astie wrote:
> Introduce various helpers to convert between GPA and virt/paddr.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Reviewed-by: Juergen Gross <jgross@suse.com>

If you are up to it, there is some potential for cleaning up the Xen related
page.h include files.

You are adding the same definitions to the x86 and arm specific page.h files,
which are located at different positions regarding the arch trees.

I think this should be cleaned up by moving the common parts into
include/xen/page.h. The arch specific include files should both be under
include/xen/<arch>/page.h, I think (using arch/<arch>/include/asm/xen/page.h
won't work, as the arm file is used by arm and arm64).

In case you don't want to do that, I'm fine to do that later, e.g. when the
riscv Xen port is arriving in the kernel.


Juergen

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/8] x86/xen/time: Correct xen_save_time_memory_area() failure message
       [not found]   ` <1792170396.8631fc262581453bbf619ec5b2062170.1a145ae0a4a0008425@vates.tech>
@ 2026-11-11  6:49     ` Juergen Gross
  0 siblings, 0 replies; 9+ messages in thread
From: Juergen Gross @ 2026-11-11  6:49 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Andrew Cooper, Boris Ostrovsky, Stefano Stabellini,
	Oleksandr Tyshchenko, x86, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 324 bytes --]

On 16.10.26 19:06, Teddy Astie wrote:
> We actually didn't fail to "save secondary vcpu time info" but
> just to unregister the mapping of it.
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 5/8] x86/xen/time: Clear xen_clock mapping later
       [not found]   ` <1792170396.8631fc262581453bbf619ec5b2062170.1a145ae0c950008425@vates.tech>
@ 2026-11-11  6:59     ` Juergen Gross
  0 siblings, 0 replies; 9+ messages in thread
From: Juergen Gross @ 2026-11-11  6:59 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Boris Ostrovsky, Stefano Stabellini, Oleksandr Tyshchenko,
	David Woodhouse, x86, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 667 bytes --]

On 16.10.26 19:06, Teddy Astie wrote:
> The current logic has a corner case when both xen_save_time_memory_area()
> and xen_restore_time_memory_area() fails. In this case, the mapping is never
> cleared and kept with previous pvclock values (invalidating the comment
> regarding VDSO_CLOCKMODE_PVCLOCK as the data may not have been zeroed).
> 
> Also convert the clear_page with a memset, there's no need to clear the
> entire page when we only care about 64 bytes of it.
> 
> Fixes: 2229f70b5bbb ("x86/xen/time: setup vcpu 0 time info page")
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 6/8] x86/xen/time: Mark xen_setup_vsyscall_time_info() __init
       [not found]   ` <1792170397.8631fc262581453bbf619ec5b2062170.1a145ae0f160008425@vates.tech>
@ 2026-11-11  7:00     ` Juergen Gross
  0 siblings, 0 replies; 9+ messages in thread
From: Juergen Gross @ 2026-11-11  7:00 UTC (permalink / raw)
  To: Teddy Astie, xen-devel
  Cc: Boris Ostrovsky, Stefano Stabellini, Oleksandr Tyshchenko, x86,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 229 bytes --]

On 16.10.26 19:06, Teddy Astie wrote:
> This function is only called by xen_time_init() being itself __init.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-11  7:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1792170295.8631fc262581453bbf619ec5b2062170.1a145ac82530008425@vates.tech>
     [not found] ` <1792170392.8631fc262581453bbf619ec5b2062170.1a145adfbff0008425@vates.tech>
2026-10-16 17:33   ` [PATCH v2 1/8] x86/xen/pv: Don't setup runstate area too early Andrew Cooper
2026-10-16 18:04     ` Andrew Cooper
2026-10-19  9:06       ` Teddy Astie
2026-10-19  9:20     ` Teddy Astie
     [not found] ` <20261016170613.173406-2-teddy.astie@vates.tech>
     [not found]   ` <1792170394.8631fc262581453bbf619ec5b2062170.1a145ae01ed0008425@vates.tech>
2026-11-11  6:36     ` [PATCH v2 2/8] xen: Refactor xen/features{.c,.h} Juergen Gross
     [not found]   ` <1792170395.8631fc262581453bbf619ec5b2062170.1a145ae07870008425@vates.tech>
2026-11-11  6:48     ` [PATCH v2 3/8] xen: Add gpa conversion helpers Juergen Gross
     [not found]   ` <1792170396.8631fc262581453bbf619ec5b2062170.1a145ae0a4a0008425@vates.tech>
2026-11-11  6:49     ` [PATCH v2 4/8] x86/xen/time: Correct xen_save_time_memory_area() failure message Juergen Gross
     [not found]   ` <1792170396.8631fc262581453bbf619ec5b2062170.1a145ae0c950008425@vates.tech>
2026-11-11  6:59     ` [PATCH v2 5/8] x86/xen/time: Clear xen_clock mapping later Juergen Gross
     [not found]   ` <1792170397.8631fc262581453bbf619ec5b2062170.1a145ae0f160008425@vates.tech>
2026-11-11  7:00     ` [PATCH v2 6/8] x86/xen/time: Mark xen_setup_vsyscall_time_info() __init Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®