public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Maxim Levitsky <mlevitsk@redhat.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	David Gilbert <dgilbert@redhat.com>,
	David Matlack <dmatlack@google.com>
Subject: Re: Possible minor CPU bug on Zen2 in regard to using very high GPA in a VM
Date: Wed, 4 Aug 2021 15:42:01 +0000	[thread overview]
Message-ID: <YQq1SVV9DKaZDhLp@google.com> (raw)
In-Reply-To: <f8071f73869de34961ea1a35177fc778bb99d4b7.camel@redhat.com>

On Wed, Aug 04, 2021, Maxim Levitsky wrote:
> Hi!
>  
> I recently triaged a series of failures that I am seeing on both of my AMD machines in the kvm selftests.
> 
> One test failed due to a trivial typo, to which I had sent a fix, but most of the other tests failed
> due to what I now suspect to be a very minor but still a CPU bug.
>  
> All of the failing tests except two tests that timeout (and I haven't yet triaged them),
> use the perf_test_util.c library.
> All of these fail with SHUTDOWN exit reason.
> 
> After a relatively recent commit ef4c9f4f6546 ("KVM: selftests: Fix 32-bit truncation of vm_get_max_gfn()"),
> vm_get_max_gfn() was fixed to return the maximum GFN that the guest can use.
> For default VM type this value is obtained from 'vm->pa_bit's which is in turn obtained
> from guest's cpuid in kvm_get_cpu_address_width function.
>  
> It is 48 on both my AMD machines (3970X and 4650U) and also on remote EPYC 7302P machine.
> (all of them are Zen2 machines)
>  
> My 3970X has SME enabled by BIOS, while my 4650U doesn't have it enabled.
> The 7302P also has SME enabled.
> SEV was obviously not enabled for the test.
> NPT was enabled.
>  
> It appears that if the guest uses any GPA above 0xFFFCFFFFF000 in its guest paging tables, 
> then it gets #PF with reserved bits error code.

LOL, I encountered this joy a few weeks back.  There's a magic Hyper-Transport
region at the top of memory that is reserved, even for GPAs.  You and I say
"CPU BUG!!!", AMD says "working as intended" ;-)

https://lkml.kernel.org/r/20210625020354.431829-2-seanjc@google.com

  reply	other threads:[~2021-08-04 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 12:59 Possible minor CPU bug on Zen2 in regard to using very high GPA in a VM Maxim Levitsky
2021-08-04 15:42 ` Sean Christopherson [this message]
2021-08-04 15:58   ` Dr. David Alan Gilbert
2021-08-04 16:04   ` Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YQq1SVV9DKaZDhLp@google.com \
    --to=seanjc@google.com \
    --cc=brijesh.singh@amd.com \
    --cc=dgilbert@redhat.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox