linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: fix compilation on s390
@ 2019-05-24 19:25 Paolo Bonzini
  2019-05-24 19:54 ` Christian Borntraeger
  2019-05-24 20:24 ` Michal Kubecek
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2019-05-24 19:25 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: mkubecek

s390 does not have memremap, even though in this particular case it
would be useful.

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kvm: fix compilation on s390
  2019-05-24 19:25 [PATCH] kvm: fix compilation on s390 Paolo Bonzini
@ 2019-05-24 19:54 ` Christian Borntraeger
  2019-05-24 19:56   ` Paolo Bonzini
  2019-05-24 20:24 ` Michal Kubecek
  1 sibling, 1 reply; 5+ messages in thread
From: Christian Borntraeger @ 2019-05-24 19:54 UTC (permalink / raw)
  To: Paolo Bonzini, linux-kernel, kvm; +Cc: mkubecek

On which kernel tree is this broken? kvm/queue has 

#ifdef CONFIG_ZONE_DEVICE
around that.

On 24.05.19 21:25, Paolo Bonzini wrote:
> s390 does not have memremap, even though in this particular case it
> would be useful.
> 
> 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)
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kvm: fix compilation on s390
  2019-05-24 19:54 ` Christian Borntraeger
@ 2019-05-24 19:56   ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2019-05-24 19:56 UTC (permalink / raw)
  To: Christian Borntraeger, linux-kernel, kvm; +Cc: mkubecek

On 24/05/19 21:54, Christian Borntraeger wrote:
> On which kernel tree is this broken? kvm/queue has 
> 
> #ifdef CONFIG_ZONE_DEVICE
> around that.

It's a better version of that patch in kvm/queue, which I had committed
just to temporarily unbreak you guys.

Paolo

> On 24.05.19 21:25, Paolo Bonzini wrote:
>> s390 does not have memremap, even though in this particular case it
>> would be useful.
>>
>> 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)
>>
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kvm: fix compilation on s390
  2019-05-24 19:25 [PATCH] kvm: fix compilation on s390 Paolo Bonzini
  2019-05-24 19:54 ` Christian Borntraeger
@ 2019-05-24 20:24 ` Michal Kubecek
  2019-05-24 20:45   ` Paolo Bonzini
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Kubecek @ 2019-05-24 20:24 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: linux-kernel, kvm

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kvm: fix compilation on s390
  2019-05-24 20:24 ` Michal Kubecek
@ 2019-05-24 20:45   ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2019-05-24 20:45 UTC (permalink / raw)
  To: Michal Kubecek; +Cc: linux-kernel, kvm

On 24/05/19 22:24, Michal Kubecek wrote:
> 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.

I see; I'll change it to "does not always have".

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-24 20:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 19:25 [PATCH] kvm: fix compilation on s390 Paolo Bonzini
2019-05-24 19:54 ` Christian Borntraeger
2019-05-24 19:56   ` Paolo Bonzini
2019-05-24 20:24 ` Michal Kubecek
2019-05-24 20:45   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).