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 B0705107BCD1 for ; Fri, 13 Mar 2026 16:35:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1253919.1549958 (Exim 4.92) (envelope-from ) id 1w15Tp-0000VB-AP; Fri, 13 Mar 2026 16:35:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1253919.1549958; Fri, 13 Mar 2026 16:35:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w15Tp-0000TO-2B; Fri, 13 Mar 2026 16:35:17 +0000 Received: by outflank-mailman (input) for mailman id 1253919; Fri, 13 Mar 2026 16:35:14 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w15Tm-0006Ek-Nl for xen-devel@lists.xenproject.org; Fri, 13 Mar 2026 16:35:14 +0000 Received: from mail179-36.suw41.mandrillapp.com (mail179-36.suw41.mandrillapp.com [198.2.179.36]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 98d2f523-1efa-11f1-9ccf-f158ae23cfc8; Fri, 13 Mar 2026 17:35:08 +0100 (CET) Received: from pmta12.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail179-36.suw41.mandrillapp.com (Mailchimp) with ESMTP id 4fXVT53gDVzlfjbT for ; Fri, 13 Mar 2026 16:35:05 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 27f9226dc476489280796f4f05794d27; Fri, 13 Mar 2026 16:35:05 +0000 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: 98d2f523-1efa-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1773419705; x=1773689705; bh=peVzH/RSknOHNSKTQdaYXevRTD3ymuxiEuHEUoR9BgM=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=E4iTtJ8OJ+U52Jcmqe6F4/4D2tExf3Njg8tyNOGH/opfEnDxh4V3DdqBHFlkE2BkT LNYjx8uVG2RpsNDlUdo6RktLw3fuNAZlP7nkOPh2vnMIJFJo3BoLlkI271XT+iovI4 oCP8cbVbTTVMNS68tAfUPjPjkZh8/3NWoJj+bGnfGOsrBnXalIyP7RucDl18QeCpf6 JQ5dMlNeIVaxbWXBrK5Dqjl/8xEfXab206rcNjXzuv82YpKAFBgkktTNEAdB+KAq9V KLLpSnwv+mMAFWIAyjV0J7lRFp0KidcGh0+B/F1mLIM0HBp94ZoSNzDBizIQNOZdLT zpD/7qWCutmZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1773419705; x=1773680205; i=thierry.escande@vates.tech; bh=peVzH/RSknOHNSKTQdaYXevRTD3ymuxiEuHEUoR9BgM=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=IAG8VVPYvK2e73qkhrFw4a55QbxAeF4tgwa1P3vkuEuENpJbMTUKozO2PM2rHpPWe NtNq6i8c/u1K4AvnIrMwYrlM5IeZCfkw+I5plnttlBYUfwPzs9UJ5/vonOUBG9/Hbn 84tP8B+6d/sz7oPhyTK1yR0cypIQ8M4pfuKl719qIhIEuQAIihJlB6IDMQI5pTte8q ayILS8tgVK9exOEJ9E5vc0m2vqOeVHSDpkjaTp2uBzankU3oqKN9smZ+yS17x0cNcX Pyl6zjDo8lB1hwBs4wtKmPHaoTItPAP55A/gMmQMAccVlyxVPHCeHud6AgBG09O6zS JFF3QHCCPpK5w== From: "Thierry Escande" Subject: =?utf-8?Q?[PATCH=2004/17]=20hvmloader:=20add=20ACPI=20enabling=20for=20Q35?= X-Mailer: git-send-email 2.51.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1773419701560 To: xen-devel@lists.xenproject.org Cc: "Thierry Escande" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Anthony PERARD" , "Alexey Gerasimenko" Message-Id: <20260313163455.790692-5-thierry.escande@vates.tech> In-Reply-To: <20260313163455.790692-1-thierry.escande@vates.tech> References: <20260313163455.790692-1-thierry.escande@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.27f9226dc476489280796f4f05794d27?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260313:md Date: Fri, 13 Mar 2026 16:35:05 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit In order to turn on ACPI for OS, we need to write a chipset-specific value to SMI_CMD register (sort of imitation of the APM->ACPI switch on real systems). Modify acpi_enable_sci() function to support both i440 and Q35 emulation. Signed-off-by: Alexey Gerasimenko Signed-off-by: Thierry Escande --- tools/firmware/hvmloader/hvmloader.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c index 626cc53649..f6cc3fa4b9 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c @@ -258,9 +258,24 @@ static const struct bios_config *detect_bios(void) static void acpi_enable_sci(void) { uint8_t pm1a_cnt_val; + uint8_t acpi_enable_val; -#define PIIX4_SMI_CMD_IOPORT 0xb2 +#define SMI_CMD_IOPORT 0xb2 #define PIIX4_ACPI_ENABLE 0xf1 +#define ICH9_ACPI_ENABLE 0x02 + + switch ( machine_type ) + { + case MACHINE_TYPE_Q35: + acpi_enable_val = ICH9_ACPI_ENABLE; + break; + case MACHINE_TYPE_I440: + acpi_enable_val = PIIX4_ACPI_ENABLE; + break; + default: + /* Not likely to happen */ + BUG(); + } /* * PIIX4 emulation in QEMU has SCI_EN=0 by default. We have no legacy @@ -268,7 +283,7 @@ static void acpi_enable_sci(void) */ pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); if ( !(pm1a_cnt_val & ACPI_PM1C_SCI_EN) ) - outb(PIIX4_SMI_CMD_IOPORT, PIIX4_ACPI_ENABLE); + outb(SMI_CMD_IOPORT, acpi_enable_val); pm1a_cnt_val = inb(ACPI_PM1A_CNT_BLK_ADDRESS_V1); BUG_ON(!(pm1a_cnt_val & ACPI_PM1C_SCI_EN)); -- 2.51.0 -- Thierry Escande | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech