The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: make sure we really have an hpet mapping before using it
Date: Tue, 16 Dec 2008 22:02:40 +0100	[thread overview]
Message-ID: <20081216210240.GJ14787@elte.hu> (raw)
In-Reply-To: <49481694.9070707@goop.org>


* Jeremy Fitzhardinge <jeremy@goop.org> wrote:

> Ingo Molnar wrote:
>> * Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>>
>>   
>>> When booting in Xen dom0, the hpet isn't really accessible, so make
>>> sure the mapping is non-NULL before use.
>>>
>>> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
>>> ---
>>> arch/x86/kernel/hpet.c |    5 +++--
>>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> ===================================================================
>>> --- a/arch/x86/kernel/hpet.c
>>> +++ b/arch/x86/kernel/hpet.c
>>> @@ -818,9 +818,10 @@
>>>
>>> 		hpet_address = force_hpet_address;
>>> 		hpet_enable();
>>> -		if (!hpet_virt_address)
>>> -			return -ENODEV;
>>> 	}
>>> +
>>> +	if (!hpet_virt_address)
>>> +		return -ENODEV;
>>>     
>>
>> hm, how can hpet_virt_address become non-NULL if hpet_address is zero?
>>   
>
> The mapping is normally created in (paravirt_ops.)time_init -> 
> hpet_time_init -> hpet_enable -> hpet_set_mapping.  However, under Xen, 
> time_init points to the Xen time init function, and so hpet_time_init is 
> never called.
>
> hpet_time_late_init is always called because its an initfunc.  In domU 
> it doesn't matter because hpet_address is NULL and so it does nothing.  
> In dom0, however, all the ACPI table parsing gets done as normal, so the 
> hpet is discovered and its address found.  But it is not available for 
> the dom0 kernel's use, and it is never mapped.

ok - applied it to tip/timers/hpet.

	Ingo

      reply	other threads:[~2008-12-16 21:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 20:32 [PATCH] x86: make sure we really have an hpet mapping before using it Jeremy Fitzhardinge
2008-12-16 20:48 ` Ingo Molnar
2008-12-16 20:59   ` Jeremy Fitzhardinge
2008-12-16 21:02     ` Ingo Molnar [this message]

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=20081216210240.GJ14787@elte.hu \
    --to=mingo@elte.hu \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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