lkml.org 
[lkml]   [2013]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/4] PF: Make KVM_HVA_ERR_BAD usable on s390
    Date
    Current common code uses PAGE_OFFSET to indicate a bad host virtual address.
    As this check won't work on architectures that don't map kernel and user memory
    into the same address space (e.g. s390), an additional implementation is made
    available in the case that PAGE_OFFSET == 0.

    Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
    ---
    include/linux/kvm_host.h | 14 ++++++++++++++
    1 file changed, 14 insertions(+)

    diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
    index a63d83e..f3c04e7 100644
    --- a/include/linux/kvm_host.h
    +++ b/include/linux/kvm_host.h
    @@ -85,6 +85,18 @@ static inline bool is_noslot_pfn(pfn_t pfn)
    return pfn == KVM_PFN_NOSLOT;
    }

    +#if (PAGE_OFFSET == 0)
    +
    +#define KVM_HVA_ERR_BAD (-1UL)
    +#define KVM_HVA_ERR_RO_BAD (-1UL)
    +
    +static inline bool kvm_is_error_hva(unsigned long addr)
    +{
    + return addr == KVM_HVA_ERR_BAD;
    +}
    +
    +#else
    +
    #define KVM_HVA_ERR_BAD (PAGE_OFFSET)
    #define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)

    @@ -93,6 +105,8 @@ static inline bool kvm_is_error_hva(unsigned long addr)
    return addr >= PAGE_OFFSET;
    }

    +#endif
    +
    #define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))

    static inline bool is_error_page(struct page *page)
    --
    1.8.2.2


    \
     
     \ /
      Last update: 2013-07-10 23:37    [W:7.131 / U:0.684 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site