x86/pvclock: add setter for pvclock_pvti_cpu0_va
Right now there is only a pvclock_pvti_cpu0_va() which is defined
on kvmclock since:
commit dac16fba6f
("x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap")
The only user of this interface so far is kvm. This commit adds a
setter function for the pvti page and moves pvclock_pvti_cpu0_va
to pvclock, which is a more generic place to have it; and would
allow other PV clocksources to use it, such as Xen.
While moving pvclock_pvti_cpu0_va into pvclock, rename also this
function to pvclock_get_pvti_cpu0_va (including its call sites)
to be symmetric with the setter (pvclock_set_pvti_cpu0_va).
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Acked-by: Andy Lutomirski <luto@kernel.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Este cometimento está contido em:

cometido por
Boris Ostrovsky

ascendente
001f60e1f6
cometimento
9f08890ab9
@@ -25,8 +25,10 @@
|
||||
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/pvclock.h>
|
||||
#include <asm/vgtod.h>
|
||||
|
||||
static u8 valid_flags __read_mostly = 0;
|
||||
static struct pvclock_vsyscall_time_info *pvti_cpu0_va __read_mostly;
|
||||
|
||||
void pvclock_set_flags(u8 flags)
|
||||
{
|
||||
@@ -144,3 +146,15 @@ void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock,
|
||||
|
||||
set_normalized_timespec(ts, now.tv_sec, now.tv_nsec);
|
||||
}
|
||||
|
||||
void pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti)
|
||||
{
|
||||
WARN_ON(vclock_was_used(VCLOCK_PVCLOCK));
|
||||
pvti_cpu0_va = pvti;
|
||||
}
|
||||
|
||||
struct pvclock_vsyscall_time_info *pvclock_get_pvti_cpu0_va(void)
|
||||
{
|
||||
return pvti_cpu0_va;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(pvclock_get_pvti_cpu0_va);
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador