Skip to content

Commit

Permalink
x86, mm: Correct the implementation of is_untracked_pat_range()
Browse files Browse the repository at this point in the history
The semantics the PAT code expect of is_untracked_pat_range() is "is
this range completely contained inside the untracked region."  This
means that checkin 8a27138 was
technically wrong, because the implementation needlessly confusing.

The sane interface is for it to take a semiclosed range like just
about everything else (as evidenced by the sheer number of "- 1"'s
removed by that patch) so change the actual implementation to match.

Reported-by: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jack Steiner <steiner@sgi.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
LKML-Reference: <20091119202341.GA4420@sgi.com>
  • Loading branch information
H. Peter Anvin committed Dec 1, 2009
1 parent dd4377b commit ccef086
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion arch/x86/include/asm/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,13 @@ extern void e820_reserve_resources_late(void);
extern void setup_memory_map(void);
extern char *default_machine_specific_memory_setup(void);

/*
* Returns true iff the specified range [s,e) is completely contained inside
* the ISA region.
*/
static inline bool is_ISA_range(u64 s, u64 e)
{
return s >= ISA_START_ADDRESS && e < ISA_END_ADDRESS;
return s >= ISA_START_ADDRESS && e <= ISA_END_ADDRESS;
}

#endif /* __KERNEL__ */
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/kernel/apic/x2apic_uv_x.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static u64 gru_start_paddr, gru_end_paddr;

static inline bool is_GRU_range(u64 start, u64 end)
{
return start >= gru_start_paddr && end < gru_end_paddr;
return start >= gru_start_paddr && end <= gru_end_paddr;
}

static bool uv_is_untracked_pat_range(u64 start, u64 end)
Expand Down

0 comments on commit ccef086

Please sign in to comment.