x86_64: Fix off by one in e820_mapped
PATCH 1/1 x86_64: Fix off by one in e820_mapped
This allows a valid iommu placed immediately after memory to work, to be recognized as after the last byte of memory and not overlapping it.
Signed-off-by Eric W. Biederman <[email protected]>
---
arch/x86_64/kernel/e820.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
a0929b87b8d0d059a10eb3e61da3d679d64980e1
arch/x86_64/kernel/e820.c +1 -1
@@ -85,7 +85,7 @@ int __init e820_mapped(unsigned long stastruct e820entry *ei = &e820.map[i];if (type && ei->type != type)continue ; -if (ei->addr >= end || ei->addr + ei->size < start) +if (ei->addr >= end || ei->addr + ei->size <= start)continue ;return 1 ; }
Quoted 4 lines · Eric W. Biederman
This allows a valid iommu placed immediately after memory to work, to be recognized as after the last byte of memory and not overlapping it.
Looks good thanks. I see Andrew has already queued it up.
-Andi
Quoted 20 lines
Signed-off-by Eric W. Biederman <[email protected]>---
arch/x86_64/kernel/e820.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
a0929b87b8d0d059a10eb3e61da3d679d64980e1arch/x86_64/kernel/e820.c +1
-1@@ -85,7 +85,7 @@ int __init e820_mapped(unsigned long stastruct e820entry *ei = &e820.map[i];if (type && ei->type != type)continue ; -if (ei->addr >= end || ei->addr + ei->size < start) +if (ei->addr >= end || ei->addr + ei->size <= start)continue ;return 1 ; }