direct-io.hg

changeset 11377:7825169895d0

[XEN][POWERPC] Implement H_READ from the PAPR

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Fri Aug 25 14:34:51 2006 -0400 (2006-08-25)
parents 0caf1a74fecd
children 43ec7afa5734
files xen/arch/powerpc/papr/xlate.c
line diff
     1.1 --- a/xen/arch/powerpc/papr/xlate.c	Thu Aug 24 21:07:46 2006 -0400
     1.2 +++ b/xen/arch/powerpc/papr/xlate.c	Fri Aug 25 14:34:51 2006 -0400
     1.3 @@ -30,12 +30,6 @@
     1.4  #include <asm/papr.h>
     1.5  #include <asm/hcalls.h>
     1.6  
     1.7 -static void not_yet(struct cpu_user_regs *regs)
     1.8 -{
     1.9 -    printk("not implemented yet: 0x%lx\n", regs->gprs[3]);
    1.10 -    for (;;);
    1.11 -}
    1.12 -
    1.13  #ifdef USE_PTE_INSERT
    1.14  static inline void pte_insert(union pte volatile *pte,
    1.15          ulong vsid, ulong rpn, ulong lrpn)
    1.16 @@ -493,8 +487,42 @@ static void h_remove(struct cpu_user_reg
    1.17      pte_tlbie(&lpte, ptex);
    1.18  }
    1.19  
    1.20 +static void h_read(struct cpu_user_regs *regs)
    1.21 +{
    1.22 +    ulong flags = regs->gprs[4];
    1.23 +    ulong ptex = regs->gprs[5];
    1.24 +    struct vcpu *v = get_current();
    1.25 +    struct domain *d = v->domain;
    1.26 +    struct domain_htab *htab = &d->arch.htab;
    1.27 +    union pte volatile *pte;
    1.28 +
    1.29 +	if (flags & H_READ_4)
    1.30 +        ptex &= ~0x3UL;
    1.31 +
    1.32 +    if (ptex > (1UL << htab->log_num_ptes)) {
    1.33 +        regs->gprs[3] = H_Parameter;
    1.34 +        printk("%s: bad ptex: 0x%lx\n", __func__, ptex);
    1.35 +        return;
    1.36 +    }
    1.37 +    pte = &htab->map[ptex];
    1.38 +    regs->gprs[4] = pte[0].words.vsid;
    1.39 +    regs->gprs[5] = pte[0].words.rpn;
    1.40 +
    1.41 +    if (!(flags & H_READ_4)) {
    1.42 +        /* dump another 3 PTEs */
    1.43 +        regs->gprs[6] = pte[1].words.vsid;
    1.44 +        regs->gprs[7] = pte[1].words.rpn;
    1.45 +        regs->gprs[8] = pte[2].words.vsid;
    1.46 +        regs->gprs[9] = pte[2].words.rpn;
    1.47 +        regs->gprs[10] = pte[3].words.vsid;
    1.48 +        regs->gprs[11] = pte[3].words.rpn;
    1.49 +    }
    1.50 +
    1.51 +    regs->gprs[3] = H_Success;
    1.52 +}
    1.53 +
    1.54  __init_papr_hcall(H_ENTER, h_enter);
    1.55 -__init_papr_hcall(H_READ, not_yet);
    1.56 +__init_papr_hcall(H_READ, h_read);
    1.57  __init_papr_hcall(H_REMOVE, h_remove);
    1.58  __init_papr_hcall(H_CLEAR_MOD, h_clear_mod);
    1.59  __init_papr_hcall(H_CLEAR_REF, h_clear_ref);