From patchwork Wed Oct 31 23:49:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Orr X-Patchwork-Id: 10663351 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2D9313A4 for ; Wed, 31 Oct 2018 23:49:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BACF2B943 for ; Wed, 31 Oct 2018 23:49:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FC912B9C2; Wed, 31 Oct 2018 23:49:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A7C02B943 for ; Wed, 31 Oct 2018 23:49:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8C94D6B0003; Wed, 31 Oct 2018 19:49:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8521C6B0006; Wed, 31 Oct 2018 19:49:35 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F54D6B0007; Wed, 31 Oct 2018 19:49:35 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) by kanga.kvack.org (Postfix) with ESMTP id 3B9606B0003 for ; Wed, 31 Oct 2018 19:49:35 -0400 (EDT) Received: by mail-vk1-f198.google.com with SMTP id r75-v6so7693185vkr.1 for ; Wed, 31 Oct 2018 16:49:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:message-id:mime-version :subject:from:to:cc; bh=XnfpiSjCoslNzkt1ldoNWZRtbtSQKFCPHpDUd4JPQeI=; b=lCROgcHz9632CrWxy6ZHUUKkevgujqvuprFpwfBPWMQEh1IgJdKB7r/vrEenvQ6ZX8 8/gekzCYu029Q5sS4NVBYCcS7F+Ql1oRXcrBiT7kWrnviTlstM3JldfE02gu7rwaUjiR 23lk40yi1RHtoUw7lY9Pi74XCUMM+WOGA0YpkAQ57SJL5yYiWUAY7uN7ZrWNT2nTrT/f alx4A68DkqXZ8qtmA4Qko7S/exxTauIk8P5bqvnbMZdB2yAE9btnzugn0ews0P01NP0k fxM1036aM7MeP77zKW+of+y8Sdgll8DgaDWaZ2lHZLQZMufR4oWNi0tQIRTipENIPkhm 3HeA== X-Gm-Message-State: AGRZ1gKIN8VVcoeXofO2ZZzeTI7mjnbTvqsNOUb3RnChlGX+pYY5H4YF oGhNRCoS3nfjFgZpwMmDOn3Gg+NnlaxMDcUi+3NSBJRIz6STvYdIutFkJPbRRJv0LHCRpytZfE9 zoLtOJZJIIy37rox89xAphSkvWUHfFga+pNRv+PpyDh1dAh+qJe0DqTlhwryB0FmttFt05w7Rjh tO6Nq4CufsdjSLjo2Sd27iJM1zEsBNBSIAXV7pNwoCXeUFcP/FlHh2G5usfev4qNJ/oOAkeObnZ kDwio7xt7nJDzWokQ1+DncEY+yqD9VyQRhRmUVWV/dbZ7UaBb3rgHBwjBo1FiNcDu4XMSCt6MKg PAE1XuNCL++WbJBLylmEVaOZAuSkUtW6JMOJo0MtYU3qGYuA3Swnn+yC5MU0Jwjzcu4qsU4uJTm c X-Received: by 2002:a67:f756:: with SMTP id w22mr753603vso.30.1541029774870; Wed, 31 Oct 2018 16:49:34 -0700 (PDT) X-Received: by 2002:a67:f756:: with SMTP id w22mr753590vso.30.1541029774222; Wed, 31 Oct 2018 16:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029774; cv=none; d=google.com; s=arc-20160816; b=yW8HfRAVxMXgn64rK178Xx3FgExCxEyEjyR42CN1FEGFiGChkEh6MgaNKMfRaGxXZb kVdWtjSaaNGTuMjgRSGzzl/MODU7uy+un+F+300dmTm5mU7FWizGgpO249aKLx/mEkww 1qH2SfTvotm5Rd7Mfhm1a3k+cD1nEeKd4bM8+5EvD9fa0i0aIuS+ekNfmxVsX2+9nc89 tr9gjAZc0I+lHXki+A8Z+EyoTvCAwrkXEmWrKn/X6KeQcXD+kp5y5j977JcmAKnH7aiY XQl3het2NGgreatLtugeKxHRiQ61uX3RxPP1kci48FFxWrLR/qddqsWCqKhzeR3zIzye u4Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:mime-version:message-id:date:dkim-signature; bh=XnfpiSjCoslNzkt1ldoNWZRtbtSQKFCPHpDUd4JPQeI=; b=tRmGtK+UR+0GEhJM/P/XZ8Qfz0e4ZTjG+YiijCt2cFl7P2peo4Y5TWqs/OMK0h/pI6 Pf/HIBde+EbNfd0iJyKqp2Hf25w57pRTYJ3jpQUA3VT2HugrhQKZz2Sjoedt0cC76HrI X5z1oESG9s0p9uS6d6fQJRGHfNPVlUcxueVV3ytpR77YiJ/NF0mm/wg+qfoE4bFw9L4p zUab7P3N8GfZj7C3K+qlODVBkRs/wAbKU5H3fzwgr/vpRP1HTUJGZlmoi2NAhT4oSWkz 4VGLmgAa5yZ2GzAatE+cifxP1rG7AxEM+zSqzh8itVXIUt837KmARCdOew1qLVouC9D1 +c0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AlWBQiaJ; spf=pass (google.com: domain of 3jt_awwckcfoe2j4gjj8gg8d6.4gedafmp-eecn24c.gj8@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=3jT_aWwcKCFoE2J4GJJ8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--marcorr.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from mail-sor-f73.google.com (mail-sor-f73.google.com. [209.85.220.73]) by mx.google.com with SMTPS id z72sor15496357vsc.113.2018.10.31.16.49.34 for (Google Transport Security); Wed, 31 Oct 2018 16:49:34 -0700 (PDT) Received-SPF: pass (google.com: domain of 3jt_awwckcfoe2j4gjj8gg8d6.4gedafmp-eecn24c.gj8@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) client-ip=209.85.220.73; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=AlWBQiaJ; spf=pass (google.com: domain of 3jt_awwckcfoe2j4gjj8gg8d6.4gedafmp-eecn24c.gj8@flex--marcorr.bounces.google.com designates 209.85.220.73 as permitted sender) smtp.mailfrom=3jT_aWwcKCFoE2J4GJJ8GG8D6.4GEDAFMP-EECN24C.GJ8@flex--marcorr.bounces.google.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=XnfpiSjCoslNzkt1ldoNWZRtbtSQKFCPHpDUd4JPQeI=; b=AlWBQiaJxFguhnPbbMhQTcDIFXYR29tzgDuyMzREa0+m+S3LsubkBa8dE1r2I+lEbf NqdKmAgg6W8KzranZ2K7zog2c9r0f2po4jAlYyZWPuebYAhd7wsfb5ge7EUDjlUBO0B/ 7vXK1t/ADf/DSm/3oGqF9mDSsToLqcjFplQXzNH+yaVESiBpS/TxNrPdbRpfPd15/BS8 H6Vq99tUmK8xHL+oMJ8PbHOmnm4cPTUMJFuUNa52DpyDs6XsJ7aTha5EoGLYHBOA0dcg WRdK95HhpRM+xt0AK/i1DNTuscpU36NAt3NtB0QTot2pTNi+P7b0QlDiYQr/hB8YcRKw jCYg== X-Google-Smtp-Source: AJdET5fQ6HQd1XsMVAIJ5Bubq7tH5zWQDD5dEGAi/77Dto/FkzqWBKbvyKE2r1lJ1gtyE+DZ8Hj+hCN1TmB2 X-Received: by 2002:a67:ea05:: with SMTP id g5mr4611597vso.29.1541029773824; Wed, 31 Oct 2018 16:49:33 -0700 (PDT) Date: Wed, 31 Oct 2018 16:49:26 -0700 Message-Id: <20181031234928.144206-1-marcorr@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog Subject: [kvm PATCH v6 0/2] shrink vcpu_vmx down to order 2 From: Marc Orr To: kvm@vger.kernel.org, jmattson@google.com, rientjes@google.com, konrad.wilk@oracle.com, linux-mm@kvack.org, akpm@linux-foundation.org, pbonzini@redhat.com, rkrcmar@redhat.com, willy@infradead.org, sean.j.christopherson@intel.com, dave.hansen@linux.intel.com, kernellwp@gmail.com Cc: Marc Orr X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Compared to the last version, I've: (1) dropped the vmalloc patches (2) updated the kmem cache for the guest_fpu field in the kvm_vcpu_arch struct to be sized according to fpu_kernel_xstate_size (3) Added minimum FPU checks in KVM's x86 init logic to avoid memory corruption issues. Marc Orr (2): kvm: x86: Use task structs fpu field for user kvm: x86: Dynamically allocate guest_fpu arch/x86/include/asm/kvm_host.h | 10 +++--- arch/x86/kvm/svm.c | 10 ++++++ arch/x86/kvm/vmx.c | 10 ++++++ arch/x86/kvm/x86.c | 55 ++++++++++++++++++++++++--------- 4 files changed, 65 insertions(+), 20 deletions(-)