From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 4FAFFD80CAA for ; Tue, 16 Jan 2024 05:51:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=7g20UCReploTunCkYkzWgw4Kq1mUHvmpaNmdrop6rG4=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1705384266; v=1; b=qJdeYoJsi54IMRg2KTzCgP/uWtZL/SR3XbqiH7N//9Lg40RpLjbSh+K5XKkkYEql93Tn+4xY Y33lrYADZzQ+ZQnhm5iuojyZXIzvwBreXUUPJooTqABWgkSFVoQbYIr84Uo7rYKvsOpgqCy1eQS 095b3ZSWhKxYVwf87C52kgVA= X-Received: by 127.0.0.2 with SMTP id CyPJYY7687511xupZnchqo0A; Mon, 15 Jan 2024 21:51:06 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by mx.groups.io with SMTP id smtpd.web11.72208.1705305855278622364 for ; Mon, 15 Jan 2024 00:04:25 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10953"; a="6313742" X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="6313742" X-Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jan 2024 00:04:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,196,1695711600"; d="scan'208";a="25402252" X-Received: from ray-dev.ccr.corp.intel.com ([10.239.158.139]) by orviesa002.jf.intel.com with ESMTP; 15 Jan 2024 00:04:24 -0800 From: "Ni, Ray" To: devel@edk2.groups.io Cc: Michael D Kinney , Nate DeSimone , Laszlo Ersek , Rahul Kumar Subject: [edk2-devel] [PATCH 5/6] UefiCpuPkg/LocalApicTimerDxe: warn if APIC Timer is used by other code Date: Mon, 15 Jan 2024 16:03:24 +0800 Message-Id: <20240115080325.147-6-ray.ni@intel.com> In-Reply-To: <20240115080325.147-1-ray.ni@intel.com> References: <20240115080325.147-1-ray.ni@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2PynC3rtmIVZiJgPvq2FxBZ1x7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=qJdeYoJs; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) LocalApicTimerDxe uses APIC Timer as the timer interrupt source. Other code should not program the APIC Timer as it may cause the timer interrupt be signaled at the incorrect timer period or the timer interrupt might be disabled. The patch prints warning debug messages in driver entrypoint when the Initial Count is not the power-on default value 0. Signed-off-by: Ray Ni Cc: Michael D Kinney Cc: Nate DeSimone Cc: Laszlo Ersek Cc: Rahul Kumar --- UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c b/UefiCpuPkg/= LocalApicTimerDxe/LocalApicTimerDxe.c index babf2476e3..14ab8fd03d 100644 --- a/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c +++ b/UefiCpuPkg/LocalApicTimerDxe/LocalApicTimerDxe.c @@ -400,6 +400,15 @@ TimerDriverInitialize ( //=0D mTimerNotifyFunction =3D NULL;=0D =0D + if (GetApicTimerInitCount () !=3D 0) {=0D + DEBUG ((=0D + DEBUG_WARN,=0D + "Warning: APIC timer might be used by other drivers.\n"=0D + " The timer period may be changed unexpectedly.\n"=0D + " Please make sure no other code programs the APIC timer.\n"= =0D + ));=0D + }=0D +=0D //=0D // Make sure the Timer Architectural Protocol is not already installed i= n the system=0D //=0D --=20 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113804): https://edk2.groups.io/g/devel/message/113804 Mute This Topic: https://groups.io/mt/103734965/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-