lkml.org 
[lkml]   [2019]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kvm: fix compilation on s390
On Fri, May 24, 2019 at 09:25:57PM +0200, Paolo Bonzini wrote:
> s390 does not have memremap, even though in this particular case it
> would be useful.

This is not completely true: memremap() is built when HAS_IOMEM is
defined which on s390 depends on CONFIG_PCI. So for "normal" configs
HAS_IOMEM would be enabled and memremap() would be available. We only
encountered the build error with a special minimal config for zfcpdump.

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> virt/kvm/kvm_main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 1fadfb9cf36e..134ec0283a8a 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1761,8 +1761,10 @@ static int __kvm_map_gfn(struct kvm_memory_slot *slot, gfn_t gfn,
> if (pfn_valid(pfn)) {
> page = pfn_to_page(pfn);
> hva = kmap(page);
> +#ifdef CONFIG_HAS_IOMEM
> } else {
> hva = memremap(pfn_to_hpa(pfn), PAGE_SIZE, MEMREMAP_WB);
> +#endif
> }
>
> if (!hva)
> --
> 1.8.3.1

I would have to run a test build to be sure but IMHO you will also need
to handle the memunmap() call in kvm_vcpu_unmap().

Michal Kubecek

\
 
 \ /
  Last update: 2019-05-24 22:25    [W:0.055 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site