[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/38] PPC: Introduce the Virtual Time Base (VTB) SPR
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 35/38] PPC: Introduce the Virtual Time Base (VTB) SPR register |
Date: |
Sun, 8 Mar 2015 09:44:54 +0100 |
From: Cyril Bur <address@hidden>
This patch adds basic support for the VTB.
PowerISA:
The Virtual Time Base (VTB) is a 64-bit incrementing counter.
Virtual Time Base increments at the same rate as the Time Base until its value
becomes 0xFFFF_FFFF_FFFF_FFFF (2 64 - 1); at the next increment its value
becomes 0x0000_0000_0000_0000. There is no interrupt or other indication when
this occurs.
The operation of the Virtual Time Base has the following additional
properties.
1. Loading a GPR from the Virtual Time Base has no effect on the accuracy of
the Virtual Time Base.
2. Copying the contents of a GPR to the Virtual Time Base replaces the
contents of the Virtual Time Base with the contents of the GPR.
Signed-off-by: Cyril Bur <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
target-ppc/cpu.h | 1 +
target-ppc/translate_init.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index b706b9f..abc3545 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1624,6 +1624,7 @@ static inline int cpu_mmu_index (CPUPPCState *env)
#define SPR_MPC_MD_DBRAM1 (0x32A)
#define SPR_RCPU_L2U_RA3 (0x32B)
#define SPR_TAR (0x32F)
+#define SPR_VTB (0x351)
#define SPR_440_INV0 (0x370)
#define SPR_440_INV1 (0x371)
#define SPR_440_INV2 (0x372)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index df1a62c..d74f4f0 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -7819,6 +7819,15 @@ static void gen_spr_power8_ebb(CPUPPCState *env)
KVM_REG_PPC_BESCR, 0x00000000);
}
+/* Virtual Time Base */
+static void gen_spr_vtb(CPUPPCState *env)
+{
+ spr_register(env, SPR_VTB, "VTB",
+ SPR_NOACCESS, SPR_NOACCESS,
+ &spr_read_tbl, SPR_NOACCESS,
+ 0x00000000);
+}
+
static void gen_spr_power8_fscr(CPUPPCState *env)
{
#if defined(CONFIG_USER_ONLY)
@@ -7881,6 +7890,7 @@ static void init_proc_book3s_64(CPUPPCState *env, int
version)
gen_spr_power8_pmu_sup(env);
gen_spr_power8_pmu_user(env);
gen_spr_power8_tm(env);
+ gen_spr_vtb(env);
}
if (version < BOOK3S_CPU_POWER8) {
gen_spr_book3s_dbg(env);
--
1.8.1.4
- [Qemu-devel] [PULL 11/38] pseries: Make RTAS time of day functions respect -rtc options, (continued)
- [Qemu-devel] [PULL 11/38] pseries: Make RTAS time of day functions respect -rtc options, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 20/38] display cpu id dump state, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 04/38] spapr: Add pseries-2.3 machine, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 08/38] pseries: Move sPAPR RTC code into its own file, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 31/38] Revert "default-configs/ppc64: add all components of i82378 SuperIO chip used by prep", Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 32/38] ppc64-softmmu: Remove unsupported FDC from config, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 28/38] openpic: switch IRQQueue queue from inline to bitmap, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 21/38] macio.c: include parent PCIDevice state in VMStateDescription, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 12/38] pseries: Make the PAPR RTC a qdev device, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 18/38] pseries: Switch VGA endian on H_SET_MODE, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 35/38] PPC: Introduce the Virtual Time Base (VTB) SPR register,
Alexander Graf <=
- [Qemu-devel] [PULL 07/38] Add more VMSTATE_*_TEST variants for integers, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 19/38] Openpic: check that cpu id is within the number of cpus, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 30/38] spapr_vio: Convert to realize(), Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 10/38] pseries: Add spapr_rtc_read() helper function, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 26/38] openpic: fix segfault on -M mac99 savevm, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 36/38] target-ppc: Add versions to server CPU descriptions, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 03/38] pseries: Limit PCI host bridge "index" value, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 34/38] PPC: Remove duplicate OPENPIC defines in default-configs, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 27/38] openpic: fix up loadvm under -M mac99, Alexander Graf, 2015/03/08
- [Qemu-devel] [PULL 29/38] openpic: convert to vmstate, Alexander Graf, 2015/03/08