BUG();
}
PTWR_PRINTK("[%c] disconnected_l1va at %p is %"PRIpte"\n",
- PTWR_PRINT_WHICH, ptep, pte.l1);
+ PTWR_PRINT_WHICH, ptep, l1e_get_intpte(pte));
l1e_remove_flags(pte, _PAGE_RW);
/* Write-protect the p.t. page in the guest page table. */
/* NB. INVLPG is a serialising instruction: flushes pending updates. */
flush_tlb_one_mask(d->domain_dirty_cpumask, l1va);
PTWR_PRINTK("[%c] disconnected_l1va at %p now %"PRIpte"\n",
- PTWR_PRINT_WHICH, ptep, pte.l1);
+ PTWR_PRINT_WHICH, ptep, trawl l1e_get_intpte(pte));
/*
* STEP 2. Validate any modified PTEs.
*/
- pl1e = d->arch.ptwr[which].pl1e;
+ pl1e = map_domain_page(l1e_get_pfn(pte));
modified = revalidate_l1(d, pl1e, d->arch.ptwr[which].page);
unmap_domain_page(pl1e);
perfc_incr_histo(wpt_updates, modified, PT_UPDATES);
{
unsigned long pfn;
struct pfn_info *page;
- l1_pgentry_t pte;
+ l1_pgentry_t *pl1e, pte;
l2_pgentry_t *pl2e, l2e;
int which, flags;
unsigned long l2_idx;
}
/* Temporarily map the L1 page, and make a copy of it. */
- d->arch.ptwr[which].pl1e = map_domain_page(pfn);
- memcpy(d->arch.ptwr[which].page,
- d->arch.ptwr[which].pl1e,
- L1_PAGETABLE_ENTRIES * sizeof(l1_pgentry_t));
-
+ pl1e = map_domain_page(pfn);
+ memcpy(d->arch.ptwr[which].page, pl1e, PAGE_SIZE);
+ unmap_domain_page(pl1e);
+
/* Finally, make the p.t. page writable by the guest OS. */
l1e_add_flags(pte, _PAGE_RW);
if ( unlikely(__put_user(pte.l1,
MEM_LOG("ptwr: Could not update pte at %p", (unsigned long *)
&linear_pg_table[l1_linear_offset(addr)]);
/* Toss the writable pagetable state and crash. */
- unmap_domain_page(d->arch.ptwr[which].pl1e);
d->arch.ptwr[which].l1va = 0;
domain_crash(d);
return 0;
unsigned long l1va;
/* Copy of the p.t. page, taken before guest is given write access. */
l1_pgentry_t *page;
- /* A temporary Xen mapping of the actual p.t. page. */
- l1_pgentry_t *pl1e;
/* Index in L2 page table where this L1 p.t. is always hooked. */
unsigned int l2_idx; /* NB. Only used for PTWR_PT_ACTIVE. */
/* Info about last ptwr update batch. */
unsigned int prev_nr_updates;
- /* Exec domain which created writable mapping. */
+ /* VCPU which created writable mapping. */
struct vcpu *vcpu;
- /* EIP of the address which took the original write fault
- used for stats collection only */
+ /* EIP of the original write fault (stats collection only). */
unsigned long eip;
};