Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2509157imm; Mon, 24 Sep 2018 05:40:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xSnHMHu0v9phlv8sVPpgFMfJ1l3Gwjz0bHoRh0MXBuh59RqsibzjyUu4fBvKSOwE3YTrF X-Received: by 2002:a63:a44:: with SMTP id z4-v6mr1572404pgk.209.1537792816075; Mon, 24 Sep 2018 05:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792816; cv=none; d=google.com; s=arc-20160816; b=wNJvJukVtlCzXIMMYRHj8N3aBKdHbSsEkOSotkNle15Rd7rI2/iMpNaXtgij7QwdSe TH4STbyMrmTpZaFW00RxztoCfcW2WAak3ozIJyEVbfLFQJ07Z2JIbb4aryOK+mP7P2RL 1L5zTCFEX7j48GPt2EO6n+VNVb2OJqwZSPyJVdOoRyqihktJzXrcMaBKs+L0KTzVBLGZ ORKuwKdtWpT28PICMnKCssoBpwoLjp3tAyRwvu+9S9EHlK/71wQ/n4tQZNyXL0iWuKgA 8/uRGTTvTORrNZ4CdGQFNUpa3pWFxb0sgy6BHhU1VuYMVeStRIfcXjPOpagjnpIYoM9C HcjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=boCef+goQq0lz3Wiyw5eCjkjC3wzXmflEHi/SfvysCo=; b=ihPYvHTjF+DZDLp4pRMy5VZD1L5k+oEhIOHRSeKyU0z0k6KnWCEZISsS9QLLMh3mk9 6H6DwO9M57RTeJoa3h2fIG18AcHY+s2cYsSaMwp2uxh0OWcmKxy8l5+0a51tWZNheo/k hmEFsSUyCLpz6jVW+uIG3hQ0b67NN2TCdHdLQJ6dw66NcinhfYVJKsbjvU01e7Nwgf6U j8onJeDghdbwc2RPH/QGvljtmBH9YPKbC3I9dWMrNNvFrwlhiHzHo6wltAsn/unPNrGL mRjNtg4jmxPXS6tSJJ5PK1r7sRqNVCfGFc788rzUnyBkAMgPGVSB27LcK/74vbpHSDB2 Z8eg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u36-v6si6033311pga.185.2018.09.24.05.40.01; Mon, 24 Sep 2018 05:40:16 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388382AbeIXSkz (ORCPT + 99 others); Mon, 24 Sep 2018 14:40:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58784 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387955AbeIXSky (ORCPT ); Mon, 24 Sep 2018 14:40:54 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 992221092; Mon, 24 Sep 2018 12:38:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Smith , Boris Ostrovsky , Thomas Gleixner , hpa@zytor.com, xen-devel@lists.xenproject.org, jgross@suse.com Subject: [PATCH 4.18 141/235] x86/EISA: Dont probe EISA bus for Xen PV guests Date: Mon, 24 Sep 2018 13:52:07 +0200 Message-Id: <20180924113119.736886440@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Ostrovsky commit 6a92b11169a65b3f8cc512c75a252cbd0d096ba0 upstream. 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 Signed-off-by: Thomas Gleixner Cc: hpa@zytor.com Cc: xen-devel@lists.xenproject.org Cc: jgross@suse.com Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20180911195538.23289-1-boris.ostrovsky@oracle.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/eisa.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- 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;