• Thomas Gleixner's avatar
    x86/kvmclock: Switch kvmclock data to a PER_CPU variable · 95a3d445
    Thomas Gleixner authored
    The previous removal of the memblock dependency from kvmclock introduced a
    static data array sized 64bytes * CONFIG_NR_CPUS. That's wasteful on large
    systems when kvmclock is not used.
    
    Replace it with:
    
     - A static page sized array of pvclock data. It's page sized because the
       pvclock data of the boot cpu is mapped into the VDSO so otherwise random
       other data would be exposed to the vDSO
    
     - A PER_CPU variable of pvclock data pointers. This is used to access the
       pcvlock data storage on each CPU.
    
    The setup is done in two stages:
    
     - Early boot stores the pointer to the static page for the boot CPU in
       the per cpu data.
    
     - In the preparatory stage of CPU hotplug assign either an element of
       the static array (when the CPU number is in that range) or allocate
       memory and initialize the per cpu pointer.
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarPavel Tatashin <pasha.tatashin@oracle.com>
    Acked-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Cc: steven.sistare@oracle.com
    Cc: daniel.m.jordan@oracle.com
    Cc: linux@armlinux.org.uk
    Cc: schwidefsky@de.ibm.com
    Cc: heiko.carstens@de.ibm.com
    Cc: john.stultz@linaro.org
    Cc: sboyd@codeaurora.org
    Cc: hpa@zytor.com
    Cc: douly.fnst@cn.fujitsu.com
    Cc: peterz@infradead.org
    Cc: prarit@redhat.com
    Cc: feng.tang@intel.com
    Cc: pmladek@suse.com
    Cc: gnomes@lxorguk.ukuu.org.uk
    Cc: linux-s390@vger.kernel.org
    Cc: boris.ostrovsky@oracle.com
    Cc: jgross@suse.com
    Link: https://lkml.kernel.org/r/20180719205545.16512-8-pasha.tatashin@oracle.com
    95a3d445
kvmclock.c 8.7 KB