All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>, <arnd@arndb.de>,
	<akpm@linux-foundation.org>, <xuwei5@hisilicon.com>,
	<lorenzo.pieralisi@arm.com>, <helgaas@kernel.org>,
	<jiaxun.yang@flygoat.com>, <song.bao.hua@hisilicon.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-arch@vger.kernel.org>,
	<linux-mips@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linuxarm@openeuler.org>, John Garry <john.garry@huawei.com>
Subject: [PATCH RFC 3/4] kernel/resource: Make ioport_resource.start configurable
Date: Sat, 16 Jan 2021 00:58:48 +0800	[thread overview]
Message-ID: <1610729929-188490-4-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1610729929-188490-1-git-send-email-john.garry@huawei.com>

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 <john.garry@huawei.com>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: John Garry <john.garry@huawei.com>
To: <catalin.marinas@arm.com>, <will@kernel.org>, <arnd@arndb.de>,
	<akpm@linux-foundation.org>, <xuwei5@hisilicon.com>,
	<lorenzo.pieralisi@arm.com>, <helgaas@kernel.org>,
	<jiaxun.yang@flygoat.com>,  <song.bao.hua@hisilicon.com>
Cc: linux-arch@vger.kernel.org, linux-pci@vger.kernel.org,
	John Garry <john.garry@huawei.com>,
	linuxarm@openeuler.org, linux-kernel@vger.kernel.org,
	linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 3/4] kernel/resource: Make ioport_resource.start configurable
Date: Sat, 16 Jan 2021 00:58:48 +0800	[thread overview]
Message-ID: <1610729929-188490-4-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1610729929-188490-1-git-send-email-john.garry@huawei.com>

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 <john.garry@huawei.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-01-15 17:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 16:58 [PATCH RFC 0/4] Fix arm64 crash for accessing unmapped IO port regions (reboot) John Garry
2021-01-15 16:58 ` John Garry
2021-01-15 16:58 ` [PATCH RFC 1/4] arm64: io: Introduce IO_SPACE_BASE John Garry
2021-01-15 16:58   ` John Garry
2021-01-15 16:58 ` [PATCH RFC 2/4] asm-generic/io.h: Add IO_SPACE_BASE John Garry
2021-01-15 16:58   ` John Garry
2021-01-15 16:58 ` John Garry [this message]
2021-01-15 16:58   ` [PATCH RFC 3/4] kernel/resource: Make ioport_resource.start configurable John Garry
2021-01-16  0:37   ` kernel test robot
2021-01-15 16:58 ` [PATCH RFC 4/4] logic_pio: Warn on and discard accesses to addresses below IO_SPACE_BASE John Garry
2021-01-15 16:58   ` John Garry
2021-01-15 19:16   ` kernel test robot
2021-01-15 19:43   ` kernel test robot
2021-01-18  1:59 ` [PATCH RFC 0/4] Fix arm64 crash for accessing unmapped IO port regions (reboot) Jiaxun Yang
2021-01-18  1:59   ` Jiaxun Yang
2021-01-18  9:42   ` John Garry
2021-01-18  9:42     ` John Garry
2021-01-26 15:16 ` Arnd Bergmann
2021-01-26 15:16   ` Arnd Bergmann
2021-01-26 17:56   ` John Garry
2021-01-26 17:56     ` John Garry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610729929-188490-4-git-send-email-john.garry@huawei.com \
    --to=john.garry@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=helgaas@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@openeuler.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=will@kernel.org \
    --cc=xuwei5@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.