From patchwork Mon Jul 31 10:32:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Gaiser X-Patchwork-Id: 13334263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCC1EC001DE for ; Mon, 31 Jul 2023 10:33:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.572878.896958 (Exim 4.92) (envelope-from ) id 1qQQDP-0001S8-FH; Mon, 31 Jul 2023 10:33:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 572878.896958; Mon, 31 Jul 2023 10:33:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qQQDP-0001S1-Ch; Mon, 31 Jul 2023 10:33:27 +0000 Received: by outflank-mailman (input) for mailman id 572878; Mon, 31 Jul 2023 10:33:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qQQDN-0001Rv-Pu for xen-devel@lists.xenproject.org; Mon, 31 Jul 2023 10:33:26 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ab6e9b9f-2f8d-11ee-b254-6b7b168915f2; Mon, 31 Jul 2023 12:33:23 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 79AA95C013A; Mon, 31 Jul 2023 06:33:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 31 Jul 2023 06:33:20 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jul 2023 06:33:18 -0400 (EDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ab6e9b9f-2f8d-11ee-b254-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t= 1690799600; x=1690886000; bh=gbZ43CfdF993NYpYySwQkSalc5T7JSkZ6hd i7rJBdL8=; b=onaTmr8w6gRMgtzg0ShO/oYjFgAo2zSgdPX20qtJrZW3lSSzCQi q2YKnlf7PVDMTYp7qOrMfwttKSOTwhIYWMQ2UOT4iaU+o62sPLO0WIqJY6pjEzIu iGBguKokk+5WbrG1ETaVtguk/RVo0lZqklzZ5AaSh6qTOYrwbtbIt7Z6Ko0kwh/g YO9rpzcWfg9OJ7MS8vSU24Lu9SexKGel8JHna5FziqQ39xcZTpgJlzl2KLY7azBI VHz0YzmhC3mPfj/Os9ZBBI0M8JKHjtDuBUqXkmWU08OIW2G5HsQg/e6FAjoGr6n1 RFDZgcDeRAI1oOsfaU3e33mZs2dEf+zQNHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690799600; x=1690886000; bh=gbZ43CfdF993N YpYySwQkSalc5T7JSkZ6hdi7rJBdL8=; b=3SBiZjD4+BSwUf4OsqiCdkYKtNoy8 vGRQWhGZE52JdCVfi3XBypWPXvPXkTVw8ZxH41jwbiuNYAH5Tb0QkUNPkmR79iT4 bPG6ScCdjSvHbd/lE9fDtf4hIGi9IgrRdfjZorMYBI6TebOmtxn+2eh/MZKhfs2D Y1pSQO5cX76frQ3Y96dIVTb4ubDLAftyQFFK6M73NBqsbMXT8ndhUu6vhuxkWGSB glqCtocQ73NfTC9jE+Z1wJ8IxN3SNr1InzJQcywX8AbKSM0G5/1/Q8V9MpPiJ0ew uEuvGuTeAzepd8UPaXUNbZ3kMqXqAyWjb1RycgU+IeV3T0aED+53avQqw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeeggddtiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuihhmohhnucfi rghishgvrhcuoehsihhmohhnsehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh eqnecuggftrfgrthhtvghrnhepueevheegtdefgeefuddvfeduueduffffffejveeugeef udefiedugedugeevudfgnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehsihhmohhnsehinhhv ihhsihgslhgvthhhihhnghhslhgrsgdrtghomh X-ME-Proxy: Feedback-ID: idc5945a3:Fastmail From: Simon Gaiser To: xen-devel@lists.xenproject.org Cc: Simon Gaiser , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu , =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= Subject: [XEN PATCH v2] x86/hpet: Disable legacy replacement mode after IRQ test Date: Mon, 31 Jul 2023 12:32:12 +0200 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 As far as I understand the HPET legacy mode is not required after the timer IRQ test. For previous discussion see [1] and [2]. Keeping it enabled prevents reaching deeper C-states on some systems and thereby also S0ix residency. So disable it after the timer IRQ test worked. Note that this code path is only reached when opt_hpet_legacy_replacement < 0, so explicit user choice is still honored. Link: https://lore.kernel.org/xen-devel/cb408368-077d-edb5-b4ad-f80086db48c1@invisiblethingslab.com/ # [1] Link: https://lore.kernel.org/xen-devel/20230718122603.2002-1-simon@invisiblethingslab.com/ # [2] Signed-off-by: Simon Gaiser Reviewed-by: Jan Beulich --- Changes in v2: - Always disable legacy mode after test, not only when ARAT is available. See [3] for reasoning. [3]: https://lore.kernel.org/xen-devel/ac77ecba-6804-1d16-60dc-f184e5d31dcb@invisiblethingslab.com/ --- xen/arch/x86/io_apic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c index 041233b9b7..b4b4cd5939 100644 --- a/xen/arch/x86/io_apic.c +++ b/xen/arch/x86/io_apic.c @@ -1967,6 +1967,8 @@ static void __init check_timer(void) if ( timer_irq_works() ) { + printk(XENLOG_INFO "IRQ test with HPET Legacy Replacement Mode worked. Disabling it again.\n"); + hpet_disable_legacy_replacement_mode(); local_irq_restore(flags); return; }