Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion xen/arch/x86/intel_txt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,29 @@ static int __init reserve_e820(struct e820map *e820, uint64_t s, uint64_t e)
{
uint64_t rs = e820->map[i].addr;
uint64_t re = rs + e820->map[i].size;

/* The entry includes the range. */
if ( s >= rs && e <= re )
break;

/* The entry intersects the range. */
if ( e > rs && s < re )
{
/* Fatal failure. */
return 0;
}
}

if ( i != e820->nr_map && e820->map[i].type == E820_RESERVED )
/*
* If the range is not included by any entry and no entry intersects it,
* then it's not listed in the memory map. Consider this case as a success
* since we're only preventing RAM from being used and unlisted range should
* not be used.
*/
if ( i == e820->nr_map )
return 1;

if ( e820->map[i].type == E820_RESERVED )
{
/* Nothing to do, the range is already covered as reserved. */
return 1;
Expand Down
Loading