mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
x86emul: assert no duplicate mappings of stub space
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
e3f6493827
commit
ca82be5f5c
2 files changed
+6
-2
No files matched your search
@@ -19,8 +19,11 @@
|
||||
# define __OP "r" /* Operand Prefix */
|
||||
#endif
|
||||
|
||||
#define get_stub(stb) ((void *)((stb).addr = (uintptr_t)(stb).buf))
|
||||
#define put_stub(stb)
|
||||
#define get_stub(stb) ({ \
|
||||
assert(!(stb).addr); \
|
||||
(void *)((stb).addr = (uintptr_t)(stb).buf); \
|
||||
})
|
||||
#define put_stub(stb) ((stb).addr = 0)
|
||||
|
||||
bool emul_test_make_stack_executable(void)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#define get_stub(stb) ({ \
|
||||
BUILD_BUG_ON(STUB_BUF_SIZE / 2 < MAX_INST_LEN + 1); \
|
||||
ASSERT(!(stb).ptr); \
|
||||
(stb).addr = this_cpu(stubs.addr) + STUB_BUF_SIZE / 2; \
|
||||
((stb).ptr = map_domain_page(_mfn(this_cpu(stubs.mfn)))) + \
|
||||
((stb).addr & ~PAGE_MASK); \
|
||||
|
||||