From: "Vesa Jääskeläinen" <chaac@nic.fi>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [RFC] TSC patch v2
Date: Fri, 04 Jul 2008 23:48:30 +0300 [thread overview]
Message-ID: <486E8C9E.9080107@nic.fi> (raw)
In-Reply-To: <20080704133829.11b5a75d@gibibit.com>
Colin D Bennett wrote:
> On Fri, 04 Jul 2008 22:49:59 +0300
> Vesa Jääskeläinen <chaac@nic.fi> wrote:
>
>> Hi Colin,
>>
>> Colin D Bennett wrote:
>>> Here is an updated version of the TSC patch.
>>>
>>> I addressed the issues in your comments with the exception of
>>> supporting x86 CPUs that don't have a TSC (386 and 486).
>>>
>>> I eliminated the grub_time_init() function and the call to it in
>>> grub_main() in favor of having grub_machine_init() simply call
>>> grub_tsc_calibrate(). The i386-pc and i386-efi platforms use the
>>> TSC.
>> Please still use grub_time_init(). Detect TSC, if it is there
>> calibrate and adapt for it. If it is not there, use RTC.
>
> Should grub_time_init() be a CPU or machine independent function?
> Should it use conditional compilation to be usable on different CPUs?
> Or should grub_time_init() be specific to i386 kernels at this point?
> (Since we don't have anything to initialize for non-TSC-supporting
> platforms.)
In your patch you just change call of grub_tsc_calibrate() to
grub_time_init(). And in grub_time_init() you check cpuflags if tsc is
available or not. If tsc is available you call grub_tsc_calibrate(). And
if you are planning to use function pointers then you set proper
function pointers accordingly.
> If grub_time_init() is specific to the i386 CPU, then grub_time_init()
> should check whether the CPU has TSC support, and if so,
> grub_tsc_calibrate() should be called, and calls to grub_get_time_ms()
> should be directed to the TSC implementation. If no TSC support is
> available, then no calibration is done, and calls to grub_get_time_ms()
> should be directed to the generic get_time_ms() implementation that
> uses grub_get_rtc() to do its job.
You can even make it something like:
- check for cpu flags (eg. detect method)
- if tsc, set function pointers rtc (init=tsc, getters=tsc)
- if no tsc set function pointers to rtc (init=rtc, getters=rtc)
- call function pointer init
> I want to make sure that I clearly understand what you want, since I
> have made major re-designs of the TSC support in GRUB in an attempt to
> do what you want. Just in the past couple of days I have spent about 8
> hours getting the TSC patch where it is now. (I know that seems
> like a lot since it's not that much code, but I am just beginning to get
> familiar with the GRUB kernel organization, so simple changes have been
> taking me a long time.)
Sure... This is why it is good to discuss and design these things on
mailing list :)
next prev parent reply other threads:[~2008-07-04 20:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 14:54 [RFC] High resolution time support using x86 TSC Colin D Bennett
2008-07-03 18:52 ` Marco Gerards
2008-07-04 15:58 ` Colin D Bennett
2008-07-04 16:10 ` Vesa Jääskeläinen
2008-07-04 17:26 ` Colin D Bennett
2008-07-20 18:21 ` Marco Gerards
2008-07-04 18:28 ` [RFC] TSC patch v2 Colin D Bennett
2008-07-04 19:49 ` Vesa Jääskeläinen
2008-07-04 20:38 ` Colin D Bennett
2008-07-04 20:48 ` Vesa Jääskeläinen [this message]
2008-07-20 18:45 ` Marco Gerards
2008-07-28 17:05 ` [PATCH] High resolution time/TSC patch v3 Colin D Bennett
2008-07-28 17:59 ` Robert Millan
2008-07-31 19:08 ` Marco Gerards
2008-07-31 19:24 ` Robert Millan
2008-07-31 20:07 ` Marco Gerards
2008-07-31 20:35 ` Robert Millan
2008-08-03 19:48 ` Robert Millan
2008-08-03 23:53 ` TSC on coreboot (Re: [PATCH] High resolution time/TSC patch v3) Robert Millan
2008-08-04 2:14 ` Colin D Bennett
2008-08-04 9:09 ` Robert Millan
2008-08-04 20:21 ` Marco Gerards
2008-08-05 11:59 ` [PATCH] High resolution time/TSC patch v3 Marco Gerards
2008-08-05 20:24 ` Robert Millan
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=486E8C9E.9080107@nic.fi \
--to=chaac@nic.fi \
--cc=grub-devel@gnu.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.