qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bijan Mottahedeh <bijan.mottahedeh@oracle.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: kvmarm@lists.cs.columbia.edu, Karl Heubaum <karl.heubaum@oracle.com>
Subject: Re: [Qemu-devel] [RFC QEMU 1/2] arm/virt: Initialize generic timer scale factor dynamically
Date: Fri, 9 Nov 2018 19:12:08 -0800	[thread overview]
Message-ID: <7cfea6b6-b0eb-f276-edc7-da2e7f77ded0@oracle.com> (raw)
In-Reply-To: <47f78310-56e7-ba5e-0fb1-99830750e49b@linaro.org>

On 11/8/2018 6:21 AM, Richard Henderson wrote:
> On 11/7/18 7:48 PM, Bijan Mottahedeh wrote:
>>   
>> +static void set_system_clock_scale(void)
>> +{
>> +    unsigned long cntfrq_el0;
>> +
>> +    asm volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq_el0));
>> +
>> +    if (cntfrq_el0 == 0) {
>> +        cntfrq_el0 = GTIMER_SCALE_DEF;
>> +    }
>> +
>> +    system_clock_scale = NANOSECONDS_PER_SECOND / (int)cntfrq_el0;
>> +}
> This only works for kvm.
>
> For TCG you need to use the default always.  In particular, it won't even
> compile for an x86 host.
>
>
> r~
Is it ok to ifdef the asm statement with CONFIG_KVM, or what would be 
the correct way to account for TCG vs. KVM?

Thanks.

--bijan

  reply	other threads:[~2018-11-10  3:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07 18:48 [Qemu-devel] [RFC QEMU 0/2] arm/virt: Account for guest pause time Bijan Mottahedeh
2018-11-07 18:48 ` [Qemu-devel] [RFC QEMU 1/2] arm/virt: Initialize generic timer scale factor dynamically Bijan Mottahedeh
2018-11-08 14:21   ` Richard Henderson
2018-11-10  3:12     ` Bijan Mottahedeh [this message]
2018-11-07 18:48 ` [Qemu-devel] [RFC QEMU 2/2] arm/virt: Account for guest pause time Bijan Mottahedeh
2018-11-08 14:32 ` [Qemu-devel] [RFC QEMU 0/2] " no-reply
2018-11-08 14:34 ` no-reply

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=7cfea6b6-b0eb-f276-edc7-da2e7f77ded0@oracle.com \
    --to=bijan.mottahedeh@oracle.com \
    --cc=karl.heubaum@oracle.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).