From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by mx.groups.io with SMTP id smtpd.web10.22084.1585167421662000831 for ; Wed, 25 Mar 2020 13:17:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: bsdio.com, ip: 166.70.13.231, mailfrom: rebecca@bsdio.com) Received: from in02.mta.xmission.com ([166.70.13.52]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jHCSS-0003gV-FQ; Wed, 25 Mar 2020 14:17:00 -0600 Received: from mta4.zcs.xmission.com ([166.70.13.68]) by in02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jHCSR-00061b-Hu; Wed, 25 Mar 2020 14:17:00 -0600 Received: from localhost (localhost [127.0.0.1]) by mta4.zcs.xmission.com (Postfix) with ESMTP id 5AEF65005B7; Wed, 25 Mar 2020 14:16:59 -0600 (MDT) X-Amavis-Modified: Mail body modified (using disclaimer) - mta4.zcs.xmission.com Received: from mta4.zcs.xmission.com ([127.0.0.1]) by localhost (mta4.zcs.xmission.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id b6t-dBLg-ga3; Wed, 25 Mar 2020 14:16:59 -0600 (MDT) Received: from cube.int.bluestop.org (muon.bluestop.org [65.103.231.193]) by mta4.zcs.xmission.com (Postfix) with ESMTPSA id F389B5005AD; Wed, 25 Mar 2020 14:16:58 -0600 (MDT) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Rebecca Cran Date: Wed, 25 Mar 2020 14:16:52 -0600 Message-Id: <20200325201652.54298-1-rebecca@bsdio.com> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 X-XM-SPF: eid=1jHCSR-00061b-Hu;;;mid=<20200325201652.54298-1-rebecca@bsdio.com>;;;hst=in02.mta.xmission.com;;;ip=166.70.13.68;;;frm=rebecca@bsdio.com;;;spf=pass X-SA-Exim-Connect-IP: 166.70.13.68 X-SA-Exim-Mail-From: rebecca@bsdio.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa07.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.7 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,LotsOfNums_01,T_TooManySym_01,T_TooManySym_02, XMSubLong autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.7 XMSubLong Long Subject * 1.2 LotsOfNums_01 BODY: Lots of long strings of numbers * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; IP=ok Body=1 Fuz1=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; IP=ok Body=1 Fuz1=1 X-Spam-Combo: *;devel@edk2.groups.io X-Spam-Relay-Country: X-Spam-Timing: total 707 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 11 (1.6%), b_tie_ro: 10 (1.4%), parse: 0.93 (0.1%), extract_message_metadata: 13 (1.8%), get_uri_detail_list: 1.52 (0.2%), tests_pri_-1000: 15 (2.1%), tests_pri_-950: 1.26 (0.2%), tests_pri_-900: 0.97 (0.1%), tests_pri_-90: 270 (38.3%), check_bayes: 269 (38.0%), b_tokenize: 8 (1.2%), b_tok_get_all: 95 (13.4%), b_comp_prob: 1.71 (0.2%), b_tok_touch_all: 160 (22.7%), b_finish: 0.81 (0.1%), tests_pri_0: 383 (54.2%), check_dkim_signature: 0.53 (0.1%), check_dkim_adsp: 20 (2.8%), poll_dns_idle: 18 (2.5%), tests_pri_10: 2.2 (0.3%), tests_pri_500: 7 (1.0%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH v2 (add signed-off-by)] OvmfPkg: Add bhyve support into AcpiTimerLib X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Content-Transfer-Encoding: quoted-printable Signed-off-by: Rebecca Cran --- OvmfPkg/Include/OvmfPlatforms.h | 7 +++++++ OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c | 3 +++ OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c | 4 ++++ OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c | 3 +++ 4 files changed, 17 insertions(+) diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatform= s.h index 59459231e8..3d1a8fd8fa 100644 --- a/OvmfPkg/Include/OvmfPlatforms.h +++ b/OvmfPkg/Include/OvmfPlatforms.h @@ -37,4 +37,11 @@ //=0D #define ACPI_TIMER_OFFSET 0x8=0D =0D +//=0D +// bhyve definitions=0D +//=0D +#define BHYVE_PCI_DEVICE_ID 0x1275 // NetApp vendor ID=0D +=0D +#define BHYVE_ACPI_TIMER_IO_ADDR 0x408=0D +=0D #endif=0D diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Libr= ary/AcpiTimerLib/BaseAcpiTimerLib.c index aa2b5faf1c..e32260b134 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c @@ -41,6 +41,9 @@ AcpiTimerLibConstructor ( //=0D HostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID);=0D switch (HostBridgeDevId) {=0D + case BHYVE_PCI_DEVICE_ID:=0D + mAcpiTimerIoAddr =3D BHYVE_ACPI_TIMER_IO_ADDR;=0D + return RETURN_SUCCESS;=0D case INTEL_82441_DEVICE_ID:=0D Pmba =3D POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);=0D PmbaAndVal =3D ~(UINT32)PIIX4_PMBA_MASK;=0D diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/L= ibrary/AcpiTimerLib/BaseRomAcpiTimerLib.c index dd022aceed..2fec105dea 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c @@ -39,6 +39,8 @@ AcpiTimerLibConstructor ( //=0D HostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID);=0D switch (HostBridgeDevId) {=0D + case BHYVE_PCI_DEVICE_ID:=0D + return RETURN_SUCCESS;=0D case INTEL_82441_DEVICE_ID:=0D Pmba =3D POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);=0D PmbaAndVal =3D ~(UINT32)PIIX4_PMBA_MASK;=0D @@ -101,6 +103,8 @@ InternalAcpiGetTimerTick ( //=0D HostBridgeDevId =3D PciRead16 (OVMF_HOSTBRIDGE_DID);=0D switch (HostBridgeDevId) {=0D + case BHYVE_PCI_DEVICE_ID:=0D + return IoRead32(BHYVE_ACPI_TIMER_IO_ADDR);=0D case INTEL_82441_DEVICE_ID:=0D Pmba =3D POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);=0D break;=0D diff --git a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/OvmfPkg/Libra= ry/AcpiTimerLib/DxeAcpiTimerLib.c index ae976cbe9e..10c41ff7ed 100644 --- a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c @@ -44,6 +44,9 @@ AcpiTimerLibConstructor ( //=0D HostBridgeDevId =3D PcdGet16 (PcdOvmfHostBridgePciDevId);=0D switch (HostBridgeDevId) {=0D + case BHYVE_PCI_DEVICE_ID:=0D + mAcpiTimerIoAddr =3D BHYVE_ACPI_TIMER_IO_ADDR;=0D + return RETURN_SUCCESS;=0D case INTEL_82441_DEVICE_ID:=0D Pmba =3D POWER_MGMT_REGISTER_PIIX4 (PIIX4_PMBA);=0D break;=0D --=20 2.25.2