public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: devel@edk2.groups.io, Pawel Polawski <ppolawsk@redhat.com>,
	Oliver Steffen <osteffen@redhat.com>
Subject: Re: [PATCH 1/1] OvmfPkg: fix PcdFSBClock
Date: Wed, 25 May 2022 08:28:17 +0200	[thread overview]
Message-ID: <20220525062817.vtftp5od35yrta6y@sirius.home.kraxel.org> (raw)
In-Reply-To: <458b6bad-9c46-92c7-0684-f3a9075dd737@redhat.com>

  Hi,

> By the way: "kvm FSB clock is 1GHz" -- where is that constant set in
> KVM?
> 
> ... is it "target/i386/kvm/kvm.c" in QEMU:
> 
> > /* From arch/x86/kvm/lapic.h */
> > #define KVM_APIC_BUS_CYCLE_NS       1
> > #define KVM_APIC_BUS_FREQUENCY      (1000000000ULL / KVM_APIC_BUS_CYCLE_NS)
> 
> FWIW, APIC_BUS_CYCLE_NS=1 goes back to historical KVM commit
> 97222cc83163 ("KVM: Emulate local APIC in kernel", 2007-10-13). The
> commit does not say anything about this particular choice. (Maybe I
> should look at the QEMU source from 2007 -- perhaps the KVM commit was
> inspired by QEMU practice back then. And now we've come full circle: the
> definitive constant lives in the kernel, which is where QEMU is taking
> it from...)
> 
> ... I think these macros are pretty difficult to find, unless one knows
> already what they're looking for!

I know ;)

Did the same a while back, looking for a way to figure at runtime
what the frequency is (simliar to xen), only to find that it is not
needed on kvm because frequency is fixed.

> BTW is there a chance that TCG uses a different frequency?

Never noticed a difference.  Unlikely I'd say.  Maybe kvm uses 1GHz
because tcg does after all.  Didn't check the code though.

take care,
  Gerd


      reply	other threads:[~2022-05-25  6:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-23 13:45 [PATCH 1/1] OvmfPkg: fix PcdFSBClock Gerd Hoffmann
2022-05-24  6:29 ` Gerd Hoffmann
2022-05-25  1:42   ` 回复: [edk2-devel] " gaoliming
2022-05-25  3:00     ` Yao, Jiewen
2022-05-25 13:43       ` Yao, Jiewen
2022-05-24 17:50 ` Laszlo Ersek
2022-05-25  6:28   ` Gerd Hoffmann [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-list 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=20220525062817.vtftp5od35yrta6y@sirius.home.kraxel.org \
    --to=devel@edk2.groups.io \
    /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