• [PATCH v5 0/4] x86/xen: pvclock vdso support

    From Joao Martins@21:1/5 to All on Mon Oct 2 22:50:07 2017
    Hey,

    This is take 5 for vdso for Xen. PVCLOCK_TSC_STABLE_BIT can be set starting Xen
    4.8 which is required for vdso time related calls. In order to have it on, you need to have the hypervisor clocksource be TSC e.g. with the following boot params "clocksource=tsc tsc=stable:socket".

    Series is structured as following:

    Patch 1 streamlines pvti page get/set in pvclock for both of its users
    Patch 2,3 registers the pvti page on Xen and sets it in pvclock accordingly Patch 4 adds a file to KVM/Xen maintainers for tracking pvclock ABI changes.
    [ The last one is already Acked. ]

    Changelog is in individual patches.

    Thanks,
    Joao

    Joao Martins (4):
    x86/pvclock: add setter for pvclock_pvti_cpu0_va
    x86/xen/time: set pvclock flags on xen_time_init()
    x86/xen/time: setup vcpu 0 time info page
    MAINTAINERS: xen, kvm: track pvclock-abi.h changes

    MAINTAINERS | 2 +
    arch/x86/include/asm/pvclock.h | 19 +++++----
    arch/x86/kernel/kvmclock.c | 7 +--
    arch/x86/kernel/pvclock.c | 14 ++++++
    arch/x86/xen/suspend.c | 4 ++
    arch/x86/xen/time.c | 96 ++++++++++++++++++++++++++++++++++++++++++
    arch/x86/xen/xen-ops.h | 2 +
    include/xen/interface/vcpu.h | 42 ++++++++++++++++++
    8 files changed, 171 insertions(+), 15 deletions(-)

    --
    2.11.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joao Martins@21:1/5 to All on Mon Oct 2 22:50:11 2017
    Right now there is only a pvclock_pvti_cpu0_va() which is defined
    on kvmclock since:

    commit dac16fba6fc5
    ("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.

    Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
    Acked-by: Andy Lutomirski <luto@kernel.org>
    ---
    Changes since v1:
    * Rebased: the only conflict was that I had move the export
    pvclock_pvti_cpu0_va() symbol as it is used by kvm PTP driver.
    * Do not initialize pvti_cpu0_va to NULL (checkpatch error)
    ( Comments from Andy Lutomirski )
    * Removed asm/pvclock.h 'pvclock_set_pvti_cpu0_va' definition
    for non !PARAVIRT_CLOCK to better track screwed Kconfig stuff.
    * Add his Acked-by (provided the previous adjustment was made)

    Changes since RFC:
    (Comments from Andy Lutomirski)
    * Add __init to pvclock_set_pvti_cpu0_va
    * Add WARN_ON(vclock_was_used(VCLOCK_PVCLOCK)) to
    pvclock_set_pvti_cpu0_va
    ---
    arch/x86/include/asm/pvclock.h | 19 ++++++++++---------
    arch/x86/kernel/kvmclock.c | 7 +------
    arch/x86/kernel/pvclock.c | 14 ++++++++++++++
    3 files changed, 25 insertions(+), 15 deletions(-)

    diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h index 448cfe1b48cf..6f228f90cdd7 100644
    --- a/arch/x86/include/asm/pvclock.h
    +++ b/arch/x86/include/asm/pv
  • From Joao Martins@21:1/5 to All on Mon Oct 2 22:50:12 2017
    This file defines an ABI shared between guest and hypervisor(s)
    (KVM, Xen) and as such there should be an correspondent entry in
    MAINTAINERS file. Notice that there's already a text notice at the
    top of the header file, hence this commit simply enforces it more
    explicitly and have both peers noticed when such changes happen.

    Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
    Acked-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: Paolo Bonzini <pbonzini@redhat.com>
    ---
    Changes since v4:
    * Add Paolo's Acked-by
    * Add Konrad's Reviewed-by

    Changes since v1:
    * Add Juergen's Gross Acked-by.
    ---
    MAINTAINERS | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/MAINTAINERS b/MAINTAINERS
    index 6671f375f7fc..a4834c3c377a 100644
    --- a/MAINTAINERS
    +++ b/MAINTAINERS
    @@ -7603,6 +7603,7 @@ S: Supported
    F: arch/x86/kvm/
    F: arch/x86/include/uapi/asm/kvm*
    F: arch/x86/include/asm/kvm*
    +F: arch/x86/include/asm/pvclock-abi.h
    F: arch/x86/kernel/kvm.c
    F: arch/x86/kernel/kvmclock.c

    @@ -14718,6 +14719,7 @@ F: arch/x86/xen/
    F: drivers/*/xen-*front.c
    F: drivers/xen/
    F: arch/x86/include/asm/xen/
    +F: arch/x86/include/asm/pvclock-abi.h
    F: include/xen/
    F: include/uapi/xen/
    F: Documentation/ABI/stable/sysfs-hypervisor-xen
    --
    2.11.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)