dm: vhpet: add vHPET support

vHPET is used as a source of system timer by UEFI (e.g. OVMF).

This provides an alternative to using vPIT, which OVMF assumes is always
connected to vPIC.

This is ported from Bhyve, with a few changes:

- move to user space, using acrn_timer
- enable timers only when necessary

Origin: FreeBSD
License: BSD-3-Clause
URL: https://svnweb.freebsd.org/
commit: 326257
Purpose: Adding vHPET support.
Maintained-by: External

Tracked-On: #2319
Signed-off-by: Peter Fang <peter.fang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Peter Fang
2019-01-10 19:44:30 -08:00
committed by wenlingz
parent 0343da8c70
commit 4642269248
7 changed files with 1045 additions and 34 deletions

View File

@@ -93,7 +93,6 @@ mmio_rb_lookup(struct mmio_rb_tree *rbt, uint64_t addr,
return -1;
}
__attribute__((unused))
static int
mmio_rb_add(struct mmio_rb_tree *rbt, struct mmio_rb_range *new)
{
@@ -131,7 +130,6 @@ mmio_rb_dump(struct mmio_rb_tree *rbt)
RB_GENERATE(mmio_rb_tree, mmio_rb_range, mr_link, mmio_rb_range_compare);
__attribute__((unused))
static int
mem_read(void *ctx, int vcpu, uint64_t gpa, uint64_t *rval, int size, void *arg)
{
@@ -143,7 +141,6 @@ mem_read(void *ctx, int vcpu, uint64_t gpa, uint64_t *rval, int size, void *arg)
return error;
}
__attribute__((unused))
static int
mem_write(void *ctx, int vcpu, uint64_t gpa, uint64_t wval, int size, void *arg)
{