Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp606372ybz; Wed, 15 Apr 2020 15:02:09 -0700 (PDT) X-Google-Smtp-Source: APiQypJI7l7IJ4U93G0TTGpKi94xBdPzjvgtJ0I3kF/jOrJ+/a+cn1EmS7AtQaI8SzknrXSCwva+ X-Received: by 2002:a50:b263:: with SMTP id o90mr25840924edd.326.1586988129687; Wed, 15 Apr 2020 15:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988129; cv=none; d=google.com; s=arc-20160816; b=OejojHMporxtISz8TtM4FQHiVI5VDk0fMuYYU0UF4ZpQ3/+jWaO8RPVTpJ7HztRhkv FQs9NWUoH6FLCZ3ZLPZYkicCXGbyXpCl43mJX6HJJLOnfsrjaFEdVFgpHipMjxGzzQfo hRz/UZtLcL9D2zwo2u9rHQcKhJpU9bBMAd2P++fcFSaUXlHyk+gc38mcAcop1BxDUlV/ kl77KRYbtSjRj4FNKgyRRFYuTKFjJuCE4EdZgNwfOoXMvc+EqRkXSqXIdV3CVawYmmAW RHq5bGHWdsjuFdhtHChf2Ku42fpDISeAD39oPxbILmaCrTkrOZaiJbf0hzxeug5UCcPS HBAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=+UiXyULlzq60JcrYizZG5xR6t3RIPIiANzzV8jZ5et4=; b=IpfDbpja4E4pw1vNrXbWjO5d9ERMBg3xJirT/l/RtyS9ygjMEEKXaHDb0TkOqBJB0y hOq/t5AKa6tcx0QyTdGaM/EQvJRDh4xorpuMaCBkke7GVEpgxtHXiLU0WDmxXtLGV2z1 ywOM0x/Wt56YL7bj7gVPELTs7Z+zCpjOs2jNjNU5uKjJnAPr/gM64JmX13q7fzCWY3BP XuCz9Cw81XWgvHq75uSV8CRu2LSV6AB9MwvC8OodKcwl83oY5cKHCDY48WmEUM10+mgd 9cZiHfzQVkjoZnrq1GHiqKz6wYFyLPAY22Loi+//jv2zmXfDo/BQEfwawqbERfXFDQbZ w1eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oqpB2vuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si10505551edj.504.2020.04.15.15.01.46; Wed, 15 Apr 2020 15:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=oqpB2vuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392512AbgDOBX7 (ORCPT + 99 others); Tue, 14 Apr 2020 21:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2392505AbgDOBX4 (ORCPT ); Tue, 14 Apr 2020 21:23:56 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 452C3C061A0E for ; Tue, 14 Apr 2020 18:23:55 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id l26so6202976qtc.12 for ; Tue, 14 Apr 2020 18:23:55 -0700 (PDT) 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=+UiXyULlzq60JcrYizZG5xR6t3RIPIiANzzV8jZ5et4=; b=oqpB2vuBxzx65QrcJ0rQHZsF96i4qH7Ccf1rFMcJ6KOnPS2CNK2G/i+chkrdb9a2Ye fX6rGMu9RPCe4ZDmyHLd5d4qmhvuPwD0hOrJGwMw5nORi9st6VrLGQ45nlHi2RyMkxHw sT0Q/Lq/ib1UjQN672r4x39sYLOTMS6E5jC4JiK68o8u8FG0SJaWourIl4/l/zSoLU8P dS5s0Xjb7hinQYUflvWzNAddQsBycWP8wR0GNb8lFPoVv+XGbEik7X6N/9ilApkXTYvX vmUWUTbiMWpBvtYwR8BzNY1zoDGx25l3yFRiOgbO4PbrsLgoGMCamPcPhfwY4HOZ7nXo MkgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=+UiXyULlzq60JcrYizZG5xR6t3RIPIiANzzV8jZ5et4=; b=lOvx15dhcaQJJzjv9TolT2WtzyknWhM/mD6thxR3OuCQ4tpUaA0KOHEvjEZhEFKW7B ER0vSccSZ7LAlJvcosUh4Rc1omNBJs0wa0yH4bT88h9HQZNGRvrq/y2GJJ3afrr1WjKV 7W0BeEW097mVjnqu2JQUZBYYGaQ7ZKuPP6KFrD9zI26gQGiCNED8/ZlWWi3TeGfUvS3w L1MLX5ZwE752yLsjyqMBk0I7ioKzxY76X6Iw1lf9FQP1PSwLjjdaiL/5LNpz+i1wpzJ7 +f0AUHwFGDOYcKtFU4aAWYxGVeW3/2Os3IRGnQRw5fhiIQ3DNwRvusiPeoGoAcJ7gRJ5 F29w== X-Gm-Message-State: AGi0PuaYaMKaXN098h2ZiJH7sPz9aa/gMVv8NLVHcC1p3xYyL0gr+Hl8 FZ+EMSdaDS4alMAJHN6nJh+DwFZZvDKb/w== X-Received: by 2002:ad4:55c4:: with SMTP id bt4mr2703843qvb.225.1586913833875; Tue, 14 Apr 2020 18:23:53 -0700 (PDT) Date: Tue, 14 Apr 2020 18:23:20 -0700 Message-Id: <20200415012320.236065-1-jcargill@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.26.0.110.g2183baf09c-goog Subject: [PATCH 1/1] KVM: pass through CPUID(0x80000006) From: Jon Cargille To: Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eric Northup , Eric Northup , Jon Cargille Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Northup Return L2 cache and TLB information to guests. They could have been set before, but the defaults that KVM returns will be necessary for usermode that doesn't supply their own CPUID tables. Signed-off-by: Eric Northup Signed-off-by: Eric Northup Signed-off-by: Jon Cargille Signed-off-by: Jim Mattson --- arch/x86/kvm/cpuid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index b1c469446b072..4a8d67303a42c 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -734,6 +734,9 @@ static inline int __do_cpuid_func(struct kvm_cpuid_entry2 *entry, u32 function, entry->ecx &= kvm_cpuid_8000_0001_ecx_x86_features; cpuid_mask(&entry->ecx, CPUID_8000_0001_ECX); break; + case 0x80000006: + /* L2 cache and TLB: pass through host info. */ + break; case 0x80000007: /* Advanced power management */ /* invariant TSC is CPUID.80000007H:EDX[8] */ entry->edx &= (1 << 8); -- 2.25.1.481.gfbce0eb801-goog