34#define COND(_32, _64) _32
36#define COND(_32, _64) _64
40#define __TEST_CS64 (GDTE_AVAIL0 << 3)
52 static unsigned int count;
53 extern unsigned long restart[]
asm (
"restart");
56 panic(
"Evtchn livelock\n");
58 regs->ip =
_u(restart);
73 GDTE_SYM(0, 0xfffff, COMMON, CODE, DPL3, R, L));
90 return xtf_error(
"Error trying to remap t1 as read-only\n");
93 return xtf_error(
"Error trying to remap t2 as read-only\n");
121 COND(
"int $0x82;",
"syscall;")
126 COND(
"=b",
"=D") (tmp),
127 COND(
"=c",
"=S") (tmp),
147 " vulnerable to XSA-296\n");
150 return xtf_error(
"Error: Insufficient vcpus\n");
153 return xtf_error(
"Error: unexpected result %d\n", rc);
static void update_desc(user_desc *ptr, const user_desc new)
Helper to update a live LDT/GDT entry.
#define __page_aligned_bss
void test_main(void)
To be implemented by each test, as its entry point.
const char test_title[]
The title of the test.
user_desc gdt[NR_GDT_ENTRIES]
static long hypercall_update_va_mapping(unsigned long linear, uint64_t npte, enum XEN_UVMF flags)
void panic(const char *fmt,...)
#define IS_DEFINED(x)
Evalute whether the CONFIG_ token x is defined.
static unsigned long virt_to_gfn(const void *va)
#define _u(v)
Express an arbitrary value v as unsigned long.
intpte_t pte_from_virt(const void *va, uint64_t flags)
void xtf_error(const char *fmt,...)
Report a test error.
void xtf_success(const char *fmt,...)
Report test success.
struct vcpu_info vcpu_info[32]
uint8_t evtchn_upcall_mask
uint8_t evtchn_upcall_pending
#define GDTE_SYM(base, limit,...)
As INIT_GDTE_SYM(), but creates a user_desc object.
#define PF_SYM(...)
Create pagetable entry flags based on mnemonics.
#define VCPUOP_initialise
static unsigned int xen_pfn_to_cr3(unsigned int pfn)
#define __HYPERVISOR_vcpu_op
static xen_vcpu_guest_context_t vcpu1_ctx
static intpte_t t2[L1_PT_ENTRIES]
static intpte_t t1[L1_PT_ENTRIES]
void do_evtchn(struct cpu_regs *regs)
May be implemented by a guest to handle Event Channel upcalls.