Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1566751imm; Fri, 6 Jul 2018 02:26:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdacnGf/oW1aDeSJBADc4pE3KEld7hZYVYvTpSvsmxwDUbkr1mJ3TzqTbldHWfzel0CkgB/ X-Received: by 2002:a17:902:6193:: with SMTP id u19-v6mr9500560plj.133.1530869212037; Fri, 06 Jul 2018 02:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530869212; cv=none; d=google.com; s=arc-20160816; b=WQd6EE81uhj8a2f2aFLvJwyKvm1RH5sEqOcSPXrZINEiB0s/6J547EWUU7SFFEhWJB Wp7HVTFr7L224PR8eAKgLn69JjFYHSJQAaju+nNxtUeUBUL54d2jMUVnFctmVBntcAwW 1dyuHxUPKHerFXCv/R3vTeiTsRUFnCQPAWDEs1Q+NqmlIxgVd28qVW1ymGLfoZzbPgYS y3Fmd8yaUGlXO7Qbaum3sW1bAtO/pVc51pwOH1y46yxhZ1OFtUpkc79s2iPqi8dmYioa uO3IJSlMfkxGaAkCS5e0FMF3p0xGhr5RBJXg+3Zwl2Af7KNXUDp2Ssbbpl1+mQ1ko+eI 6a+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=taud2txUSZfDc/w4rP/NfOUU5RKrScAdTGjacKMoCw4=; b=NGbKNetz/Y+vo3aRGfyB+1d/GWACz3Dlm69UJNTtPGVG29qRuE8flOSCDL6KNdlPKl zD11HnG6Ta1ylFmRGwabrMFDvGjqRNWH18Fw7RZx6LmEgRaYdBfPjIFVsCIgmG7qFWlg hzM1YIwgbPFFnOYDZ4i8lwgh6sR8hC8zkOiE+0LJ9jfiLJVrr120ie7WLZF8gAGb8VN/ PMv3VzqJg7RxqHVEgE6V3Pr2MedRN+hxmQ4q4klxcVUqPjNLbbWQJ/yo+30q3yZyIMyE CxBA65PnwqAwPWDYP9QfZsP55yJ2G1k81OFb9SMJ2hllFy86zHW4tn/AWU4d7+l937P5 wqWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t17-v6si7147205pgv.615.2018.07.06.02.26.37; Fri, 06 Jul 2018 02:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753842AbeGFJZr (ORCPT + 99 others); Fri, 6 Jul 2018 05:25:47 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53878 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753743AbeGFJZo (ORCPT ); Fri, 6 Jul 2018 05:25:44 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fbMyX-0004hE-Kd; Fri, 06 Jul 2018 11:24:25 +0200 Date: Fri, 6 Jul 2018 11:24:25 +0200 (CEST) From: Thomas Gleixner To: Paolo Bonzini cc: Pavel Tatashin , steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org Subject: Re: [PATCH v12 04/11] kvm/x86: remove kvm memblock dependency In-Reply-To: Message-ID: References: <20180621212518.19914-1-pasha.tatashin@oracle.com> <20180621212518.19914-5-pasha.tatashin@oracle.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Jul 2018, Paolo Bonzini wrote: > On 21/06/2018 23:25, Pavel Tatashin wrote: > > KVM clock is initialized later compared to other hypervisor because it has > > dependency on memblock allocator. > > > > Lets bring it inline with other hypervisors by removing this dependency by > > using memory from BSS instead of allocating it. > > > > The benefits: > > - remove ifdef from common code > > - earlier availability of TSC. > > - remove dependency on memblock, and reduce code > > - earlier kvm sched_clock() > > > > Signed-off-by: Pavel Tatashin > > The reason for this is to avoid wasting a lot of BSS memory when KVM is > not in use. Thomas is going to send his take on this! Got it working with per cpu variables, but there is a different subtle issue with that. The pvclock data is mapped into the VDSO as well, i.e. as a full page. Right now with the linear array, which is forced to be page sized at least this only maps pvclock data or zeroed data (after the last CPU) into the VDSO. With PER CPU variables this would map arbitraty other per cpu data which happens to be in the same page into the VDSO. Not really what we want. That means to utilize PER CPU data this requires to allocate page sized pvclock data space for each CPU to prevent leaking arbitrary stuff. As this data is allocated on demand, i.e. only if kvmclock is used, this might be tolerable, but I'm not so sure. Thanks, tglx