• Vitaly Kuznetsov's avatar
    x86/hyperv: Don't use percpu areas for pcpu_flush/pcpu_flush_ex structures · 60d73a7c
    Vitaly Kuznetsov authored
    hv_do_hypercall() does virt_to_phys() translation and with some configs
    (CONFIG_SLAB) this doesn't work for percpu areas, we pass wrong memory to
    hypervisor and get #GP. We could use working slow_virt_to_phys() instead
    but doing so kills the performance.
    
    Move pcpu_flush/pcpu_flush_ex structures out of percpu areas and
    allocate memory on first call. The additional level of indirection gives
    us a small performance penalty, in future we may consider introducing
    hypercall functions which avoid virt_to_phys() conversion and cache
    physical addresses of pcpu_flush/pcpu_flush_ex structures somewhere.
    Reported-by: default avatarSimon Xiao <sixiao@microsoft.com>
    Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
    Cc: Dexuan Cui <decui@microsoft.com>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Cc: Jork Loeser <Jork.Loeser@microsoft.com>
    Cc: K. Y. Srinivasan <kys@microsoft.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephen Hemminger <sthemmin@microsoft.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: devel@linuxdriverproject.org
    Link: http://lkml.kernel.org/r/20171005113924.28021-1-vkuznets@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    60d73a7c
mmu.c 7.36 KB