From nobody Sat Nov 30 16:45:47 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1611037166; cv=none; d=zohomail.com; s=zohoarc; b=GeUi/g8aHLxQpdtucQG5CSnapnxLnSaAtZV527hlFVfSiCSTIFtvAzOArQqp7GX98iBbd4oH9AbeBSXnMm+vQ4SEEhOJcJYYj4fFRsGCZb7fQdhi6mb2mqmEXbNLaCvyY5+o69DZQOPX4TER3dh9PMZYPkMNQxqcRTKpadZo7g8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611037166; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WH6te05gL8DAiwOiG8nnjyFwXXhtkjUzRiAMuUsF1bU=; b=YQNJSbIVHrJAiqXdMb6Al93O/9pElk2YCIaKAKbLVOpwA8cyJHL2s7E9ohbw8Xy6DBKn+L7BGJR7+8gm0ifEKhq9XysqUIsPnxK4WIs68+5jZpRCRZFblavReJrghtUDOMKbqJrjJqnJHW9IVzH++o8ijcyffzEmCvHPe28sgLg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1611037166140143.90663384519814; Mon, 18 Jan 2021 22:19:26 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.70124.125811 (Exim 4.92) (envelope-from ) id 1l1kLx-000736-Sn; Tue, 19 Jan 2021 06:18:57 +0000 Received: by outflank-mailman (output) from mailman id 70124.125811; Tue, 19 Jan 2021 06:18:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l1kLx-00072z-PP; Tue, 19 Jan 2021 06:18:57 +0000 Received: by outflank-mailman (input) for mailman id 70124; Tue, 19 Jan 2021 06:18:56 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l1kLw-00072a-G5 for xen-devel@lists.xenproject.org; Tue, 19 Jan 2021 06:18:56 +0000 Received: from devnote (unknown [210.141.244.193]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bb73f5c6-d667-4fae-9c36-d5f93ebaefc5; Tue, 19 Jan 2021 06:18:55 +0000 (UTC) Received: from devnote (localhost [127.0.0.1]) by devnote (8.15.2/8.15.2/Debian-18) with ESMTPS id 10J5uVpT001015 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 19 Jan 2021 14:57:10 +0900 Received: (from mhiramat@localhost) by devnote (8.15.2/8.15.2/Submit) id 08SChj4M004702; Mon, 28 Sep 2020 21:43:45 +0900 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: bb73f5c6-d667-4fae-9c36-d5f93ebaefc5 From: Masami Hiramatsu To: xen-devel@lists.xenproject.org Cc: alex.bennee@linaro.org, masami.hiramatsu@linaro.org, ehem+xen@m5p.com, bertrand.marquis@arm.com, andre.przywara@arm.com, Julien Grall , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH] xen: acpi: Hide UART address only if SPCR exists Date: Mon, 28 Sep 2020 21:42:45 +0900 Message-Id: <160129696545.4486.5090289203994972923.stgit@localhost> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: <160129689861.4486.15700361505030965554.stgit@localhost> References: <160129689861.4486.15700361505030965554.stgit@localhost> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Since there is a case that UEFI (EDK2) doesn't make the SPCR table when it is booted with graphic console, ignore it if SPCR doesn't exist. Signed-off-by: Masami Hiramatsu --- xen/arch/arm/acpi/domain_build.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/acpi/domain_build.c b/xen/arch/arm/acpi/domain_bu= ild.c index 1b1cfabb00..a50adbb9ab 100644 --- a/xen/arch/arm/acpi/domain_build.c +++ b/xen/arch/arm/acpi/domain_build.c @@ -40,20 +40,17 @@ static int __init acpi_iomem_deny_access(struct domain = *d) =20 /* TODO: Deny MMIO access for SMMU, GIC ITS */ status =3D acpi_get_table(ACPI_SIG_SPCR, 0, - (struct acpi_table_header **)&spcr); - - if ( ACPI_FAILURE(status) ) + (struct acpi_table_header **)&spcr); + /* SPCR may not set when the UEFI uses graphical console. */ + if ( ACPI_SUCCESS(status) ) { - printk("Failed to get SPCR table\n"); - return -EINVAL; + mfn =3D spcr->serial_port.address >> PAGE_SHIFT; + /* Deny MMIO access for UART */ + rc =3D iomem_deny_access(d, mfn, mfn + 1); + if ( rc ) + return rc; } =20 - mfn =3D spcr->serial_port.address >> PAGE_SHIFT; - /* Deny MMIO access for UART */ - rc =3D iomem_deny_access(d, mfn, mfn + 1); - if ( rc ) - return rc; - /* Deny MMIO access for GIC regions */ return gic_iomem_deny_access(d); }