All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: paul@xen.org
Cc: xen-devel@lists.xenproject.org,
	"'Roger Pau Monné'" <roger.pau@citrix.com>,
	"'Wei Liu'" <wl@xen.org>,
	"'Andrew Cooper'" <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 1/2] x86: restore pv_rtc_handler() invocation
Date: Wed, 15 Jul 2020 12:08:42 +0200	[thread overview]
Message-ID: <c0764a4e-b3f3-06e7-dbeb-1104f967525e@suse.com> (raw)
In-Reply-To: <001301d65a8e$e10e1260$a32a3720$@xen.org>

On 15.07.2020 12:01, Paul Durrant wrote:
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@suse.com>
>> Sent: 15 July 2020 10:47
>> To: xen-devel@lists.xenproject.org
>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>; Paul Durrant <paul@xen.org>; Wei Liu <wl@xen.org>;
>> Roger Pau Monné <roger.pau@citrix.com>
>> Subject: [PATCH v2 1/2] x86: restore pv_rtc_handler() invocation
>>
>> This was lost when making the logic accessible to PVH Dom0.
>>
>> Fixes: 835d8d69d96a ("x86/rtc: provide mediated access to RTC for PVH dom0")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -1160,6 +1160,10 @@ void rtc_guest_write(unsigned int port,
>>      case RTC_PORT(1):
>>          if ( !ioports_access_permitted(currd, RTC_PORT(0), RTC_PORT(1)) )
>>              break;
>> +
>> +        if ( pv_rtc_handler )
>> +            pv_rtc_handler(currd->arch.cmos_idx & 0x7f, data);
>> +
> 
> This appears to be semantically slightly different to the old code in that it is only done for a write to RC_PORT(1), whereas it would have been done on a write to either RTC_POR(0) or RTC_PORT(1) before. Is that of any concern?

The old code was (quoting plain 4.13.1)

        else if ( port == RTC_PORT(0) )
        {
            currd->arch.cmos_idx = data;
        }
        else if ( (port == RTC_PORT(1)) &&
                  ioports_access_permitted(currd, RTC_PORT(0), RTC_PORT(1)) )
        {
            unsigned long flags;

            if ( pv_rtc_handler )
                pv_rtc_handler(currd->arch.cmos_idx & 0x7f, data);
            spin_lock_irqsave(&rtc_lock, flags);
            outb(currd->arch.cmos_idx & 0x7f, RTC_PORT(0));
            outb(data, RTC_PORT(1));
            spin_unlock_irqrestore(&rtc_lock, flags);
        }

which I think similarly invoked the hook for RTC_PORT(1) only.

Jan


  reply	other threads:[~2020-07-15 10:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  9:44 [PATCH v2 0/2] x86: RTC handling adjustments Jan Beulich
2020-07-15  9:47 ` [PATCH v2 1/2] x86: restore pv_rtc_handler() invocation Jan Beulich
2020-07-15 10:01   ` Paul Durrant
2020-07-15 10:08     ` Jan Beulich [this message]
2020-07-15  9:47 ` [PATCH v2 2/2] x86: detect CMOS aliasing on ports other than 0x70/0x71 Jan Beulich
2020-07-16 14:31   ` Roger Pau Monné
2020-07-17 10:00     ` Jan Beulich

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=c0764a4e-b3f3-06e7-dbeb-1104f967525e@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.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.