Message ID | 20240228024147.41573-5-seanjc@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3098718dyb; Tue, 27 Feb 2024 18:43:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtq+5yRTZc9ldGiZ18wnZH1/4XxhnXmuCmJg4ybQc03HICBtEMvoN/LSEd0AvXPOZGhQDAQBMkNqaQpqRDT1ogNmvQ9w== X-Google-Smtp-Source: AGHT+IHLIr2u5tHfN0VCuy0PAjevR4lvK7m+ooQghAC8d53MOwGIiSgRiwR7XhrxyiQTybAzlYI3 X-Received: by 2002:a17:906:e257:b0:a3d:1cbd:67f7 with SMTP id gq23-20020a170906e25700b00a3d1cbd67f7mr8403065ejb.0.1709088218826; Tue, 27 Feb 2024 18:43:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709088218; cv=pass; d=google.com; s=arc-20160816; b=TPr36ERSfy8PhRF6QWsjmghgofSCEXrWUbpX+GfC7QR66FNZfsYa1FQVm5zuqV2nEs nxAMUAPZY/XAWaOG4mmEJfvMUztzKKWE0AbZvAs05X7/U/0kN3hbw0W6l95q9CT2qfRU 9VuGDj6t4E56Bcr2qVf2h70E0bqkT9Bg6uJe/UqPKmd5m4xMxs4ZRMRxOQlg9VHMjjg6 4LmaJ4sQEh8w9DjjLhndYob+9bqiQX2cNd9HnbiC4ujCPaLyT0EC577vi2ReAIy82Nun 93ADUI787jjgXNp00xfBFn4E10WGXUlUS1cHg9Zk1n9wuETobOwxnrCWyG6Uvcp9GFRj 8vMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :reply-to:dkim-signature; bh=vbRF992kdFc9tiyNuxItAbgdPRKbA7Cju3slwI3hgOA=; fh=uRvZmPjhoPuht/xP/qZG4VkAl51tBtfH4jUiLA3di18=; b=GMy+L66Z6NoNhLdllIZ+OPjGXIWMYoNUHv3wJ0LWCpfcSbmrxhUkSTxSZA5LqYvwbk P2wFpjcUO+8F6n2QfLUFNm/DRKX2xHFKrweqwsIqpx7l76ikm2QVWbO0KpwzeRm9yDJq 54wAAM3x+4cKgv7NTR6thnAxGigRYX/Eiyqw/hRWh51m0Ce1Q2fSrYglNoKqw9dg2aHO 8hHpwr0Cs64FHOUgIWXEKN2xsQExD+nGGg87JyyXVmAZgAqyWrDPTm9oPQ7DXKeRbyFd K7Bjm7QEo1hBavT9bykfdicY9hkeRILKd4DYTPgVUvN789wKdsLwoLinOBvsmE+IX5dk 8j1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gApBg6m9; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t17-20020a170906065100b00a42fc08b3b1si1220265ejb.942.2024.02.27.18.43.38 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 18:43:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=gApBg6m9; arc=pass (i=1 spf=pass spfdomain=flex--seanjc.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84430-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 405C41F29681 for <ouuuleilei@gmail.com>; Wed, 28 Feb 2024 02:43:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2A3823772; Wed, 28 Feb 2024 02:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="gApBg6m9" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAD7120B0E for <linux-kernel@vger.kernel.org>; Wed, 28 Feb 2024 02:41:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709088121; cv=none; b=n/vnPZhBwI6KQFXIPsy2EOC794bhbq7lNhPUSBzyqL+LnWPw4bqOeu9IPDIsfYnffzaXn7g1P6Ay+pNXJEk8jsHCDCCjA0hD+eI8MvFkPtJOZeOFO9N6Mnyq55wG+fjSbwfkSygAAZdbYMGI1Yne5l1Tam6hegTMMXJQBIZCrNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709088121; c=relaxed/simple; bh=Ee4P1IGzSZAbqqoC45jHzPN8hF/0X+AxCf4vkLrZ8oo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Hee2S/uY15JjWQ0c7VFkZXZGdSqEikzc9H4zeDQkDP5RljzftsNvAauaNHBMrUr3Yw8NUDlQ+7RPgRbh1Ndxx3Fnj91ztIyoXLT5tn9D/pZFLCKQqxuKVjHzWpAYOV8tbEq/0Z5or4IjgHORefP6p6fH3JSX2pr1Fl3aMguJM2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=gApBg6m9; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-608d6ffc64eso7155487b3.0 for <linux-kernel@vger.kernel.org>; Tue, 27 Feb 2024 18:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1709088118; x=1709692918; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=vbRF992kdFc9tiyNuxItAbgdPRKbA7Cju3slwI3hgOA=; b=gApBg6m9/n4OByfbEvr+LNxa1FXhXQXl++lerlpZbBu/TZaJKN/Wrv5NAx6Y8OUYkn cEOnoUNmcEOBeR0upfproGY+rxMMBYjz+Q3gWoVVO0Cyc0l1n6BLT66+7GbK+6b16uez XvfylwSerawHTVsavbLcmWa14F7e4MqBiHV2eYY3M+M+pPlnJKVSHbDJGqmAIbOjDPug KKnSZueNOidQFLClvMQ4kdR8Pe25MkkKGQobd8efDml/+ZRkFjnkiPr4ary6U49yZr2n zMHJvS2ywYF4JwfZz2TPHZ0b4mouT7UoVQkXiZJRJUcbiYMYwueersvLCHGUPePJUk1R HgZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709088118; x=1709692918; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vbRF992kdFc9tiyNuxItAbgdPRKbA7Cju3slwI3hgOA=; b=XEMcqCaIxj961uuESMHUi2DwFilyl/gvcekU+GlMSpptBeGEpTZqdzvG5afW7CFevM VDbUWOtm+Z2Joi6Mkr4E681zq7JgNb0JCewBh+Kj2Mo0YIWxvTVquWxu4V6/m4zL0owB I22jSjvKcKzuxML+hrucDYJ4D+Yc9F0RtafokIcrG18+2IbiAyS2XCLRxGVUiP++TyoB KQ/tIN888DFQaNhcnyCjk5yZMAqBucqvE4eWA19R8i/TsXdOth1TCMzEoka2r39Zis2o Jbmf3x1pdOUeijJ00n4lPmqQOBXZY0W8A6PH2hEYG2vnzhMvERLZ+5SgZLe84xVyZTHA Ebxw== X-Forwarded-Encrypted: i=1; AJvYcCVmGDYAYucsmQ+LOkQqVymxKc8dG3s083wbI8H4XmroDDTmwNiAzlW1XJ0g8t97OrZ6WT38gKKwPk3ddplXkEcaoTV8TNmuMiVH1cC8 X-Gm-Message-State: AOJu0Yz1WEmtTyNkXALgkHkXAvWVpIyxkbjSc+bLHvYA5xZy/nLRivk4 bpx5qii63uz0mx79AnBFjyFk+ZXgnUg0SLrzueeC/oqPzDmum8dVm3vl3Alb6645I6TTCvWbP4n wEw== X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a81:4e8f:0:b0:608:ff12:4155 with SMTP id c137-20020a814e8f000000b00608ff124155mr292352ywb.0.1709088118014; Tue, 27 Feb 2024 18:41:58 -0800 (PST) Reply-To: Sean Christopherson <seanjc@google.com> Date: Tue, 27 Feb 2024 18:41:35 -0800 In-Reply-To: <20240228024147.41573-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> Mime-Version: 1.0 References: <20240228024147.41573-1-seanjc@google.com> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Message-ID: <20240228024147.41573-5-seanjc@google.com> Subject: [PATCH 04/16] KVM: x86/mmu: Pass full 64-bit error code when handling page faults From: Sean Christopherson <seanjc@google.com> To: Sean Christopherson <seanjc@google.com>, Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Yan Zhao <yan.y.zhao@intel.com>, Isaku Yamahata <isaku.yamahata@intel.com>, Michael Roth <michael.roth@amd.com>, Yu Zhang <yu.c.zhang@linux.intel.com>, Chao Peng <chao.p.peng@linux.intel.com>, Fuad Tabba <tabba@google.com>, David Matlack <dmatlack@google.com> Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792108887947498235 X-GMAIL-MSGID: 1792108887947498235 |
Series |
KVM: x86/mmu: Page fault and MMIO cleanups
|
|
Commit Message
Sean Christopherson
Feb. 28, 2024, 2:41 a.m. UTC
From: Isaku Yamahata <isaku.yamahata@intel.com> Plumb the full 64-bit error code throughout the page fault handling code so that KVM can use the upper 32 bits, e.g. SNP's PFERR_GUEST_ENC_MASK will be used to determine whether or not a fault is private vs. shared. Note, passing the 64-bit error code to FNAME(walk_addr)() does NOT change the behavior of permission_fault() when invoked in the page fault path, as KVM explicitly clears PFERR_IMPLICIT_ACCESS in kvm_mmu_page_fault(). Continue passing '0' from the async #PF worker, as guest_memfd() and thus private memory doesn't support async page faults. Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> [mdr: drop references/changes on rebase, update commit message] Signed-off-by: Michael Roth <michael.roth@amd.com> [sean: drop truncation in call to FNAME(walk_addr)(), rewrite changelog] Signed-off-by: Sean Christopherson <seanjc@google.com> --- arch/x86/kvm/mmu/mmu.c | 3 +-- arch/x86/kvm/mmu/mmu_internal.h | 4 ++-- arch/x86/kvm/mmu/mmutrace.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-)
Comments
On 2/27/24 18:41, Sean Christopherson wrote: > From: Isaku Yamahata <isaku.yamahata@intel.com> > > Plumb the full 64-bit error code throughout the page fault handling code > so that KVM can use the upper 32 bits, e.g. SNP's PFERR_GUEST_ENC_MASK > will be used to determine whether or not a fault is private vs. shared. > > Note, passing the 64-bit error code to FNAME(walk_addr)() does NOT change > the behavior of permission_fault() when invoked in the page fault path, as > KVM explicitly clears PFERR_IMPLICIT_ACCESS in kvm_mmu_page_fault(). May this lead to a WARN_ON_ONCE? 5843 int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 error_code, 5844 void *insn, int insn_len) 5845 { .. ... 5856 */ 5857 if (WARN_ON_ONCE(error_code & PFERR_IMPLICIT_ACCESS)) 5858 error_code &= ~PFERR_IMPLICIT_ACCESS; > > Continue passing '0' from the async #PF worker, as guest_memfd() and thus :s/guest_memfd()/guest_memfd/ ? Dongli Zhang > private memory doesn't support async page faults. > > Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> > [mdr: drop references/changes on rebase, update commit message] > Signed-off-by: Michael Roth <michael.roth@amd.com> > [sean: drop truncation in call to FNAME(walk_addr)(), rewrite changelog] > Signed-off-by: Sean Christopherson <seanjc@google.com> > --- > arch/x86/kvm/mmu/mmu.c | 3 +-- > arch/x86/kvm/mmu/mmu_internal.h | 4 ++-- > arch/x86/kvm/mmu/mmutrace.h | 2 +- > 3 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c > index e2fd74e06ff8..408969ac1291 100644 > --- a/arch/x86/kvm/mmu/mmu.c > +++ b/arch/x86/kvm/mmu/mmu.c > @@ -5860,8 +5860,7 @@ int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 err > } > > if (r == RET_PF_INVALID) { > - r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa, > - lower_32_bits(error_code), false, > + r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa, error_code, false, > &emulation_type); > if (KVM_BUG_ON(r == RET_PF_INVALID, vcpu->kvm)) > return -EIO; > diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h > index 0eea6c5a824d..1fab1f2359b5 100644 > --- a/arch/x86/kvm/mmu/mmu_internal.h > +++ b/arch/x86/kvm/mmu/mmu_internal.h > @@ -190,7 +190,7 @@ static inline bool is_nx_huge_page_enabled(struct kvm *kvm) > struct kvm_page_fault { > /* arguments to kvm_mmu_do_page_fault. */ > const gpa_t addr; > - const u32 error_code; > + const u64 error_code; > const bool prefetch; > > /* Derived from error_code. */ > @@ -288,7 +288,7 @@ static inline void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu, > } > > static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, > - u32 err, bool prefetch, int *emulation_type) > + u64 err, bool prefetch, int *emulation_type) > { > struct kvm_page_fault fault = { > .addr = cr2_or_gpa, > diff --git a/arch/x86/kvm/mmu/mmutrace.h b/arch/x86/kvm/mmu/mmutrace.h > index ae86820cef69..195d98bc8de8 100644 > --- a/arch/x86/kvm/mmu/mmutrace.h > +++ b/arch/x86/kvm/mmu/mmutrace.h > @@ -260,7 +260,7 @@ TRACE_EVENT( > TP_STRUCT__entry( > __field(int, vcpu_id) > __field(gpa_t, cr2_or_gpa) > - __field(u32, error_code) > + __field(u64, error_code) > __field(u64 *, sptep) > __field(u64, old_spte) > __field(u64, new_spte)
On Tue, Feb 27, 2024, Dongli Zhang wrote: > > > On 2/27/24 18:41, Sean Christopherson wrote: > > From: Isaku Yamahata <isaku.yamahata@intel.com> > > > > Plumb the full 64-bit error code throughout the page fault handling code > > so that KVM can use the upper 32 bits, e.g. SNP's PFERR_GUEST_ENC_MASK > > will be used to determine whether or not a fault is private vs. shared. > > > > Note, passing the 64-bit error code to FNAME(walk_addr)() does NOT change > > the behavior of permission_fault() when invoked in the page fault path, as > > KVM explicitly clears PFERR_IMPLICIT_ACCESS in kvm_mmu_page_fault(). > > May this lead to a WARN_ON_ONCE? > > 5843 int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, > u64 error_code, > 5844 void *insn, int insn_len) > 5845 { > ... ... > 5856 */ > 5857 if (WARN_ON_ONCE(error_code & PFERR_IMPLICIT_ACCESS)) > 5858 error_code &= ~PFERR_IMPLICIT_ACCESS; Nope, it shouldn't. PFERR_IMPLICIT_ACCESS is a synthetic, KVM-defined flag, and should never be in the error code passed to kvm_mmu_page_fault(). If the WARN fires, it means hardware (specifically, AMD CPUs for #NPF) has started using the bit for something, and that we need to update KVM to use a different bit. > > Continue passing '0' from the async #PF worker, as guest_memfd() and thus > > :s/guest_memfd()/guest_memfd/ ? I've been styling it as guest_memfd() to make it look like a syscall, e.g. like memfd_create(), when I'm talking about a file that was created by userspace, as opposed to GUEST_MEMFD when I'm talking about the ioctl() itself.
On 2/28/24 08:22, Sean Christopherson wrote: > On Tue, Feb 27, 2024, Dongli Zhang wrote: >> >> >> On 2/27/24 18:41, Sean Christopherson wrote: >>> From: Isaku Yamahata <isaku.yamahata@intel.com> >>> >>> Plumb the full 64-bit error code throughout the page fault handling code >>> so that KVM can use the upper 32 bits, e.g. SNP's PFERR_GUEST_ENC_MASK >>> will be used to determine whether or not a fault is private vs. shared. >>> >>> Note, passing the 64-bit error code to FNAME(walk_addr)() does NOT change >>> the behavior of permission_fault() when invoked in the page fault path, as >>> KVM explicitly clears PFERR_IMPLICIT_ACCESS in kvm_mmu_page_fault(). >> >> May this lead to a WARN_ON_ONCE? >> >> 5843 int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, >> u64 error_code, >> 5844 void *insn, int insn_len) >> 5845 { >> ... ... >> 5856 */ >> 5857 if (WARN_ON_ONCE(error_code & PFERR_IMPLICIT_ACCESS)) >> 5858 error_code &= ~PFERR_IMPLICIT_ACCESS; > > Nope, it shouldn't. PFERR_IMPLICIT_ACCESS is a synthetic, KVM-defined flag, and > should never be in the error code passed to kvm_mmu_page_fault(). If the WARN > fires, it means hardware (specifically, AMD CPUs for #NPF) has started using the > bit for something, and that we need to update KVM to use a different bit. Thank you very much for the explanation. I see it is impossible to have PFERR_IMPLICIT_ACCESS set here, unless there is AMD hardware issue or Intel page fault handler morphs the error_code erroneously. I meant the above commit message confused me when I was reading it. E.g., how about something like: "Note, passing the 64-bit error code to FNAME(walk_addr)() does NOT change the behavior of permission_fault() when invoked in the page fault path, as it should never be in the error code because ...." Thank you very much! Dongli Zhang > >>> Continue passing '0' from the async #PF worker, as guest_memfd() and thus >> >> :s/guest_memfd()/guest_memfd/ ? > > I've been styling it as guest_memfd() to make it look like a syscall, e.g. like > memfd_create(), when I'm talking about a file that was created by userspace, as > opposed to GUEST_MEMFD when I'm talking about the ioctl() itself.
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index e2fd74e06ff8..408969ac1291 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -5860,8 +5860,7 @@ int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 err } if (r == RET_PF_INVALID) { - r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa, - lower_32_bits(error_code), false, + r = kvm_mmu_do_page_fault(vcpu, cr2_or_gpa, error_code, false, &emulation_type); if (KVM_BUG_ON(r == RET_PF_INVALID, vcpu->kvm)) return -EIO; diff --git a/arch/x86/kvm/mmu/mmu_internal.h b/arch/x86/kvm/mmu/mmu_internal.h index 0eea6c5a824d..1fab1f2359b5 100644 --- a/arch/x86/kvm/mmu/mmu_internal.h +++ b/arch/x86/kvm/mmu/mmu_internal.h @@ -190,7 +190,7 @@ static inline bool is_nx_huge_page_enabled(struct kvm *kvm) struct kvm_page_fault { /* arguments to kvm_mmu_do_page_fault. */ const gpa_t addr; - const u32 error_code; + const u64 error_code; const bool prefetch; /* Derived from error_code. */ @@ -288,7 +288,7 @@ static inline void kvm_mmu_prepare_memory_fault_exit(struct kvm_vcpu *vcpu, } static inline int kvm_mmu_do_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, - u32 err, bool prefetch, int *emulation_type) + u64 err, bool prefetch, int *emulation_type) { struct kvm_page_fault fault = { .addr = cr2_or_gpa, diff --git a/arch/x86/kvm/mmu/mmutrace.h b/arch/x86/kvm/mmu/mmutrace.h index ae86820cef69..195d98bc8de8 100644 --- a/arch/x86/kvm/mmu/mmutrace.h +++ b/arch/x86/kvm/mmu/mmutrace.h @@ -260,7 +260,7 @@ TRACE_EVENT( TP_STRUCT__entry( __field(int, vcpu_id) __field(gpa_t, cr2_or_gpa) - __field(u32, error_code) + __field(u64, error_code) __field(u64 *, sptep) __field(u64, old_spte) __field(u64, new_spte)