lkml.org 
[lkml]   [2021]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 3/4] kernel/resource: Make ioport_resource.start configurable
Date
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
\
 
 \ /
  Last update: 2021-01-15 18:07    [W:0.061 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site