Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp130141pxb; Fri, 15 Jan 2021 09:07:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXYxRk7KQiL6i6ZtPGHn6FJqTbF0+h4a2qI6n0xqX1ddVLy/f01c0QQDe6jaspj9UUA2LK X-Received: by 2002:a05:6402:4252:: with SMTP id g18mr10632511edb.231.1610730442951; Fri, 15 Jan 2021 09:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610730442; cv=none; d=google.com; s=arc-20160816; b=VYamZimYUkmE6no3zerA+0yEIxzcBE7vho7pf+XFr2KO1bg2OhmMCn3wSXyEuNovwk NlpypvQ1FTctaYWpkxK2FiY0Kf24N1nl8gGhaTR0809RmU2l7woGQpCqif01RO0mKRRz UX/X478hQwYfaoBBqtWLakyPG1/YRuhK17QNr61C0mp5Wu7fdNQPuISCPo5wGOWZ7eEK a4eg7xqFDSwI2HkQHeJsSwthNVBPIw5F43PNHau18pz1fpmFJ7NdNUf4BTxvWMzriNlG MrmhInk/3edN8jXpwJ4hFkEE5O8riv/IY0MIwLcevRlfZpirnn+PyaxL527nLo+0yAl+ RDQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Zy58t2euqb8521BqDJvR9qvcRwnmIJY22a/sb+UL8Zc=; b=nsysFVk/ZpY23cFG5UIvYXGySf3Y+5gpbqT/kKkwAxZRifcYqBDdi8IYmLA+Ny/1x2 6z7WY0585SkMwie2mwVEyOYaykLKCPSArbDACU0abopZaf859xTJ6ZaXKWBVyqdn6CPc lMuqCNrcSfF6anYm+b7b8Aa12nxXq6/5iq3gu10jXoIYse6DqvBhhsr+lbz/QyPBzb5O iDTz5M2fl/4PdXcKxlgoYQDqD5BNkz0j3c1t0oAfyO0INBzjYstlYfRK9gujTzIcSsrQ Pi9ivz1TGu9q1evLtZugYxeIiXg7i4ikJcin7C2Hqz7Jv7Kvv1bqBlaeVwArRMtpl7x7 jAqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ss9si4019327ejb.746.2021.01.15.09.06.54; Fri, 15 Jan 2021 09:07:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728549AbhAOREu (ORCPT + 99 others); Fri, 15 Jan 2021 12:04:50 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10664 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727973AbhAOREu (ORCPT ); Fri, 15 Jan 2021 12:04:50 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DHSDH3K0Kz15t3w; Sat, 16 Jan 2021 01:02:55 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.498.0; Sat, 16 Jan 2021 01:03:48 +0800 From: John Garry To: , , , , , , , , CC: , , , , , , John Garry Subject: [PATCH RFC 3/4] kernel/resource: Make ioport_resource.start configurable Date: Sat, 16 Jan 2021 00:58:48 +0800 Message-ID: <1610729929-188490-4-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1610729929-188490-1-git-send-email-john.garry@huawei.com> References: <1610729929-188490-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make IO space base address to be configurable through IO_SPACE_BASE. This will allow architectures which do not natively support IO ports - like arm64 - to harden against legacy ISA-based drivers which use hardcoded addresses to access IO ports. Any attempts for these drivers to request a resource region will now fail for architectures with set IO_SPACE_BASE above legacy ISA IO port region (0xffff). Signed-off-by: John Garry --- kernel/resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/resource.c b/kernel/resource.c index 3ae2f56cc79d..d191c4d796c7 100644 --- a/kernel/resource.c +++ b/kernel/resource.c @@ -29,7 +29,7 @@ struct resource ioport_resource = { .name = "PCI IO", - .start = 0, + .start = IO_SPACE_BASE, .end = IO_SPACE_LIMIT, .flags = IORESOURCE_IO, }; -- 2.26.2