From nobody Mon Dec 30 16:33:40 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1689326970; cv=none; d=zohomail.com; s=zohoarc; b=czOTeNin0tTyz/FEszPZnS3EhmT9sZJ7sEMYsJuvlpS5A7B14darq9vF1h3Cp9B0g8XZ4iX986u+O4WRjg1UtD2EBTSeYHOFNlMg/wRu5NEZ7kZUcLUzgtl+vgJeO828BSoj2dYp/dw0LXaHoEO85oySU4S+vyIeXC4dbzol+2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689326970; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Subject:To; bh=qO0hqZOMRjyvEH41hCLNrq4UU0a3Xp3sSyCbdQFIR1U=; b=YL2G3hLCtiqtMp8MWFEpfl2zoXb2HJKLQ3+hTG3OsUa0OiFIdZ3RfvD7IdKEqaxLvJ4dqe7mjs7k4piimrJ9ivGfOdy8b7pUpcUV+eqF7BGq12m8NkQQC70ytNpfUy07ivVO0ozCxXze+PSP4x7h667Dogl28NYISoLLZzQGusk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1689326970401696.9953092327845; Fri, 14 Jul 2023 02:29:30 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id DAFA622D1C; Fri, 14 Jul 2023 09:29:25 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id E098B22CD4 for ; Fri, 14 Jul 2023 09:29:09 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by CH2PR12MB4937.namprd12.prod.outlook.com (2603:10b6:610:64::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Fri, 14 Jul 2023 09:29:07 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (2603:10b6:a03:254:cafe::f4) by BY3PR05CA0024.outlook.office365.com (2603:10b6:a03:254::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.15 via Frontend Transport; Fri, 14 Jul 2023 09:29:06 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) DM6NAM11FT012.mail.protection.outlook.com (10.13.173.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6588.27 via Frontend Transport; Fri, 14 Jul 2023 09:29:06 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 14 Jul 2023 04:29:05 -0500 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.6; Fri, 14 Jul 2023 02:29:05 -0700 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 14 Jul 2023 04:29:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1689326967; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:list-id:list-owner:list-unsubscribe:list-subscribe:list-post; bh=qO0hqZOMRjyvEH41hCLNrq4UU0a3Xp3sSyCbdQFIR1U=; b=L5mYJkkgmJKWTy0lM6+0raMAnEAEa3DWa0hv7AjEVUkZGmEBzpt1hjXM1VFXViuT2xp+fH tO/hiKz/HY0qJhGR7S+U+zzBjOadbqmlyc1WtfosHGc9/eXxU8lhBFmZLCoboesQXaBWip sK4GztYY22VzzoKDyRYZozu18nu9Igk= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KMnpdvlxNR7gN13AKguLpbh1b2uTlfiXGHTRNgGK+TNjPbx+LDl4+CyB3MyP8gDvMSall9l9USxdlHJP0k2bUDXZC3nMTAptwDXTSq+mh7JObDLJ4Hb7xwMFndnooBKV7JEGBbaiMes7lndIAgYQLFwQnomETzWqCa1jFROHlggIQIQFmP7kJHPvH77zPFZ7SL83iB+qZ/iLTxkGiTK/BOIYjDcbL3ca2UEG7H2vlFnK1jWt7iEHcsHvqnlZrdMBlQHzkSOLiCuX1SWpwIvhhypHUyDwbahDidjnSS8lJO5DH2U/QFOt5fR7mRS0ehmRzlXGCIiVuWXhhuJ3D3cJrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0xOoX2/Cgac9pFbV1Jy/oMIpEZrUX9KsUGUFT4KaB8k=; b=mzatdwN+kyGU7PecrYVN7jwASXzSaDRITLswK5LMJh7Nku//EIFbsPjmG7ypgrf/pjVXeVzgFZRXj0xixcyhzD9m6HRJyzs11eDsHTA6cq1OH4NWGe59U+CdtRNy6RGlecyDxC3hCjvPAkFuy17AcTjIfi6qKh5aaWFLr62z3MMOKU8RV53EsCNuVOmop31NNsZqenYe15eHeJdR8+ff92YMQF0lm7XyqFNfwDQmXJPRrM2LAAVgI55gV3QCVp/S6rLDMBuEAvtJYvhAug7ADKlKrM4HpZP1LPBg8HbD+7ZMHRC9B8HQRp/+I/hjD0OfjNvEeXlCRGEmvWSJ1/X24A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=seabios.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0xOoX2/Cgac9pFbV1Jy/oMIpEZrUX9KsUGUFT4KaB8k=; b=Yitsv9p+gF7xfGu0OpdX6uq2F+pkIoQc1+xEs4peC4pok4bd97lGsE2zAN5NlhvBVgt0eVsSlRSnzt+BWWcOPN4vwoM7srNV54aYSka8SHWNQWI1Qj46S4K+DsvtYtfwN/cXYFy+vTEFF3h/5XUQwP+TCVIACfZu00sOVRZZybA= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C To: Date: Fri, 14 Jul 2023 12:28:09 +0300 Message-ID: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT012:EE_|CH2PR12MB4937:EE_ X-MS-Office365-Filtering-Correlation-Id: 71c03ef3-fd5a-41a9-05b8-08db844cc532 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yxctxlntajJR0I3b0s6BCYonnnAY4xGNFdhzLpSa+ovIW6Zf0tf+IgQCodXNcesPgh2T6/uD4pmy6RPXRXsFkFtEdYuRrNTza4DckCzMJ+FHmrkno9iNiL00V2ydMfN1LhFdzaD261khhRT0cBohwk7zKQPsfySfEbEF9llsNVn8QICcBjgg4CFYDWSCkgodpS5oaG+bPtP0GtEH9feO7iSlm1r+EWl/69nGKVcKSsupHNO20rqOS/IJwP4wiIkuhZ3yW9b3Tcrl69yoxfm7cNNh+lROXfmVTJlY/dnVQx7EJC+f2iqBFQKt9zUHawZ5pcs8AG9juMAKL/1JMIz/Zz6AM9zLvlnR+Fsw88yzK2cVh3tMtTM3E3tLKTDEQeGFlBj7otClEMhZ7HRnz7u4WrX9dOaHQniqFqViDsXASbZG2UoQ3TBicHJy9w7B7COwWrGXEUaF2VzEOxpbXEdUt96L1lwWfvtW3IWMf3E38xPaYZpLvgSpibSn37QSpwTh2DE+DvrBYaeOwONbW0XbuOUoQ84vjOMcoTziTkmoko0++/0/f33kq6w29oRQgiZ1+oZYP3hbA7bficvplH6QjsrcDEDv6PbeiEH7PrNDgv8AsG+fdLjlCPg0uWQOCcAMy19mboVA0avKXR9JI0vcSABLkwxFZ0kAM8zLHTKoNoBFxTjFp9ANn4oiQSD7r8m5a8B4fhuNnWFRidA2UND/xC2YkgRh7IBsSb09AleGKRkdmiaKy3fU4jQ9Q+b9JNQUHT9s37CIf2k9HfV1qTK6VA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(6029001)(4636009)(396003)(39860400002)(346002)(376002)(136003)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(82310400005)(36756003)(86362001)(40480700001)(81166007)(40460700003)(82740400003)(356005)(16576012)(54906003)(44832011)(478600001)(316002)(70586007)(4326008)(6916009)(70206006)(5660300002)(8676002)(2906002)(41300700001)(8936002)(2616005)(336012)(186003)(26005)(47076005)(426003)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2023 09:29:06.2890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71c03ef3-fd5a-41a9-05b8-08db844cc532 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4937 Message-ID-Hash: WI76KHLHWGYKA2E6Z6NMU3LHNCCRHDKD X-Message-ID-Hash: WI76KHLHWGYKA2E6Z6NMU3LHNCCRHDKD X-MailFrom: Xenia.Ragiadakou@amd.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Xenia Ragiadakou , Gerd Hoffmann , xen-devel@lists.xenproject.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [SeaBIOS] [PATCH] paravirt: call pci_bios_init_devices() when runningOnXen() List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Xenia Ragiadakou via SeaBIOS Reply-To: Xenia Ragiadakou Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: + X-Spam-Level: * Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-ZohoMail-DKIM: pass (identity @seabios.org) X-ZM-MESSAGEID: 1689326971856100001 Content-Type: text/plain; charset="utf-8" The issue that this patch attempts to address is S3 related. Currently, suspending a XEN guest multiple times does not work. This happens because PIIX4 PM io space gets unmapped during S3 resume and any accesses performed to trigger subsequent suspends are not handled. So, the guest spins on the wake sts bit forever. Below follows a more detailed description of the issue. On S3 resume path, QEMU issues piix4_pm_reset() to bring PPIX4 PM controller to the state expected. More specifically, piix4_pm_reset() zeroes PMIOSE register, i.e pci_conf[0x80] =3D 0, and this results in unmapping PIIX4 PM io space, i.e. memory_region_set_enabled(&s->io, d->config[0x80] & 1) It is bios responsibility to reenable PIIX4 PM io space during S3 resume path. However, when running on XEN, the qemu platform initialization code does not call pci_bios_init_devices(), hence the PIIX4 PM controller init function is not called and PiixPmBDF is not set. The value of PiixPmBDF indicates the presence of PIIX4 PM controller. Thus, S3 resume code in pci_resume() considers that PIIX4 PM controller is not present and does not perform the relevant post-resume setup that restores PIIX4 PM io space. This is the reason why any subsequent guest access to those registers is not handled. This patch adds a call to pci_bios_init_devices() to the early xen platform setup code. Signed-off-by: Xenia Ragiadakou --- src/fw/paravirt.c | 1 + src/fw/pciinit.c | 2 +- src/util.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index fba4e52..0c035eb 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -205,6 +205,7 @@ qemu_platform_setup(void) =20 if (runningOnXen()) { pci_probe_devices(); + pci_bios_init_devices(); xen_hypercall_setup(); xen_biostable_setup(); return; diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index badf13d..f955481 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -417,7 +417,7 @@ static void pci_bios_init_device(struct pci_device *pci) PCI_BRIDGE_CTL_SERR); } =20 -static void pci_bios_init_devices(void) +void pci_bios_init_devices(void) { struct pci_device *pci; foreachpci(pci) { diff --git a/src/util.h b/src/util.h index aff8e88..ebd863f 100644 --- a/src/util.h +++ b/src/util.h @@ -137,6 +137,7 @@ extern u64 pcimem64_start, pcimem64_end; extern const u8 pci_irqs[4]; void pci_setup(void); void pci_resume(void); +void pci_bios_init_devices(void); =20 // fw/pirtable.c void pirtable_setup(void); --=20 2.34.1 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org