From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.3744.1653460102349496146 for ; Tue, 24 May 2022 23:28:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KSEXWtRq; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653460101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PYxxlOD9WHlZv2NPJ3bzDk1zVrqHm6Aoa4T/miyTeB4=; b=KSEXWtRqdvhbNQ8Fc+VbR2rRDj979ssX4LUrAsuwqxUI/DY0zYLwoYuw5/tVOshQUWSNQm B5iIWjFg2tEbx+y8wujPvDevrE79JZ956LCoR5d7/ESF2WT21tQiUpArjZyhyPqzoREgY6 wMVzUs2/mBJHWJttMec4Ufmz1cgXT1A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-iGfEtI3VMHGs5hga8V7YUA-1; Wed, 25 May 2022 02:28:19 -0400 X-MC-Unique: iGfEtI3VMHGs5hga8V7YUA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 751F7185A7A4 for ; Wed, 25 May 2022 06:28:19 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 477421121315; Wed, 25 May 2022 06:28:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9750C18000B4; Wed, 25 May 2022 08:28:17 +0200 (CEST) Date: Wed, 25 May 2022 08:28:17 +0200 From: "Gerd Hoffmann" To: Laszlo Ersek Cc: devel@edk2.groups.io, Pawel Polawski , Oliver Steffen Subject: Re: [PATCH 1/1] OvmfPkg: fix PcdFSBClock Message-ID: <20220525062817.vtftp5od35yrta6y@sirius.home.kraxel.org> References: <20220523134504.1304459-1-kraxel@redhat.com> <458b6bad-9c46-92c7-0684-f3a9075dd737@redhat.com> MIME-Version: 1.0 In-Reply-To: <458b6bad-9c46-92c7-0684-f3a9075dd737@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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