Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp410656pxv; Thu, 24 Jun 2021 10:33:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5nP/6jFB96yfhq7b7oP7DdGkGEWIj5mzBy+x39tmeZKYlDQizpIFsyx1aj7lkdh8IXVGl X-Received: by 2002:a17:906:3845:: with SMTP id w5mr6545174ejc.518.1624556024554; Thu, 24 Jun 2021 10:33:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624556024; cv=none; d=google.com; s=arc-20160816; b=B5fXKxy7xgLpBWXYg3ksHfv3GJkltiF6zuPDnpBauK4S9xTNSpYVgiiM5tiQKFQ4ln DUcKQ25vnu6Plf13EDs4TBfwvbSKxfvFuX9TnhyoCvhpeOXR1g5uqeaQOqcAoVO2iwl1 xMHtESXkeQtwRV8sKoeCGCPlucHJU8qybq6zCNK1ThNb09iKj73WIH7hxhCkF4Nrn016 fJPDdYB0NXz1viXFXixhsel872SZeO8uTkjXkzoJN0Nh1GoYcmM47nAJXK/gPmksKUgv b89iEbxR2/t8e0o3oChXT9M1gDphzi2duObnBUC+15pEwIljS87TBy0Vn0gPj021ihqA hVng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NXamga020V8fjrq0TD0oEXX5F6d6dS3uFOlZ6LFMVgk=; b=SIIW+hwYv2FZpSfNmZvZ3WEP2GK+ObIiJMXqyGdlcBeQyXX16OJYgqCw4L11rH6cdw 69cIaQYB9rrLPeVWSUfbQsdk0qEOsUmmwtx4LXIWFU35yYtTGjtbOPPdL0JgezXF0V59 DW9vDZiTkImyJBbfoFUHxy7kQg7P+j8KRVfVxbC0zqSxgxQzhdIybSxtKtWAKf1aXe8e Da+gs/YqUb/KMdDqHJhy/HN+zMrIA0xXPCkE4y4mwL3x8ipfkQ/cCjzKaYa/WRW7NoPm N6ICSVgNfpDmAj1YydjgEvWPtq7maupmVA+NRqbH6ENha8rGFgicPK+XIEIbPbWiFc7j qT5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aZifHySw; 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 h3si4053095edf.193.2021.06.24.10.33.18; Thu, 24 Jun 2021 10:33:44 -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=aZifHySw; 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 S232370AbhFXReA (ORCPT + 99 others); Thu, 24 Jun 2021 13:34:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhFXRd6 (ORCPT ); Thu, 24 Jun 2021 13:33:58 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE033C061574 for ; Thu, 24 Jun 2021 10:31:39 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id x16so5750994pfa.13 for ; Thu, 24 Jun 2021 10:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NXamga020V8fjrq0TD0oEXX5F6d6dS3uFOlZ6LFMVgk=; b=aZifHySwD6uqla8CbsEA8UeI3E6CaFVu27HO+tY9wsjDTSz58+wBjYyT2qmY2igqRO P/+L8s8JSxztaIRiXP5K7COaLxoOODkvnk3Y/QwDhy/sV41HLoD+NIg6LjRU6z0XoYRa 1esbz2gpJdzoIb8O4yqgP66KsMBFIytRIL56eSR8GXw2eXAvq/+qmpZ0KZ+dFubW+1hJ 3B0a7hdU/lj2FsfDhSTa0AIVDPP+EhcFmeFWnVSXOHts9/+FlxDAo+QNrCa5qAAHXVxU /mOoTwXjEM4OgBy24EwpN6TtRwZA8Lwg12Pfc1YOPBMjBclFs1W8Jiia2vKB2v3rdITL JCmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NXamga020V8fjrq0TD0oEXX5F6d6dS3uFOlZ6LFMVgk=; b=QQIMegG8xL804hy0oPq8i/H/40tYs35PccTGUh4PZtXJi+6Zv+h6BZ35oQbdm+++lt xv4PTHHcjqS6hjU4MyDFC1dQRrVluiDc6JG1hIAmnKtL0kBls+oaL3br6BfIlzASy3/f vaTUy2zKGn76v4j2WuG9/k4vP3eKh7thKo+WuHQw1XlzMfxKA6wuoL/1ePKPYKy9BkMO KZ7Zi3L83lvnmBAd3YeAuwS4x5re+vZ3kggXOAh8S1rM6CkW+I4cX3LdhbLS/bG/dioM 1NZpFiJuj8s7QSWVUJ2y3lXdjjeV1h/lOOePD59DDhCCQhPhfHcWyfiyROl/9KBGsXqc eRJQ== X-Gm-Message-State: AOAM5313LbPITTCQAZT2jMfV15bVdHnCFcOxwmEa3hnxT3A47dGk4xfz B8NX9dGuhjS9n7WLauHbqcQp2w== X-Received: by 2002:a65:6914:: with SMTP id s20mr5641081pgq.420.1624555899193; Thu, 24 Jun 2021 10:31:39 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id oc9sm2714548pjb.43.2021.06.24.10.31.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 10:31:38 -0700 (PDT) Date: Thu, 24 Jun 2021 17:31:34 +0000 From: Sean Christopherson To: Tom Lendacky Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Gonda , Brijesh Singh Subject: Re: [PATCH 0/7] KVM: x86: guest MAXPHYADDR and C-bit fixes Message-ID: References: <20210623230552.4027702-1-seanjc@google.com> <324a95ee-b962-acdf-9bd7-b8b23b9fb991@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021, Tom Lendacky wrote: > > > > Here's an explanation of the physical address reduction for bare-metal and > > guest. > > > > With MSR 0xC001_0010[SMEE] = 0: > > No reduction in host or guest max physical address. > > > > With MSR 0xC001_0010[SMEE] = 1: > > - Reduction in the host is enumerated by CPUID 0x8000_001F_EBX[11:6], > > regardless of whether SME is enabled in the host or not. So, for example > > on EPYC generation 2 (Rome) you would see a reduction from 48 to 43. > > - There is no reduction in physical address in a legacy guest (non-SEV > > guest), so the guest can use a 48-bit physical address So the behavior I'm seeing is either a CPU bug or user error. Can you verify the unexpected #PF behavior to make sure I'm not doing something stupid? Thanks! > > - There is a reduction of only the encryption bit in an SEV guest, so > > the guest can use up to a 47-bit physical address. This is why the > > Qemu command line sev-guest option uses a value of 1 for the > > "reduced-phys-bits" parameter. > > > > The guest statements all assume that NPT is enabled. > > Thanks, > Tom