From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: [PATCH v6 10/12] KVM: introduce KVM_HVA_ERR_RO_BAD Date: Tue, 21 Aug 2012 11:02:22 +0800 Message-ID: <5032FA3E.9000204@linux.vnet.ibm.com> References: <5032F8FD.2020306@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , LKML , KVM To: Xiao Guangrong Return-path: Received: from e28smtp08.in.ibm.com ([122.248.162.8]:58047 "EHLO e28smtp08.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755027Ab2HUDCg (ORCPT ); Mon, 20 Aug 2012 23:02:36 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 Aug 2012 08:32:34 +0530 In-Reply-To: <5032F8FD.2020306@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: In the later patch, it indicates failure when we try to get a writable hva from the readonly memslot Signed-off-by: Xiao Guangrong --- include/linux/kvm_host.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b9bba60..a913ac7 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -82,11 +82,12 @@ static inline bool is_invalid_pfn(pfn_t pfn) return !is_noslot_pfn(pfn) && is_error_pfn(pfn); } -#define KVM_HVA_ERR_BAD (PAGE_OFFSET) +#define KVM_HVA_ERR_BAD (PAGE_OFFSET) +#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE) static inline bool kvm_is_error_hva(unsigned long addr) { - return addr == PAGE_OFFSET; + return addr >= PAGE_OFFSET; } #define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT)) -- 1.7.7.6