예제 #1
0
void my_xen_l2_entry_update(pmd_t *ptr, pmd_t val)
{
	if(aim!=xen_l2_entry_update_id || signal==0) jprobe_return();
	if(leave==1) {BUG_ON(HYPERVISOR_mmu_update(&mmuupdateop, 1, NULL, DOMID_SELF) < 0);leave=0;}
	//if((strcmp(current->comm,"xm")==0)||(strcmp(current->comm,"xend")==0)) printk("Fortune: %s\n",current->comm); else jprobe_return();
	if(time>0) --time; else {signal=0;printk("Done.\n");jprobe_return();}
	printk("Fortune: xen_l2_entry_update from %s\n",current->comm);
	printk("Fortune: pmd=0x%llx\tval=0x%llx\n",ptr->pmd,val.pmd);
	printk("Fortune: ptr real=0x%llx\n",virt_to_machine(ptr));
	mmuupdateop.ptr = virt_to_machine(ptr);
	mmuupdateop.val = pmd_val_ma(val);
	if(fault==0)
	{
		getrando(64);
		mmuupdateop.ptr ^= (1 << rando);
		printk("Fortune: change ptr to 0x%llx\n",mmuupdateop.ptr);
		leave=1;
	}
	if(fault==1)
	{
		getrando(64);
		ptr->pmd ^= (1 << rando);
		printk("Fortune: change pmd to 0x%llx\n",ptr->pmd);
		//not need to leave=1
	}
	if(fault==2)
	{
		getrando(64);
		mmuupdateop.val ^= (1 << rando);
		printk("Fortune: change val to 0x%llx\n",mmuupdateop.val);
		leave=1;
	}
	jprobe_return();
}
예제 #2
0
void xen_l2_entry_update(pmd_t *ptr, pmd_t val)
{
	mmu_update_t u;
	u.ptr = virt_to_machine(ptr);
	u.val = pmd_val_ma(val);
	BUG_ON(HYPERVISOR_mmu_update(&u, 1, NULL, DOMID_SELF) < 0);
}
예제 #3
0
void xen_set_pmd(pmd_t *ptr, pmd_t val)
{
	struct multicall_space mcs;
	struct mmu_update *u;

	preempt_disable();

	mcs = xen_mc_entry(sizeof(*u));
	u = mcs.args;
	u->ptr = virt_to_machine(ptr).maddr;
	u->val = pmd_val_ma(val);
	MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF);

	xen_mc_issue(PARAVIRT_LAZY_MMU);

	preempt_enable();
}
예제 #4
0
static void xen_set_pmd_hyper(pmd_t *ptr, pmd_t val)
{
	struct mmu_update u;

	preempt_disable();

	xen_mc_batch();

	/* ptr may be ioremapped for 64-bit pagetable setup */
	u.ptr = arbitrary_virt_to_machine(ptr).maddr;
	u.val = pmd_val_ma(val);
	xen_extend_mmu_update(&u);

	xen_mc_issue(PARAVIRT_LAZY_MMU);

	preempt_enable();
}