Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-20 Thread Jan Beulich
On 20.07.2020 18:27, Jan Beulich wrote: > On 20.07.2020 17:28, Andrew Cooper wrote: >> On 16/07/2020 11:06, Jan Beulich wrote: >>> ACCESS_ONCE() guarantees single access, but doesn't guarantee that >>> the compiler wouldn't split this single access into multiple insns. >> >> ACCESS_ONCE() does guar

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-20 Thread Jan Beulich
On 20.07.2020 17:28, Andrew Cooper wrote: > On 16/07/2020 11:06, Jan Beulich wrote: >> ACCESS_ONCE() guarantees single access, but doesn't guarantee that >> the compiler wouldn't split this single access into multiple insns. > > ACCESS_ONCE() does guarantee single accesses for any natural integer

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-20 Thread Andrew Cooper
On 16/07/2020 11:06, Jan Beulich wrote: > ACCESS_ONCE() guarantees single access, but doesn't guarantee that > the compiler wouldn't split this single access into multiple insns. ACCESS_ONCE() does guarantee single accesses for any natural integer size. There is a section about this specifically

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-16 Thread Jan Beulich
On 16.07.2020 12:31, Roger Pau Monné wrote: > On Thu, Jul 16, 2020 at 12:06:14PM +0200, Jan Beulich wrote: >> On 15.07.2020 16:51, Roger Pau Monné wrote: >>> On Wed, Jul 15, 2020 at 03:51:17PM +0200, Jan Beulich wrote: On 15.07.2020 15:32, Roger Pau Monné wrote: > Feel free to change to AC

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-16 Thread Roger Pau Monné
On Thu, Jul 16, 2020 at 12:06:14PM +0200, Jan Beulich wrote: > On 15.07.2020 16:51, Roger Pau Monné wrote: > > On Wed, Jul 15, 2020 at 03:51:17PM +0200, Jan Beulich wrote: > >> On 15.07.2020 15:32, Roger Pau Monné wrote: > >>> Feel free to change to ACCESS_ONCE or barrier if you think it's > >>> cl

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-16 Thread Jan Beulich
On 15.07.2020 16:51, Roger Pau Monné wrote: > On Wed, Jul 15, 2020 at 03:51:17PM +0200, Jan Beulich wrote: >> On 15.07.2020 15:32, Roger Pau Monné wrote: >>> Feel free to change to ACCESS_ONCE or barrier if you think it's >>> clearer. >> >> I did so (also on the writer side), not the least based on

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Roger Pau Monné
On Wed, Jul 15, 2020 at 03:51:17PM +0200, Jan Beulich wrote: > On 15.07.2020 15:32, Roger Pau Monné wrote: > > On Wed, Jul 15, 2020 at 02:36:49PM +0200, Jan Beulich wrote: > >> On 15.07.2020 14:13, Roger Pau Monné wrote: > >>> On Wed, Jul 15, 2020 at 01:56:47PM +0200, Jan Beulich wrote: > @@ -

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Jan Beulich
On 15.07.2020 15:32, Roger Pau Monné wrote: > On Wed, Jul 15, 2020 at 02:36:49PM +0200, Jan Beulich wrote: >> On 15.07.2020 14:13, Roger Pau Monné wrote: >>> On Wed, Jul 15, 2020 at 01:56:47PM +0200, Jan Beulich wrote: @@ -1160,6 +1162,14 @@ void rtc_guest_write(unsigned int port, ca

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Roger Pau Monné
On Wed, Jul 15, 2020 at 02:36:49PM +0200, Jan Beulich wrote: > On 15.07.2020 14:13, Roger Pau Monné wrote: > > On Wed, Jul 15, 2020 at 01:56:47PM +0200, Jan Beulich wrote: > >> @@ -1160,6 +1162,14 @@ void rtc_guest_write(unsigned int port, > >> case RTC_PORT(1): > >> if ( !ioports_acc

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Jan Beulich
On 15.07.2020 14:13, Roger Pau Monné wrote: > On Wed, Jul 15, 2020 at 01:56:47PM +0200, Jan Beulich wrote: >> @@ -1160,6 +1162,14 @@ void rtc_guest_write(unsigned int port, >> case RTC_PORT(1): >> if ( !ioports_access_permitted(currd, RTC_PORT(0), RTC_PORT(1)) ) >> break;

RE: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Paul Durrant
> -Original Message- > From: Jan Beulich > Sent: 15 July 2020 12:57 > To: xen-devel@lists.xenproject.org > Cc: Andrew Cooper ; Paul Durrant ; > Wei Liu ; > Roger Pau Monné > Subject: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation > > This

Re: [PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Roger Pau Monné
On Wed, Jul 15, 2020 at 01:56:47PM +0200, Jan Beulich wrote: > This was lost when making the logic accessible to PVH Dom0. > > While doing so make the access to the global function pointer safe > against races (as noticed by Roger): The only current user wants to be > invoked just once (but can to

[PATCH v3 1/2] x86: restore pv_rtc_handler() invocation

2020-07-15 Thread Jan Beulich
This was lost when making the logic accessible to PVH Dom0. While doing so make the access to the global function pointer safe against races (as noticed by Roger): The only current user wants to be invoked just once (but can tolerate to be invoked multiple times), zapping the pointer at that point