All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH v3 2/4] x86/APIC: calibrate against platform timer when possible
Date: Tue, 15 Mar 2022 15:57:44 +0100	[thread overview]
Message-ID: <YjCpaGhm7OjXFraY@Air-de-Roger> (raw)
In-Reply-To: <cd5c9fe4-6065-9c22-1a39-c9a5a77ea01d@suse.com>

On Tue, Mar 15, 2022 at 11:39:29AM +0100, Jan Beulich wrote:
> On 15.03.2022 10:12, Roger Pau Monné wrote:
> > On Mon, Mar 14, 2022 at 05:19:37PM +0100, Jan Beulich wrote:
> >> One thing seems quite clear though: Doing any of this with interrupts
> >> enabled increases the chances for the read pairs to not properly
> >> correlate, due to an interrupt happening in the middle. This alone is
> >> a reason for me to want to keep IRQs off here.
> > 
> > Right, TSC calibration is also done with interrupts disabled, so it
> > does seem correct to do the same here for APIC.
> > 
> > Maybe it would be cleaner to hide the specific PIT logic in
> > calibrate_apic_timer() so that we could remove get_8254_timer_count()
> > and wait_8254_wraparound() from apic.c and apic.c doesn't have any PIT
> > specific code anymore?
> 
> Yes, that's certainly a further cleanup step to take (saying this
> without actually having tried, so there may be obstacles).

OK, I think you are planning to post a new version of this to avoid
open-coding apic_read() in read_tmcct()?

TBH the PIT calibration done in calibrate_APIC_clock seems fairly
bogus, as it's possible the counter wraps around more than once
between calls when running virtualized. Maybe reprogramming channel 2
would be better, as then at least wrap around would be detected
(albeit it's unclear how much delta we would have between the counter
reaching 0 and Xen realizing).

Thanks, Roger.


  reply	other threads:[~2022-03-15 14:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  9:22 [PATCH v3 0/4] x86: further improve timer freq calibration accuracy Jan Beulich
2022-02-14  9:24 ` [PATCH v3 1/4] x86/time: further improve TSC / CPU " Jan Beulich
2022-03-11 12:03   ` Roger Pau Monné
2022-03-11 12:30     ` Jan Beulich
2022-02-14  9:25 ` [PATCH v3 2/4] x86/APIC: calibrate against platform timer when possible Jan Beulich
2022-03-11 13:45   ` Roger Pau Monné
2022-03-14 16:19     ` Jan Beulich
2022-03-15  9:12       ` Roger Pau Monné
2022-03-15 10:39         ` Jan Beulich
2022-03-15 14:57           ` Roger Pau Monné [this message]
2022-02-14  9:25 ` [PATCH v3 3/4] x86/APIC: skip unnecessary parts of __setup_APIC_LVTT() Jan Beulich
2022-03-11 14:05   ` Roger Pau Monné
2022-03-14  8:25     ` Jan Beulich
2022-03-14  8:58       ` Roger Pau Monné
2022-02-14  9:25 ` [PATCH v3 4/4] x86/APIC: make connections between seemingly arbitrary numbers Jan Beulich
2022-03-11 14:24   ` Roger Pau Monné
2022-03-14  8:19     ` Jan Beulich
2022-03-14  8:56       ` Roger Pau Monné

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=YjCpaGhm7OjXFraY@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.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.