All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Wei Liu <wei.liu2@citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	Jan Beulich <JBeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: Interrupt injection with ISR set on Intel hardware
Date: Thu, 13 Dec 2018 09:52:11 +0100	[thread overview]
Message-ID: <20181213085211.goirbusx2lesguuh@mac> (raw)
In-Reply-To: <AADFC41AFE54684AB9EE6CBC0274A5D19BE9E954@SHSMSX101.ccr.corp.intel.com>

On Thu, Dec 13, 2018 at 01:28:23AM +0000, Tian, Kevin wrote:
> > From: Roger Pau Monné [mailto:roger.pau@citrix.com]
> > Sent: Wednesday, December 12, 2018 8:18 PM
> > 
> > On Wed, Dec 12, 2018 at 11:48:52AM +0000, Tian, Kevin wrote:
> > > > From: Roger Pau Monné [mailto:roger.pau@citrix.com]
> > > > Sent: Wednesday, December 12, 2018 7:25 PM
> > > >
> > > > On Wed, Dec 12, 2018 at 10:36:44AM +0000, Tian, Kevin wrote:
> > > > > > From: Roger Pau Monné [mailto:roger.pau@citrix.com]
> > > > > > Sent: Monday, October 15, 2018 6:30 PM
> > > > > > (XEN)   [22642] POWER    TYPE 4
> > > > > > (XEN)   [22643] IDLE     PPR 0x00000020
> > > > > > (XEN)                    IRR
> > > > > >
> > > >
> > 00000000000000000000000000000000000000000000000000000000000000
> > > > > > 00
> > > > > > (XEN)                    ISR
> > > > > >
> > > >
> > 00000000020000000000000000000000000000000000000000000000000000
> > > > > > 00
> > > > > > (XEN)   [22644] WAKE     PPR 0x00000020
> > > > > > (XEN)                    IRR
> > > > > >
> > > >
> > 00000000020000000000000000000000000000000000000000000000000000
> > > > > > 00
> > > > > > (XEN)                    ISR
> > > > > >
> > > >
> > 00000000020000000000000000000000000000000000000000000000000000
> > > > > > 00
> > > > >
> > > > > looks pending IRR (0x21) doesn't always trigger a spurious interrupt?
> > > >
> > > > Yes, that's correct. Having a pending IRR and going idle doesn't
> > > > always trigger the spurious interrupt re-injection.
> > > >
> > > > > is it a fixed pattern after how many rounds of Cstate enter/exit with
> > > > > pending IRR(0x21) then you see assertion happened (in this example
> > > > > it happens at 3rd time)?
> > > >
> > > > It's not a fixed pattern, here's another trace with IRR(0x21) being
> > > > pending just once during the Cstate transitions:
> > >
> > > did you observe a case where such asset may occur when IRR(0x21)
> > > is cleared but ISR (0x21) is set?
> > 
> > No, I've always seen both ISR and IRR set when the interrupt injection
> > happens. This of course doesn't mean it's not possible, but I have not
> > seen any trace with ISR(0x21) set and IRR(0x21) clear.
> > 
> 
> sorry but let me double confirm. You always see ISR[21]/IRR[21] being
> set "before and after entering C3" to hit the problem, right?

Yes, that's correct.

> When 
> interrupt injection happens later, ISR[21] is set but IRR[21] is cleared (as 
> expected for normal interrupt delivery process).
> 
> btw I checked your original mail:
> 
> (XEN)    [<ffff82d0802e2403>] mwait-idle.c#mwait_idle+0x2a5/0x381
> xen/arch/x86/cpu/mwait-idle.c:802
> 
>    788		if (cpu_is_haltable(cpu))
>    789			mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
>    790
>    791		after = cpuidle_get_tick();
>    792
>    793		cstate_restore_tsc();
>    794		trace_exit_reason(irq_traced);
>    795		TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
>    796			irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
>    797
>    798		/* Now back in C0. */
>    799		update_idle_stats(power, cx, before, after);
>    800		local_irq_enable();
>    801
> -> 802		if (!(lapic_timer_reliable_states & (1 << cstate)))
>    803			lapic_timer_on();
>    804
>    805		sched_tick_resume();
>    806		cpufreq_dbs_timer_resume();
> 
> Looks above code is different from staging:

The code matches staging at the point where I posted the original bug
report, 2 months ago.

> acpi_processor_idle:
> 	acpi_idle_do_entry:
> 		acpi_processor_ffh_cstate_enter:
> 			mwait_idle_with_hints

There's another caller of mwait_idle_with_hints, the mwait_idle
function. This gets setup by mwait_idle_init.

> there is no mwait_idle alone.

There's a mwait_idle in current staging code, check:

xen/arch/x86/cpu/mwait-idle.c:718

http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/arch/x86/cpu/mwait-idle.c;h=f89c52f2565e8deb7d4aec309124fe6fbd57b27d;hb=refs/heads/staging#l718

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-12-13  8:52 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 10:30 Interrupt injection with ISR set on Intel hardware Roger Pau Monné
2018-10-15 12:06 ` Andrew Cooper
2018-10-22  7:33   ` Chao Gao
2018-10-22  7:57     ` Andrew Cooper
2018-10-29 11:22     ` Roger Pau Monné
2018-10-25 12:51   ` Jan Beulich
2018-10-25 13:02     ` Andrew Cooper
2018-10-25 13:57       ` Jan Beulich
2018-10-30  6:59         ` Tian, Kevin
     [not found]         ` <AADFC41AFE54684AB9EE6CBC0274A5D19BE2BAB0@SHSMSX101.ccr.corp.intel.com>
2018-11-01  0:40           ` Tian, Kevin
2018-11-01  9:18             ` Andrew Cooper
2018-11-28  9:19               ` Roger Pau Monné
2018-12-02  8:52                 ` Tian, Kevin
2018-10-29 16:33 ` Jan Beulich
2018-10-29 16:44   ` Andrew Cooper
2018-10-29 16:58     ` Jan Beulich
2018-10-29 17:06       ` Andrew Cooper
2018-10-30  7:32         ` Jan Beulich
2018-10-29 16:55   ` Roger Pau Monné
2018-12-12 10:36 ` Tian, Kevin
2018-12-12 11:24   ` Roger Pau Monné
2018-12-12 11:48     ` Tian, Kevin
2018-12-12 12:17       ` Roger Pau Monné
2018-12-13  1:28         ` Tian, Kevin
2018-12-13  8:36           ` Jan Beulich
2018-12-13  9:03             ` Tian, Kevin
2018-12-13  8:52           ` Roger Pau Monné [this message]
     [not found]         ` <AADFC41AFE54684AB9EE6CBC0274A5D19BE9E951@SHSMSX101.ccr.corp.intel.com>
2018-12-13  2:44           ` Tian, Kevin
2018-12-13  8:39             ` Roger Pau Monné
2018-12-13  9:04               ` Tian, Kevin

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=20181213085211.goirbusx2lesguuh@mac \
    --to=roger.pau@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=wei.liu2@citrix.com \
    --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.