aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/pmtimer.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/hvm/pmtimer: improving scalability of virtual time updateKeir Fraser2010-11-171-9/+25
| | | | | | | | | | | | | | | | | Mitigate the heavy contention on handle_pmt_io when running a HVM configured with many cores (e.g., 32 cores). As the virtual time of a domain must be fresh, there should be someone updating it, periodically. But it is not necessary to let a VCPU update the virtual time when another one has been updating it. Thus the update can be skipped when the VCPU finds someone else is updating the virtual time. So every time a VCPU invoke handle_pmt_io to update the current domain's virtual time, it will first try to acquire the pmtimer lock. If it succeeds, it will update the virtual time. Otherwise, it can skip the update, waits for the pmtimer lock holder to finish updating the virtual time and returns the updated time. Signed-off-by: Xiang Song <xiangsong@fudan.edu.cn> Signed-off-by: Keir Fraser <keir@xen.org>
* x86 hvm: Fixes for 22339:6fae4331d5aaKeir Fraser2010-11-011-24/+23
| | | | | | | | Primarily fix up register names in public header file for compatibility with old unmodified versions of virtual firmware and qemu-dm. Also fixes a bug in the read case of handle_evt_io(). Signed-off-by: Keir Fraser <keir@xen.org>
* x86 hvm: Introduce pmtimer_change_ioport and HVM_PARAM_ACPI_IOPORTS_LOCATIONKeir Fraser2010-10-291-2/+39
| | | | | | | | By default, Xen will handle the old ACPI IO port. But it can switch to the new one by setting the HVM_PARAM_ACPI_IOPORTS_LOCATION to 1. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Keir Fraser <keir@xen.org>
* hvm pmtimer: correct pmtimer accuracyKeir Fraser2010-09-171-2/+6
| | | | | | | | | | | | | | | | Several seconds of backward time drift per minute can be seen on a RHEL6 HVM guest by switching the clocksource to 'acpi_pm' and then running gettimeofday() in a loop. This is due to the accumulation of small inaccuracies that are caused by shifting out the lower 32 bits when pmt_update_time() computes 'tmr_val'. The patch makes sure that the lower 32 bits of the computed value are not lost. They are saved in a new field 'not_accounted' in the PMTState structure and are accounted the next time pmt_update_time() is called. From: Ulrich Obergfell <uobergfe@redhat.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Add ACPI fixed sleep buttonKeir Fraser2010-01-201-1/+12
| | | | Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
* Scattered code arrangement cleanups.Keir Fraser2009-10-071-0/+1
| | | | | | | | - remove redundant declarations - add/move prototypes to headers - move things where they belong to Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* hvm: add ACPI power button for HVMKeir Fraser2009-04-021-8/+14
| | | | | | | | | | | This patch adds the ACPI fixed hardware power button for HVM. It enables a graceful shutdown of a guest OS by direction of Dom0. (if a proper action for the power button is set inside the guest) usage: xm trigger <Domain> power Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* hvm: Build guest timers on monotonic system time.Keir Fraser2008-05-241-1/+1
| | | | | | | | | | Move hvm platform timers from underlying physical CPU TSC to Xen system time and ensure domain-wide monotonicity. TSC on many systems may skew between processors leading to 'time going backwards' messages from some guests. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 hvm: Xen interface and implementation for virtual S3Keir Fraser2008-05-201-0/+6
| | | | | | | Signed-off-by: Tian Kevin <kevin.tian@intel.com> Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Ke Liping <liping.ke@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, hvm: I/O emulation handlers return X86EMUL_* return codes.Keir Fraser2008-04-151-4/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Improve in-Xen PIO emulation to better handle string PIOKeir Fraser2008-01-121-14/+15
| | | | | instructions. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Add locking to platform timers.Keir Fraser2007-06-151-19/+41
| | | | | Handy for correctness. Signed-off-by: Keir Fraser <keir@xensource.com>
* hvm: Fix multiplication overflow in hvm/pmtimer.cKeir Fraser2007-06-151-8/+7
| | | | | | | | | | | | Too many ACPI events (SCI) are raised on hvm because of multiplication overflow. FREQUENCE_PMTIMER=3579545 (1000000000ULL << 32) / FREQUENCE_PMTIMER = 0xae9a7b1663a pmt_cycles_until_flip =~ 0x80000000 0xae9a7b1663a*0x80000000 = overflow!!! Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* [HVM] Fix commentsTim Deegan2007-03-261-1/+1
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Intercept ACPI pm-timer registersTim Deegan2007-03-261-16/+192
| | | | | | | Bring the PM1a_STS and PM1a_EN registers into Xen and use them to deliver SCI to the guest before it sees the MSB of the pm-timer change. Also correct some of the semantics of the registers. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: save pmtimer count registerTim Deegan2007-02-081-32/+41
| | | | | Also remove the repeating timer from pmtimer.c because it doesn't do anything. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Enable more than one platform timer (PIT/RTC/HPET)kfraser@localhost.localdomain2006-12-201-0/+8
| | | | | | | | | | | programmed as periodic timer and adds them to abstract layer, which keeps track of pending_intr_nr to avoid time interrupt lost and sync'ed timer with TSC. It also makes some cleanup to the time related code. Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
* [XEN] Replace hvm_setup_platform() with hvm_domain_initialise()kaf24@localhost.localdomain2006-11-051-1/+1
| | | | | | | | and extra code in hvm_vcpu_initialise(). Remove 'apic' config option -- HVM CPUs will always have an APIC (which should be set up in virtual wire mode for backward compatibility, just as in a real system). Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] Use correct types for guest physical addressesTim Deegan2006-10-311-2/+2
| | | | | | Guest physical addresses are not guaranteed to fit in either a pointer or an unsigned long int; use paddr_t for them. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Move ACPI timer to HV, which is the last platform timer in Qemu.kfraser@localhost.localdomain2006-10-251-0/+63
We found Vista polls ACPI timer very frequently (about 15 times averagely) when handling timer (RTC @ 64HZ) interrupt routine. Though the exact reason is known, it should be related to system time adjustment. When it's in Qemu, the overhead is big. After moving, Vista's idle overhead decreases dramatically from ~10% to 0.9%.=20 Another benefit is that Vista can only pass Performance rating with this patch. The root cause is that ACPI timer in Qemu isn't synchronous with other platform timer in HV, which results in Vista complains "can't measure TSC frequency". This patch changes vpit.h to vpt.h, for it not only has pit structure in it, but other platform timer's structure. Another change is moving ACPI timer and related address from acpi.h to ioreq.h, which can be shared by HV and ACPI firmware. Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>