aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>2005-06-28 20:01:51 +0000
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>2005-06-28 20:01:51 +0000
commitcbd0cf09894d2e34c4db502e61baaa15fc3f71cb (patch)
tree7f15db6638692588df2394356587eabae4c3602f
parentf76a149879dd099cad777afb9c4859632db1034f (diff)
downloadxen-cbd0cf09894d2e34c4db502e61baaa15fc3f71cb.tar.gz
xen-cbd0cf09894d2e34c4db502e61baaa15fc3f71cb.tar.bz2
xen-cbd0cf09894d2e34c4db502e61baaa15fc3f71cb.zip
bitkeeper revision 1.1726.1.8 (42c1acafTSObuXeDW7_GDxYN5dosRA)
Grant table support changes and fix cmpxchg_user Signed-off-by: Matt Chapman <matthewc@hp.com>
-rw-r--r--xen/arch/ia64/domain.c36
-rw-r--r--xen/arch/ia64/grant_table.c23
-rw-r--r--xen/include/asm-ia64/xensystem.h9
3 files changed, 58 insertions, 10 deletions
diff --git a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c
index 7bc1eec1fa..c6ead10510 100644
--- a/xen/arch/ia64/domain.c
+++ b/xen/arch/ia64/domain.c
@@ -465,10 +465,44 @@ if (unlikely(page_to_phys(p) > vhpt_paddr && page_to_phys(p) < vhpt_pend)) {
set_pte(pte, pfn_pte(page_to_phys(p) >> PAGE_SHIFT,
__pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
}
- else printk("map_new_domain_page: page %p already mapped!\n",p);
+ else printk("map_new_domain_page: mpaddr %lx already mapped!\n",mpaddr);
return p;
}
+/* map a physical address to the specified metaphysical addr */
+void map_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr)
+{
+ struct mm_struct *mm = d->arch.mm;
+ pgd_t *pgd;
+ pud_t *pud;
+ pmd_t *pmd;
+ pte_t *pte;
+
+ if (!mm->pgd) {
+ printk("map_domain_page: domain pgd must exist!\n");
+ return;
+ }
+ pgd = pgd_offset(mm,mpaddr);
+ if (pgd_none(*pgd))
+ pgd_populate(mm, pgd, pud_alloc_one(mm,mpaddr));
+
+ pud = pud_offset(pgd, mpaddr);
+ if (pud_none(*pud))
+ pud_populate(mm, pud, pmd_alloc_one(mm,mpaddr));
+
+ pmd = pmd_offset(pud, mpaddr);
+ if (pmd_none(*pmd))
+ pmd_populate_kernel(mm, pmd, pte_alloc_one_kernel(mm,mpaddr));
+// pmd_populate(mm, pmd, pte_alloc_one(mm,mpaddr));
+
+ pte = pte_offset_map(pmd, mpaddr);
+ if (pte_none(*pte)) {
+ set_pte(pte, pfn_pte(physaddr >> PAGE_SHIFT,
+ __pgprot(__DIRTY_BITS | _PAGE_PL_2 | _PAGE_AR_RWX)));
+ }
+ else printk("map_domain_page: mpaddr %lx already mapped!\n",mpaddr);
+}
+
void mpafoo(unsigned long mpaddr)
{
extern unsigned long privop_trace;
diff --git a/xen/arch/ia64/grant_table.c b/xen/arch/ia64/grant_table.c
index 9f19152749..9436347779 100644
--- a/xen/arch/ia64/grant_table.c
+++ b/xen/arch/ia64/grant_table.c
@@ -570,13 +570,13 @@ __gnttab_unmap_grant_ref(
/* Frame is now unmapped for device access. */
}
-#ifdef __ia64__
-// FIXME-ia64: any error checking need to be done here?
-#else
if ( (virt != 0) &&
(flags & GNTMAP_host_map) &&
((act->pin & (GNTPIN_hstw_mask | GNTPIN_hstr_mask)) > 0))
{
+#ifdef __ia64__
+// FIXME-ia64: any error checking need to be done here?
+#else
l1_pgentry_t *pl1e;
unsigned long _ol1e;
@@ -609,6 +609,7 @@ __gnttab_unmap_grant_ref(
rc = -EINVAL;
goto unmap_out;
}
+#endif
map->ref_and_flags &= ~GNTMAP_host_map;
@@ -627,7 +628,6 @@ __gnttab_unmap_grant_ref(
rc = 0;
*va = virt;
}
-#endif
if ( (map->ref_and_flags & (GNTMAP_device_map|GNTMAP_host_map)) == 0)
{
@@ -696,6 +696,7 @@ gnttab_setup_table(
gnttab_setup_table_t op;
struct domain *d;
int i;
+ unsigned long addr;
if ( count != 1 )
return -EINVAL;
@@ -735,10 +736,24 @@ gnttab_setup_table(
{
ASSERT(d->grant_table != NULL);
(void)put_user(GNTST_okay, &uop->status);
+#ifdef __ia64__
+ if (d == dom0) {
+ for ( i = 0; i < op.nr_frames; i++ )
+ (void)put_user(
+ (virt_to_phys(d->grant_table->shared) >> PAGE_SHIFT) + i,
+ &uop->frame_list[i]);
+ } else {
+ /* IA64 hack - need to map it somewhere */
+ addr = (1UL << 40);
+ map_domain_page(d, addr, virt_to_phys(d->grant_table->shared));
+ (void)put_user(addr >> PAGE_SHIFT, &uop->frame_list[0]);
+ }
+#else
for ( i = 0; i < op.nr_frames; i++ )
(void)put_user(
(virt_to_phys(d->grant_table->shared) >> PAGE_SHIFT) + i,
&uop->frame_list[i]);
+#endif
}
put_domain(d);
diff --git a/xen/include/asm-ia64/xensystem.h b/xen/include/asm-ia64/xensystem.h
index c1915646f2..6fadb60ebe 100644
--- a/xen/include/asm-ia64/xensystem.h
+++ b/xen/include/asm-ia64/xensystem.h
@@ -66,13 +66,12 @@ extern struct task_struct *vmx_ia64_switch_to (void *next_task);
register long __gu_r8 asm ("r8"); \
register long __gu_r9 asm ("r9"); \
asm volatile ("mov ar.ccv=%0;;" :: "rO"(old)); \
- asm volatile ("mov %2=r0;;\n" \
- "[1:]\tcmpxchg"_size".acq %0=[%3],%4,ar.ccv\n" \
- "\t.xdata4 \"__ex_table\", 1b-., 1f-.+4\n" \
+ asm volatile ("mov %1=r0;;\n" \
+ "[1:]\tcmpxchg"_size".acq %0=[%2],%3,ar.ccv\n" \
+ "\t.xdata4 \"__ex_table\", 1b-., 1f-.\n" \
"[1:]" \
- : "=r"(old), "=r"(__gu_r9), "=r"(__gu_r8) : \
+ : "=r"(old), "=r"(__gu_r8) : \
"r"(ptr), "r"(new) : "memory"); \
- (old) = __gu_r9; \
__gu_r8; \
})