vm: place commpage and team data near the top of user address space

Placing commpage and team user data somewhere at the top of the user accessible
virtual address space prevents these areas from conflicting with elf images
that require to be mapped at exact address (in most cases: runtime_loader).
This commit is contained in:
Pawel Dziepak 2013-04-03 22:26:07 +02:00
parent ffbf0328d2
commit f697412ff8
7 changed files with 15 additions and 10 deletions

View File

@ -25,7 +25,7 @@
#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x6fff0000
#define KERNEL_USER_DATA_BASE 0x60000000
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)

View File

@ -25,7 +25,7 @@
#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x6fff0000
#define KERNEL_USER_DATA_BASE 0x60000000
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)

View File

@ -28,7 +28,7 @@
#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x6fff0000
#define KERNEL_USER_DATA_BASE 0x60000000
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)

View File

@ -25,7 +25,7 @@
#define USER_SIZE (0x80000000 - (0x10000 + 0x100000))
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x6fff0000
#define KERNEL_USER_DATA_BASE 0x60000000
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)

View File

@ -48,7 +48,7 @@
#define USER_SIZE (0x800000000000 - 0x200000)
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x7fffefff0000
#define KERNEL_USER_DATA_BASE 0x7fffe0000000
#define USER_STACK_REGION 0x7ffff0000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)
@ -76,7 +76,7 @@
#define USER_SIZE (KERNEL_BASE - 0x10000)
#define USER_TOP (USER_BASE + (USER_SIZE - 1))
#define KERNEL_USER_DATA_BASE 0x6fff0000
#define KERNEL_USER_DATA_BASE 0x60000000
#define USER_STACK_REGION 0x70000000
#define USER_STACK_REGION_SIZE ((USER_TOP - USER_STACK_REGION) + 1)

View File

@ -54,8 +54,9 @@ get_commpage_image()
area_id
clone_commpage_area(team_id team, void** address)
{
*address = (void*)KERNEL_USER_DATA_BASE;
return vm_clone_area(team, "commpage", address,
B_RANDOMIZED_ANY_ADDRESS, B_READ_AREA | B_EXECUTE_AREA | B_KERNEL_AREA,
B_RANDOMIZED_BASE_ADDRESS, B_READ_AREA | B_EXECUTE_AREA | B_KERNEL_AREA,
REGION_PRIVATE_MAP, sCommPageArea, true);
}

View File

@ -1338,8 +1338,10 @@ create_team_user_data(Team* team, void* exactAddress = NULL)
if (exactAddress != NULL) {
address = exactAddress;
addressSpec = B_EXACT_ADDRESS;
} else
} else {
address = (void*)KERNEL_USER_DATA_BASE;
addressSpec = B_RANDOMIZED_BASE_ADDRESS;
}
status_t result = vm_reserve_address_range(team->id, &address, addressSpec,
kTeamUserDataReservedSize, RESERVED_AVOID_BASE);
@ -1351,8 +1353,10 @@ create_team_user_data(Team* team, void* exactAddress = NULL)
else
virtualRestrictions.address = address;
virtualRestrictions.address_specification = B_EXACT_ADDRESS;
} else
virtualRestrictions.address_specification = B_RANDOMIZED_ANY_ADDRESS;
} else {
virtualRestrictions.address = (void*)KERNEL_USER_DATA_BASE;
virtualRestrictions.address_specification = B_RANDOMIZED_BASE_ADDRESS;
}
physical_address_restrictions physicalRestrictions = {};
team->user_data_area = create_area_etc(team->id, "user area",