[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 35/64] PPC: SPAPR: Use KVM function for time info
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 35/64] PPC: SPAPR: Use KVM function for time info |
Date: |
Thu, 6 Oct 2011 10:05:37 +0200 |
One of the things we can't fake on PPC is the timer speed. So
we need to extract the frequency information from the host and
put it back into the guest device tree.
Luckily, we already have functions for that from the non-pseries
targets, so all we need to do is to connect the dots and the guest
suddenly gets to know its real timer speeds.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/spapr.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/spapr.c b/hw/spapr.c
index c5c9a95..760e323 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -140,6 +140,8 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
char *nodename;
uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40),
0xffffffff, 0xffffffff};
+ uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TIMEBASE_FREQ;
+ uint32_t cpufreq = kvm_enabled() ? kvmppc_get_clockfreq() : 1000000000;
if (asprintf(&nodename, "address@hidden", modelname, index) < 0) {
fprintf(stderr, "Allocation failure\n");
@@ -158,10 +160,8 @@ static void *spapr_create_fdt_skel(const char *cpu_model,
env->dcache_line_size)));
_FDT((fdt_property_cell(fdt, "icache-block-size",
env->icache_line_size)));
- _FDT((fdt_property_cell(fdt, "timebase-frequency", TIMEBASE_FREQ)));
- /* Hardcode CPU frequency for now. It's kind of arbitrary on
- * full emu, for kvm we should copy it from the host */
- _FDT((fdt_property_cell(fdt, "clock-frequency", 1000000000)));
+ _FDT((fdt_property_cell(fdt, "timebase-frequency", tbfreq)));
+ _FDT((fdt_property_cell(fdt, "clock-frequency", cpufreq)));
_FDT((fdt_property_cell(fdt, "ibm,slb-size", env->slb_nr)));
_FDT((fdt_property(fdt, "ibm,pft-size",
pft_size_prop, sizeof(pft_size_prop))));
--
1.6.0.2
- [Qemu-devel] [PATCH 22/64] PPC: E500: Update freqs for all CPUs, (continued)
- [Qemu-devel] [PATCH 22/64] PPC: E500: Update freqs for all CPUs, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 20/64] PPC: KVM: Remove kvmppc_read_host_property, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 28/64] device tree: give dt more size, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 32/64] PPC: Add new target config for pseries, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 16/64] PPC: KVM: Add generic function to read host clockfreq, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 07/64] PPC: Fix IPI support in MPIC, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 30/64] MPC8544DS: Generate CPU nodes on init, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 01/64] spapr: proper qdevification, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 17/64] PPC: E500: Use generic kvm function for freq, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 25/64] PPC: E500: Update cpu-release-addr property in cpu nodes, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 35/64] PPC: SPAPR: Use KVM function for time info,
Alexander Graf <=
- [Qemu-devel] [PATCH 29/64] MPC8544DS: Remove CPU nodes, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 21/64] PPC: KVM: Add stubs for kvm helper functions, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 38/64] pseries: interrupt controller should not have a 'reg' property, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 09/64] PPC: MPIC: Remove read functionality for WO registers, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 31/64] PPC: E500: Bump CPU count to 15, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 23/64] PPC: E500: Remove unneeded CPU nodes, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 24/64] PPC: E500: Add PV spinning code, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 33/64] KVM: update kernel headers, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 36/64] pseries: Bugfixes for interrupt numbering in XICS code, Alexander Graf, 2011/10/06
- [Qemu-devel] [PATCH 40/64] PPC: Fix sync instructions problem in SMP, Alexander Graf, 2011/10/06