Re: [PATCH 1/6] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

2024-06-26 Thread Jan Beulich
On 26.06.2024 15:04, Andrew Cooper wrote: > One final thing. > > This logic here depends on interrupts not being enabled between these > atomic actions, and entering non-root mode. > > Specifically, Xen must not service a pending delivery-notification > vector between this point and the VMEntry m

Re: [PATCH 1/6] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

2024-06-26 Thread Andrew Cooper
On 26/06/2024 1:54 pm, Andrew Cooper wrote: > On 26/06/2024 10:49 am, Jan Beulich wrote: >> On 25.06.2024 21:07, Andrew Cooper wrote: >>> There are two issues. First, pi_test_and_clear_on() pulls the cache-line to >>> the CPU and dirties it even if there's nothing outstanding, but the final >>> fo

Re: [PATCH 1/6] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

2024-06-26 Thread Andrew Cooper
On 26/06/2024 10:49 am, Jan Beulich wrote: > On 25.06.2024 21:07, Andrew Cooper wrote: >> There are two issues. First, pi_test_and_clear_on() pulls the cache-line to >> the CPU and dirties it even if there's nothing outstanding, but the final >> for_each_set_bit() is O(256) when O(8) would do, and

Re: [PATCH 1/6] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

2024-06-26 Thread Jan Beulich
On 25.06.2024 21:07, Andrew Cooper wrote: > There are two issues. First, pi_test_and_clear_on() pulls the cache-line to > the CPU and dirties it even if there's nothing outstanding, but the final > for_each_set_bit() is O(256) when O(8) would do, and would avoid multiple > atomic updates to the sa

[PATCH 1/6] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

2024-06-25 Thread Andrew Cooper
There are two issues. First, pi_test_and_clear_on() pulls the cache-line to the CPU and dirties it even if there's nothing outstanding, but the final for_each_set_bit() is O(256) when O(8) would do, and would avoid multiple atomic updates to the same IRR word. Rewrite it from scratch, explaining