All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongli Zhang <dongli.zhang@oracle.com>
To: kvm@vger.kernel.org
Cc: pbonzini@redhat.com, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] KVM: use KVM_HVA_ERR_BAD to check bad hva
Date: Thu, 29 Feb 2024 13:25:22 -0800	[thread overview]
Message-ID: <20240229212522.34515-1-dongli.zhang@oracle.com> (raw)

Replace PAGE_OFFSET with KVM_HVA_ERR_BAD, to facilitate the cscope when
looking for where KVM_HVA_ERR_BAD is used.

Every time I use cscope to query the functions that are impacted by the
return value (KVM_HVA_ERR_BAD) of __gfn_to_hva_many(), I may miss
kvm_is_error_hva().

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
---
 include/linux/kvm_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 7e7fd25b09b3..4dc0300e7766 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -143,7 +143,7 @@ static inline bool is_noslot_pfn(kvm_pfn_t pfn)
 
 static inline bool kvm_is_error_hva(unsigned long addr)
 {
-	return addr >= PAGE_OFFSET;
+	return addr >= KVM_HVA_ERR_BAD;
 }
 
 #endif
-- 
2.34.1


             reply	other threads:[~2024-02-29 21:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 21:25 Dongli Zhang [this message]
2024-02-29 21:53 ` [PATCH 1/1] KVM: use KVM_HVA_ERR_BAD to check bad hva Huang, Kai
2024-02-29 22:13   ` Dongli Zhang
2024-02-29 22:39     ` Huang, Kai

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=20240229212522.34515-1-dongli.zhang@oracle.com \
    --to=dongli.zhang@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.