Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4502224imm; Tue, 11 Sep 2018 12:56:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ3fbAg3x7ViUvQ5li56PUeUS1CXtwIkyreSRi8nMhlrIkZgPKOzPkP0443rQGeonNaf7xi X-Received: by 2002:a63:2022:: with SMTP id g34-v6mr30714012pgg.235.1536695769776; Tue, 11 Sep 2018 12:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536695769; cv=none; d=google.com; s=arc-20160816; b=0ISvDmykyYcAxMEfS3NqrldXkTJCL9hZwrvaD52UeR86HWPaTY9cX8BAujSgAsLH5Q MH+PbxNClQIFuPFq0CuFU7NFkwi0T/H1atlBrVGUnKjpRP1fpYiK4zcZk/X3wGPgCq/6 HnV4pJ/hjaotIaRuFgdHcsroV9nSD6AiZI2c2iz9OGyNlZuvcsBeLwK0H2eeZHmMLjhs zlTnH/gZB2RWxiXVss9WtYDVsUo5D9/tQKrwShW5d+w/NOdbzJ80inZLPAKDZEIERsp4 fIw7gFZeuRklf9c0f8SMs9iEKwOcJ6w1t5bxbQuWMle8SS5lE6iGWZUNtQfo0+8mWPAH pcGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=yIwNgiKIZVqMhXkKWE4vmAFplcPMQ8sJVGtYgxV8ctA=; b=jhnGLiCUcJHS43dCLU9F1Ox0DgHwruNovKbpbJJWsNWFpZWQE6pEucR9IJRpVpoY+5 Umh8RNuK/7WxalD1sMmdsq2CsWIam8lbAJroV4AYkKW5iN0X7B+YOd3zl/aviB9msMjp 2iAU1MUJnRM1HERAxr+HRZPv6n8nQWZXGgXx6CBtma8Q7W10Nc5V5UoDN6os/msttLtT ILaXOkPMxPw/ZxVNmaIjxGoB5XCSBC+PVX0d4Rd9BPASv+2BjlZvkgE09obMw6TTFOcG n1GjiWRXHXP/ycv3jdh6GKYfUtaa2q2TZPMaMsGSVyP2jQE66GxjrNCwKJKwO09D6JAs xsyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=AQ9Q4pLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d8-v6si22455399pgn.382.2018.09.11.12.55.41; Tue, 11 Sep 2018 12:56:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=AQ9Q4pLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbeILA4W (ORCPT + 99 others); Tue, 11 Sep 2018 20:56:22 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:52502 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeILA4W (ORCPT ); Tue, 11 Sep 2018 20:56:22 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8BJmqqV034405; Tue, 11 Sep 2018 19:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=yIwNgiKIZVqMhXkKWE4vmAFplcPMQ8sJVGtYgxV8ctA=; b=AQ9Q4pLU39ZpptEZFYEZ8nfW1jszgnQvn08DQHWbSsf9Pj0y3SRzcWQ4jRsoaISTy353 6K92WMDy7cbUagMvd3uvOwZvGRxSH4nZJgJfDEd5Uq17zfmDwaw2STURbBp39xpdDQIM P9aP6Lyl0NUUmmu0Sd0za+U3e2d7Nk7wBL7bOnCMbqllrYzFI1PCJK5VKYXFSyJns5gt PLS6l9OLXcK/dvolVS5fygjon6s4NIwj/7p3RWocjrM5XfOeTVORESkXZeOENq9Bjx8p STZ805DiK8NTkm2MpGOn+g6fEscNuiRNMM163/dR2ioocy8zo9rFbHQh7QN9iklp8EPq 1Q== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2mc5utee7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Sep 2018 19:54:51 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w8BJsoaC031893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Sep 2018 19:54:50 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8BJsnK9022788; Tue, 11 Sep 2018 19:54:49 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 11 Sep 2018 12:54:49 -0700 From: Boris Ostrovsky To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, jgross@suse.com, andy@strugglers.net, Boris Ostrovsky Subject: [PATCH] x86/EISA: Don't probe EISA bus for Xen PV guests Date: Tue, 11 Sep 2018 15:55:38 -0400 Message-Id: <20180911195538.23289-1-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9013 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=661 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809110195 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For unprivileged Xen PV guests this is normal memory and ioremap will not be able to properly map it. While at it, since ioremap may return NULL, add a test for pointer's validity. Reported-by: Andy Smith Signed-off-by: Boris Ostrovsky --- arch/x86/kernel/eisa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/eisa.c b/arch/x86/kernel/eisa.c index f260e452e4f8..fcf3de1712c8 100644 --- a/arch/x86/kernel/eisa.c +++ b/arch/x86/kernel/eisa.c @@ -7,11 +7,17 @@ #include #include +#include + static __init int eisa_bus_probe(void) { - void __iomem *p = ioremap(0x0FFFD9, 4); + void __iomem *p; + + if (xen_pv_domain() && !xen_initial_domain()) + return 0; - if (readl(p) == 'E' + ('I'<<8) + ('S'<<16) + ('A'<<24)) + p = ioremap(0x0FFFD9, 4); + if (p && readl(p) == 'E' + ('I'<<8) + ('S'<<16) + ('A'<<24)) EISA_bus = 1; iounmap(p); return 0; -- 2.17.1