Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp24091pxb; Tue, 23 Feb 2021 16:53:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwV7Dpic0IwKAF/uK13rlp8DaZbey3askIo4hdTft6buHuW38B0//ffAdZv1F0pIn4szKrk X-Received: by 2002:a17:906:18f1:: with SMTP id e17mr18229499ejf.372.1614128018913; Tue, 23 Feb 2021 16:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614128018; cv=none; d=google.com; s=arc-20160816; b=Cu57q64ai5BbzUGdN46yxCl7AVIq+Syg/wxiZ6KCcFUUJz2E6OdjpbDIWC6MbxWRot ZTmrAfAe8E2VzNDHot+Bm4DuIVLEM3b6yWtzSrvcuJHzoUpxB1BnJmaWyUouI+ew245G BUom/vQ91pdtMiXw16gC/ki3RIGODO59tnB3BQ19wlb7PZdShNCFgdt6Daq/fu2CzVr7 DXXzq1Ze8qeX7fg2HK/vUlVuLpCZALoPOl4dWfrRJTzbjQL8lpvSrYP8EmgbxMBlGPhO mzTMUbaqDg1VDynqSUyCSq8BMXCiXdOH1ibh7BbMvFGSWvL1HNybiEeu+Qblo4qlzQsk FAnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=w5LHMVXfGGl3hxeLafXJooEHPX5Ay/rdElBayKDuOUg=; b=ijVvPih4pT2LaM+pZLpLaE0VYJ43lnfuvTb0JVDBAle+FFL7wq3nc42JAo4Oq+AbFV zw2DFTM9HoL1cgXh2FAon6gicPXD7vmuIhrPQcEKjhEnllsNUpTVVTT7RLJi3rFzRQLQ QBfdvOyFAzYz4r6zKqql6pDJvik58jCOxKJMUEa1xHlzP9QnbbhokvIEDTkJQqL1IFNE 197dBuRz2xFDulvUR7cELO8eRmLoG+0N5la770TH+U3u+2p3CgtILXqGY7AYDAx2tWRn Jv+YlPznUOPdfqQtfDbWQvRQuGPK5irPCCUiWCg+WQ7Knq0O5l6k2N1Miwfr7kTfV2Mt Yejg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="be8bS/Vt"; 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 p5si263906ejz.156.2021.02.23.16.52.39; Tue, 23 Feb 2021 16:53:38 -0800 (PST) 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="be8bS/Vt"; 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 S229946AbhBWXQj (ORCPT + 99 others); Tue, 23 Feb 2021 18:16:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233946AbhBWXOr (ORCPT ); Tue, 23 Feb 2021 18:14:47 -0500 Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F652C06174A for ; Tue, 23 Feb 2021 15:14:06 -0800 (PST) Received: by mail-ot1-x32c.google.com with SMTP id c16so409550otp.0 for ; Tue, 23 Feb 2021 15:14:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=w5LHMVXfGGl3hxeLafXJooEHPX5Ay/rdElBayKDuOUg=; b=be8bS/Vt5TH1uycrmc7J6eu5kop7HbA4Mg3Tp5SitIgNFwgJaZF1x5YtvXbzLvJi8i TnNp5xCUyS42XEY12WUu445YR25j8jdIUIE1LxG+OsEIpaTrsjUDP+0hVoL+cQj0xPFC nJgfz57W/gqmXm5lwlUhp9sKiC/x31UGG3VMQkn6JOuKj8ySHDEHl6/LtHVJhRBjiXrd ddoZGYVvpMFCctHaza8hxdzbRHpufXtAPFeXQ/DAYXFnhryqv6PVQJs071HPdsoVbcrT AeFeK3DhErHcxByhMSakJphk3FA77s5i+DdIi+mF64mBWB3YERoHEpdlJxLkv8iZq427 xo+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=w5LHMVXfGGl3hxeLafXJooEHPX5Ay/rdElBayKDuOUg=; b=uS+ii0QJH7C0+sA7JKQcwBumwXrV9e72lp/T2KZjkch41Ie26eeKyG9U0uR3NOOvMP 440uN+UL+Nmu0s3sragJhca9y286Q5FijS8j3C1s+Pvy0mSWngvj8/GaiOSRcPQ7NbE9 V4eQGzTKWebaV+bkQ47ybZYh765EW0apK9JjVmaYN4vx6gTIugkToyXYG25oP2JFww/u O/FjrD8f0LCfZR0qPh9hLcd1RBVjDzy06OLOzG24anZgwIidV3aOlOOZd2m+oazV4S7w ZZKAVY1OOKtGc2QNzi/+CXzF5X4PPFChNPavB/MCVxUdHYgomqvIoco+9adywvPhUnz9 UlCg== X-Gm-Message-State: AOAM530LVQMSkcKkZ0Z+HU/M92JnvuEyrj2lBdcjqFmVfSeaR1cO3bDG 9WnmrdJJwiB+sBAsdpukUtO6C9ld41uldOTfJA20dlNfeua5CA== X-Received: by 2002:a05:6830:902:: with SMTP id v2mr22285371ott.56.1614122045232; Tue, 23 Feb 2021 15:14:05 -0800 (PST) MIME-Version: 1.0 References: <20210219144632.2288189-1-david.edmondson@oracle.com> <20210219144632.2288189-2-david.edmondson@oracle.com> In-Reply-To: From: Jim Mattson Date: Tue, 23 Feb 2021 15:13:54 -0800 Message-ID: Subject: Re: [PATCH v2 1/3] KVM: x86: dump_vmcs should not assume GUEST_IA32_EFER is valid To: Sean Christopherson Cc: David Edmondson , LKML , "H. Peter Anvin" , Joerg Roedel , "the arch/x86 maintainers" , Thomas Gleixner , kvm list , Paolo Bonzini , Wanpeng Li , Ingo Molnar , Borislav Petkov , Vitaly Kuznetsov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2021 at 2:51 PM Sean Christopherson wrote: > > On Fri, Feb 19, 2021, David Edmondson wrote: > > If the VM entry/exit controls for loading/saving MSR_EFER are either > > not available (an older processor or explicitly disabled) or not > > used (host and guest values are the same), reading GUEST_IA32_EFER > > from the VMCS returns an inaccurate value. > > > > Because of this, in dump_vmcs() don't use GUEST_IA32_EFER to decide > > whether to print the PDPTRs - do so if the EPT is in use and CR4.PAE > > is set. > > This isn't necessarily correct either. In a way, it's less correct as PDPTRs > are more likely to be printed when they shouldn't, assuming most guests are > 64-bit guests. It's annoying to calculate the effective guest EFER, but so > awful that it's worth risking confusion over PDTPRs. I still prefer a dump_vmcs that always dumps every VMCS field. But if you really want to skip printing the PDPTEs when they're irrelevant, can't you just use the "IA-32e mode guest" VM-entry control as a proxy for EFER.LMA?