From patchwork Mon Sep 28 12:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 366118 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp467218jam; Mon, 18 Jan 2021 22:20:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxF0n2upjyD6omMiuqLyy6CLFpRfuG+tCmh2oCUObva9Ada7iv7z7+UITA+zsCHVxRO18sn X-Received: by 2002:a25:7544:: with SMTP id q65mr3646419ybc.200.1611037251099; Mon, 18 Jan 2021 22:20:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611037251; cv=none; d=google.com; s=arc-20160816; b=E91cXG8cmqY5p5A5RBRdJFiWggI1oc8N5+G+Hvr4PyVC//aMvmgeY4rwrMAaC1aap5 YkALOUkk5k66Vm3MdeUyYROa/4IhW2N3jW5Ni+zPaPUblkmZPXTiyuRDo83xAkzXzwdl 0GyTfKiMKJBr2gYOuddoBkmVcpywn4UIv6SsMu2yRr0TdCbqiJmVuVkwXpp2fRSVUKnh /mno4r8wLyHCyn06CZRMo8hUMTX5FRYREBS17voZB2wwdKDyX56uR5r1bbx8ubOQ5ak3 7gfnIuLlfkOtpf31k940hPZIoT2W8eLtPoSZvlzHCKYYHp9nJyhmTIcJ8k6QH/nmHQSI V5Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:references:in-reply-to:message-id:date:subject:cc:to :from:sender:precedence:errors-to:list-subscribe:list-help:list-post :list-unsubscribe:list-id; bh=WH6te05gL8DAiwOiG8nnjyFwXXhtkjUzRiAMuUsF1bU=; b=EMFOfWxY7Do+smcbQP683d9ni88HXWBkP8ce/4SRUhC4SRSpQ+ZsK8se4R0UhMTGUT 80H5OIoxqMkb7J8upHHxrZyImo3gvyNCWuSSLXYPTOydt3dOi4nfjHaYna4r6fszT7kn 4npwVV0Qa0L4QEjqNq+mfntdrhI+eRGg5XY5Q+SWmm31wa4jOaW2C0m++cKHqmAStKBT gFqkgBG2GF6Pc1xr7FnlndUvhw6rLbCDgUhfvYYQpOnRGWISL5kXrbEYZ/xi40fKWVBi C0CLrv2WKuyuJk94yCwF1Kn16+a/1qAs6o6ITGTBv/EuxMSjpKRYQKCL1rLQbybkArDh XBBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id n2si19136548ybo.259.2021.01.18.22.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 22:20:51 -0800 (PST) Received-SPF: pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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_Pau_Monn=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 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_build.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) /* TODO: Deny MMIO access for SMMU, GIC ITS */ status = 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 = spcr->serial_port.address >> PAGE_SHIFT; + /* Deny MMIO access for UART */ + rc = iomem_deny_access(d, mfn, mfn + 1); + if ( rc ) + return rc; } - mfn = spcr->serial_port.address >> PAGE_SHIFT; - /* Deny MMIO access for UART */ - rc = iomem_deny_access(d, mfn, mfn + 1); - if ( rc ) - return rc; - /* Deny MMIO access for GIC regions */ return gic_iomem_deny_access(d); }