mirror of
https://review.haiku-os.org/haiku
synced 2025-02-01 03:06:08 +01:00
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:
parent
ffbf0328d2
commit
f697412ff8
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user