[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 55/66] pseries: Implement h_read hcall
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 55/66] pseries: Implement h_read hcall |
Date: |
Fri, 8 Mar 2013 21:06:57 +0100 |
From: Erlon Cruz <address@hidden>
This h_call is useful for DLPAR in future amongst other things. Given an index
it fetches the corresponding PTE stored in the htab.
Signed-off-by: Erlon Cruz <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/spapr_hcall.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c
index 7b89594..77c052f 100644
--- a/hw/spapr_hcall.c
+++ b/hw/spapr_hcall.c
@@ -323,6 +323,36 @@ static target_ulong h_protect(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
return H_SUCCESS;
}
+static target_ulong h_read(PowerPCCPU *cpu, sPAPREnvironment *spapr,
+ target_ulong opcode, target_ulong *args)
+{
+ CPUPPCState *env = &cpu->env;
+ target_ulong flags = args[0];
+ target_ulong pte_index = args[1];
+ uint8_t *hpte;
+ int i, ridx, n_entries = 1;
+
+ if ((pte_index * HASH_PTE_SIZE_64) & ~env->htab_mask) {
+ return H_PARAMETER;
+ }
+
+ if (flags & H_READ_4) {
+ /* Clear the two low order bits */
+ pte_index &= ~(3ULL);
+ n_entries = 4;
+ }
+
+ hpte = env->external_htab + (pte_index * HASH_PTE_SIZE_64);
+
+ for (i = 0, ridx = 0; i < n_entries; i++) {
+ args[ridx++] = ldq_p(hpte);
+ args[ridx++] = ldq_p(hpte + (HASH_PTE_SIZE_64/2));
+ hpte += HASH_PTE_SIZE_64;
+ }
+
+ return H_SUCCESS;
+}
+
static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
@@ -710,6 +740,7 @@ static void hypercall_register_types(void)
spapr_register_hypercall(H_ENTER, h_enter);
spapr_register_hypercall(H_REMOVE, h_remove);
spapr_register_hypercall(H_PROTECT, h_protect);
+ spapr_register_hypercall(H_READ, h_read);
/* hcall-bulk */
spapr_register_hypercall(H_BULK_REMOVE, h_bulk_remove);
--
1.6.0.2
- [Qemu-ppc] [PATCH 35/66] target-ppc: Extract MPC82xx aliases to *_HiP4, (continued)
- [Qemu-ppc] [PATCH 35/66] target-ppc: Extract MPC82xx aliases to *_HiP4, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 54/66] target-ppc: Change "POWER7" CPU alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 59/66] target-ppc: Fix PPC_DUMP_SPR_ACCESS build, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 43/66] target-ppc: Get model name from type name, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 28/66] target-ppc: Extract MPC85xx aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 37/66] target-ppc: Extract MPC52xx alias, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 36/66] target-ppc: Extract MPC82xx_HiP{3, 4} aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 34/66] target-ppc: Extract MPC8247/MPC8248/MPC8270-80 aliases, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 61/66] PPC: xnu kernel expects FLUSH to be cleared on STOP, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 53/66] target-ppc: Fix remaining microcontroller typos among models, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 55/66] pseries: Implement h_read hcall,
Alexander Graf <=
- [Qemu-ppc] [PATCH 44/66] target-ppc: Convert CPU definitions, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 63/66] target-ppc: List alias names alongside CPU models, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 56/66] Save memory allocation in the elf loader, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 60/66] PPC: Fix dma interrupt, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 51/66] target-ppc: Update Coding Style for CPU models, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 64/66] target-ppc: Report CPU aliases for QMP, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 58/66] target-ppc: Synchronize FPU state with KVM, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 62/66] target-ppc: Make host CPU a subclass of the host's CPU model, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 57/66] target-ppc: Add mechanism for synchronizing SPRs with KVM, Alexander Graf, 2013/03/08
- [Qemu-ppc] [PATCH 65/66] target-ppc: Move CPU aliases out of translate_init.c, Alexander Graf, 2013/03/08