public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Carsten Otte <cotte@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	KVM <kvm@vger.kernel.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [patch 1/3] kvm-s390: Fix memslot initialization for userspace_addr != 0
Date: Tue, 23 Jun 2009 17:24:06 +0200	[thread overview]
Message-ID: <20090623152725.354167000@de.ibm.com> (raw)
In-Reply-To: 20090623152405.582759000@de.ibm.com

[-- Attachment #1: fix_memslot.patch --]
[-- Type: text/plain, Size: 1445 bytes --]

From: Christian Borntraeger <borntraeger@de.ibm.com>

Since
commit 854b5338196b1175706e99d63be43a4f8d8ab607
Author: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
    KVM: s390: streamline memslot handling

s390 uses the values of the memslot instead of doing everything in the arch
ioctl handler of the KVM_SET_USER_MEMORY_REGION. Unfortunately we missed to
set the userspace_addr of our memslot due to our s390 ifdef in 
__kvm_set_memory_region.
Old s390 userspace launchers did not notice, since they started the guest at
userspace address 0. 
Because of CONFIG_DEFAULT_MMAP_MIN_ADDR we now put the guest at 1M userspace,
which does not work. This patch makes sure that new.userspace_addr is set
on s390.
This fix should go in quickly. Nevertheless, looking at the code we should
clean up that ifdef in the long term. Any kernel janitors?

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 virt/kvm/kvm_main.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: kvm/virt/kvm/kvm_main.c
===================================================================
--- kvm.orig/virt/kvm/kvm_main.c
+++ kvm/virt/kvm/kvm_main.c
@@ -1199,6 +1199,10 @@ int __kvm_set_memory_region(struct kvm *
 		if (old.npages)
 			kvm_arch_flush_shadow(kvm);
 	}
+#else  /* not defined CONFIG_S390 */
+	new.user_alloc = user_alloc;
+	if (user_alloc)
+		new.userspace_addr = mem->userspace_addr;
 #endif /* not defined CONFIG_S390 */
 
 	if (!npages)


  reply	other threads:[~2009-06-23 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 15:24 [patch 0/3] fixes for kvm on s390 Christian Borntraeger
2009-06-23 15:24 ` Christian Borntraeger [this message]
2009-06-23 15:24 ` [patch 2/3] kvm-s390: Allow stfle instruction in the guest Christian Borntraeger
2009-06-23 15:24 ` [patch 3/3] kvm-s390: Remove some unused variables Christian Borntraeger
2009-06-24  8:09 ` [patch 0/3] fixes for kvm on s390 Avi Kivity
2009-06-24  8:18   ` Christian Bornträger
2009-06-24  9:18     ` Avi Kivity
2009-06-24  9:23       ` Christian Bornträger

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=20090623152725.354167000@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=avi@redhat.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox