xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: andrew.cooper3@citrix.com, aaron@ajanse.me,
	xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [BUG] panic: "IO-APIC + timer doesn't work" - several people have reproduced
Date: Wed, 18 Mar 2020 11:28:38 +0100	[thread overview]
Message-ID: <b7965c1c-8e6a-a133-5e2c-0640b4b0e60c@suse.com> (raw)
In-Reply-To: <20200317152310.114567-1-jandryuk@gmail.com>

On 17.03.2020 16:23, Jason Andryuk wrote:
> On 17.03.2020 15:08, Jan Beulich wrote:
>> On 17.03.2020 15:08, Jan Beulich wrote:
>>> On 17.03.2020 14:48, Jason Andryuk wrote:
>>>> I got it to boot past "IO-APIC + timer doesn't work".  I programmed
>>>> the HPET to provide a periodic timer in hpet_resume() on T0.  When I
>>>> actually got it programmed properly, it worked to increment
>>>> pit0_ticks.  I also made timer_interrupt() unconditionally
>>>> pit0_ticks++ though that may not matter.
>>>
>>> Hmm, at the first glance I would imply the system gets handed to Xen
>>> with a HPET state that we don't (and probably also shouldn't) expect.
>>> Could you provide HPET_CFG as well as all HPET_Tn_CFG and
>>> HPET_Tn_ROUTE values as hpet_resume() finds them before doing any
>>> adjustments to them? What are the components / parties involved in
>>> getting Xen loaded and started?
>>
>> Of course much depends on what exactly you mean you've done to
>> the HPET by saying "I programmed the HPET to provide ...".
> 
> Below is the diff.  It was messier and I tidied it up some.
> 
> It's mainly the change to hpet_resume() to mimic Linux's legacy HPET
> setup on T0.  It turns on HPET_CFG_LEGACY to ensure the timer interrupt
> is running.  And it also includes the printing of the initial HPET
> config:
> HPET_CFG 00000001
> HPET_T0_CFG 00008030
> HPET_T0_ROUTE 0000016c
> HPET_T1_CFG 00008000
> HPET_T1_ROUTE 00000000
> HPET_T2_CFG 00008000
> HPET_T2_ROUTE 00000000
> HPET_T3_CFG 00008000
> HPET_T3_ROUTE 00000000
> HPET_T4_CFG 0000c000
> HPET_T4_ROUTE 00000000
> HPET_T5_CFG 0000c000
> HPET_T5_ROUTE 00000000
> HPET_T6_CFG 0000c000
> HPET_T6_ROUTE 00000000
> HPET_T7_CFG 0000c000
> HPET_T7_ROUTE 00000000
> 
> Other changes are to try to prevent Xen from clobbering T0 as a periodic
> timer.

Why "clobbering"? According to the values above T0 is neither enabled
nor set to periodic.

> --- a/xen/arch/x86/hpet.c
> +++ b/xen/arch/x86/hpet.c
> @@ -585,16 +585,27 @@ void __init hpet_broadcast_init(void)
>               pv_rtc_handler = handle_rtc_once;
>       }
>   
> +    printk(XENLOG_INFO "%s cfg %d\n", __func__, cfg);
>       hpet_write32(cfg, HPET_CFG);
>   
>       for ( i = 0; i < n; i++ )
>       {
> -        if ( i == 0 && (cfg & HPET_CFG_LEGACY) )
> +        printk(XENLOG_INFO "hpet cfg %d legacy %d\n", i, cfg & HPET_CFG_LEGACY);
> +        if ( i == 1 && (cfg & HPET_CFG_LEGACY) )
>           {
>               /* set HPET T0 as oneshot */
> -            cfg = hpet_read32(HPET_Tn_CFG(0));
> +            cfg = hpet_read32(HPET_Tn_CFG(1));
>               cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC);
>               cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
> +            hpet_write32(cfg, HPET_Tn_CFG(1));
> +        }
> +
> +        if ( i == 0 && (cfg & HPET_CFG_LEGACY) )
> +        {
> +            /* set HPET T0 as periodic */
> +            cfg = hpet_read32(HPET_Tn_CFG(0));
> +            cfg |= (HPET_TN_LEVEL | HPET_TN_PERIODIC);

A change like this of course won't be acceptable outside of
your own repo, but I assume you're clear about this.

Jan

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

  parent reply	other threads:[~2020-03-18 10:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-31  7:52 [Xen-devel] [BUG] panic: "IO-APIC + timer doesn't work" - several people have reproduced Aaron Janse
2019-12-31  8:27 ` Andrew Cooper
2019-12-31  9:07   ` Aaron Janse
2020-02-17 19:19     ` Jason Andryuk
2020-02-17 19:46       ` Andrew Cooper
2020-02-17 20:41         ` Jason Andryuk
2020-02-18  1:21           ` Andrew Cooper
2020-02-18 18:43             ` Jason Andryuk
2020-02-18 21:45               ` Andrew Cooper
2020-02-19  8:25                 ` Jan Beulich
2020-03-04 16:06                   ` Jason Andryuk
2020-03-17 13:48                     ` Jason Andryuk
2020-03-17 14:08                       ` Jason Andryuk
2020-03-17 14:17                         ` Jan Beulich
2020-03-17 14:08                       ` Jan Beulich
2020-03-17 14:15                         ` Jan Beulich
2020-03-17 15:23                           ` Jason Andryuk
2020-03-17 16:31                             ` Jason Andryuk
2020-03-18 10:28                             ` Jan Beulich [this message]
2020-03-18 14:04                               ` Jason Andryuk
2020-03-18 17:34                                 ` Jason Andryuk
2020-04-17  9:31                             ` Jan Beulich
2020-04-28 20:59                               ` Jason Andryuk
2020-03-04 16:05               ` Jason Andryuk
2020-01-03 12:51 ` Jan Beulich
2020-01-06  0:35   ` Aaron Janse
2020-01-06  8:57     ` 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=b7965c1c-8e6a-a133-5e2c-0640b4b0e60c@suse.com \
    --to=jbeulich@suse.com \
    --cc=aaron@ajanse.me \
    --cc=andrew.cooper3@citrix.com \
    --cc=jandryuk@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).