Re: [PATCH v2] virtio_blk: unlock vblk-lock during kick

2012-05-30 Thread Christian Borntraeger
approaches to address this lock holding during kick but this looks like the less intrusive one. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com Acked-by: Christian Borntraeger borntrae...@de.ibm.com -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message

qemu core dump and filtering guest pages

2012-05-22 Thread Christian Borntraeger
Folks, today we discussed the situation of a qemu crash (with coredump) and big guests. Quite often the guest pages are not needed but make the core file pretty big. The most appealing proposal that we had was to adopt the core file code in the kernel to have an option for discarding guest

[PATCH 1/4] kvm-s390: add capability indicating COW support

2012-05-15 Thread Christian Borntraeger
and let the fault be delivered to the host, thus allowing COW. Use a capability bit to tell qemu if that is possible. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com Acked-by: Heiko Carstens heiko.carst...@de.ibm.com --- arch/s390/include/asm/sclp.h |1 + arch/s390/kvm/kvm-s390.c

[PATCH 2/4] kvm-s390: KVM_GET/SET_ONEREG for s390

2012-05-15 Thread Christian Borntraeger
From: Carsten Otte co...@de.ibm.com This patch enables KVM_CAP_ONE_REG for s390 and implements stubs for KVM_GET/SET_ONE_REG. This is based on the ppc implementation. Signed-off-by: Carsten Otte co...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/kvm

[PATCH 0/4] kvm-s390: feature patches

2012-05-15 Thread Christian Borntraeger
: epoch difference and TOD programmable field Christian Borntraeger (1): kvm-s390: add capability indicating COW support Jason J. herne (1): kvm-s390: onereg for timer related registers arch/s390/include/asm/kvm.h |5 +++ arch/s390/include/asm/sclp.h |1 + arch/s390/kvm/kvm-s390.c

[PATCH 4/4] kvm-s390: onereg for timer related registers

2012-05-15 Thread Christian Borntraeger
From: Jason J. herne jjhe...@us.ibm.com Enhance the KVM ONE_REG capability within S390 to allow getting/setting the following special cpu registers: clock comparator and the cpu timer. These are needed for migration. Signed-off-by: Jason J. herne jjhe...@us.ibm.com Signed-off-by: Christian

[PATCH 3/4] kvm-s390: epoch difference and TOD programmable field

2012-05-15 Thread Christian Borntraeger
-by: Carsten Otte co...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |3 +++ arch/s390/kvm/kvm-s390.c| 16 2 files changed, 19 insertions(+) diff --git a/arch/s390/include/asm/kvm.h b/arch/s390/include/asm/kvm.h index

Re: [PATCH 1/4] kvm-s390: add capability indicating COW support

2012-05-15 Thread Christian Borntraeger
On 15/05/12 14:24, Avi Kivity wrote: Newer systems allow to write-protect the guest backing memory and let the fault be delivered to the host, thus allowing COW. Use a capability bit to tell qemu if that is possible. Asking out of ignorance: who is doing the write protection here? The

Re: [PATCH 0/4] kvm-s390: feature patches

2012-05-15 Thread Christian Borntraeger
On 15/05/12 14:26, Avi Kivity wrote: Everything looks reasonable. These patches will miss 3.5 though since the merge window is so close, unless there's a reason to push them in. There is no pressing reason. Of course there are some qemu patches that use these features, but sooner or later

Re: [PATCH 1/4] kvm-s390: add capability indicating COW support

2012-05-15 Thread Christian Borntraeger
On 15/05/12 14:33, Avi Kivity wrote: On 05/15/2012 03:31 PM, Christian Borntraeger wrote: On 15/05/12 14:24, Avi Kivity wrote: Newer systems allow to write-protect the guest backing memory and let the fault be delivered to the host, thus allowing COW. Use a capability bit to tell qemu

[PATCH 0/1] Updated Patch for NR/MAX VCPU on s390

2012-05-02 Thread Christian Borntraeger
Marcelo, here is an updated patch. We will use 64 for max and supported numbers of vcpus. Christian Borntraeger (1): kvm-s390x: implement KVM_CAP_NR/MAX_VCPUS arch/s390/kvm/kvm-s390.c |4 1 file changed, 4 insertions(+) -- 1.7.9.6 -- To unsubscribe from this list: send the line

[PATCH 1/1] kvm-s390x: implement KVM_CAP_NR/MAX_VCPUS

2012-05-02 Thread Christian Borntraeger
Let userspace know the number of max and supported cpus for kvm on s390. Return KVM_MAX_VCPUS (currently 64) for both values. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/kvm-s390.c |4 1 file changed, 4 insertions(+) diff --git a/arch/s390/kvm/kvm-s390

Re: [PATCH 1/2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-26 Thread Christian Borntraeger
+kvm_for_each_vcpu(i, tcpu, kvm) +if (tcpu-vcpu_id == tid) { Wouldn't kvm_get_vcpu(kvm, tid) be what you want here? Would be better in terms of scalability, but we can do that only if kvm-vcpus[i].vcpu_id = i Is that always the case? Christian -- To unsubscribe from

[PATCH 2/2] kvm-s390: use kvm_vcpu_on_spin for diag 0x44

2012-04-25 Thread Christian Borntraeger
Lets replace the old open coded version of diag 0x44 (which relied on compat_sched_yield) with kvm_vcpu_on_spin. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/diag.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/s390/kvm/diag.c b

[PATCH 0/2] rework kvm_vcpu_on_spin

2012-04-25 Thread Christian Borntraeger
Avi, what about this approach? Christian Borntraeger (1): kvm-s390: use kvm_vcpu_on_spin for diag 0x44 Konstantin Weitz (1): kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM arch/s390/include/asm/kvm_host.h |1 + arch/s390/kvm/diag.c | 29

[PATCH 1/2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-25 Thread Christian Borntraeger
From: Konstantin Weitz weitz...@de.ibm.com This patch implements the directed yield hypercall found on other System z hypervisors. It delegates execution time to the virtual cpu specified in the instruction's parameter. Useful to avoid long spinlock waits in the guest. Christian Borntraeger

[PATCH 1/3] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-24 Thread Christian Borntraeger
Weitz weitz...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm_host.h |1 + arch/s390/kvm/diag.c | 44 ++ arch/s390/kvm/kvm-s390.c |1 + 3 files changed, 46 insertions(+) diff

[PATCH 2/3] kvm-s390: Handle sckpf instruction

2012-04-24 Thread Christian Borntraeger
From: Cornelia Huck cornelia.h...@de.ibm.com Handle the mandatory intercept SET CLOCK PROGRAMMABLE FIELD instruction. Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com --- arch/s390/kvm/intercept.c |1 + arch/s390/kvm/kvm-s390.h |1 + arch/s390/kvm/priv.c | 31

[PATCH 3/3] kvm-s390: implement KVM_CAP_MAX_VCPUS

2012-04-24 Thread Christian Borntraeger
Let userspace know the number of supported cpus fro kvm. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/kvm-s390.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index fd98914..0054cb0 100644 --- a/arch

[PATCH 0/3] Fixes and feature for kvm-s390

2012-04-24 Thread Christian Borntraeger
Avi, Marcelo, here are 3 patches for kvm on s390. One patch implements diag 9c (directed yield). Tthe two other patches implement a missing instruction and KVM_CAP_MAX_VCPUS. ALl 3 are targeted for the next merge window. Thanks Christian Christian Borntraeger (1): kvm-s390: implement

Re: [PATCH 1/3] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-24 Thread Christian Borntraeger
On 24/04/12 14:04, Avi Kivity wrote: [...] +int tid; +int i; + +tid = vcpu-run-s.regs.gprs[(vcpu-arch.sie_block-ipa 0xf0) 4]; +vcpu-stat.diagnose_9c++; +VCPU_EVENT(vcpu, 5, diag time slice end directed to %d, tid); + +if (tid == vcpu-vcpu_id) +return

Re: [PATCH 3/3] kvm-s390: implement KVM_CAP_MAX_VCPUS

2012-04-24 Thread Christian Borntraeger
@@ -136,6 +136,9 @@ int kvm_dev_ioctl_check_extension(long ext) case KVM_CAP_SYNC_REGS: r = 1; break; +case KVM_CAP_NR_VCPUS: +r = KVM_MAX_VCPUS; +break; default: r = 0; } This looks like a bugfix, but

[PATCH 1/3v2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-24 Thread Christian Borntraeger
Weitz weitz...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm_host.h |1 + arch/s390/kvm/diag.c | 41 ++ arch/s390/kvm/kvm-s390.c |1 + 3 files changed, 43 insertions(+) diff

Re: [PATCH 1/3v2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-24 Thread Christian Borntraeger
I think the code will me more readable, and less obvious that is was copied from kvm_vcpu_on_spin(), if you put all the processing outside the loop, except for matching the vpu itself. So the code reads find a vcpu obtain the task do the yield instead of looking like you're

Re: [PATCH 1/3v2] kvm-s390: Implement the directed yield (diag 9c) hypervisor call for KVM

2012-04-24 Thread Christian Borntraeger
On 24/04/12 18:15, Avi Kivity wrote: instead of looking like you're doing the processing for every vcpu. The loop is just a slow lookup which might some day be replaced by a table lookup. Ok. We might also have a kvm_vcpu_on_spin_directed in common code, Would you prefer that? You mean

Re: [PATCH v2] KVM: x86: add paging gcc optimization

2012-03-08 Thread Christian Borntraeger
On 08/03/12 12:45, Davidlohr Bueso wrote: From: Davidlohr Bueso d...@gnu.org Since most guests will have paging enabled for memory management, add likely() optimization around CR0.PG checks. { - return kvm_read_cr0_bits(vcpu, X86_CR0_PG); + return likely(kvm_read_cr0_bits(vcpu,

Re: Pe: [PATCH v5 1/3] virtio-scsi: first version

2012-02-12 Thread Christian Borntraeger
On 12/02/12 21:16, James Bottomley wrote: Well, no-one's yet answered the question I had about why. Just to give one example from a different angle: In the big datacenters tape libraries are still very important, and lots of them have a scsi attachement. virtio-blk certainly is not the right

Re: Pe: [PATCH v5 1/3] virtio-scsi: first version

2012-02-07 Thread Christian Borntraeger
+cmd-req.cmd = (struct virtio_scsi_cmd_req){ +.lun[0] = 1, +.lun[1] = sc-device-id, +.lun[2] = (sc-device-lun 8) | 0x40, +.lun[3] = sc-device-lun

Re: Pe: [PATCH v5 1/3] virtio-scsi: first version

2012-02-07 Thread Christian Borntraeger
On 07/02/12 13:31, Paolo Bonzini wrote: The structure of the LUN is defined by SAM, not by me. Ok, got it. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Fixed restart patch

2012-02-07 Thread Christian Borntraeger
Avi, Marcelo, here is an updated version of patch 3 taking care of Carstens finding. It also handles invalid target cpus more gracefully. Tested and lockdep-approved. Jens Freimann (1): kvm-s390: make sigp restart return busy when stop pending arch/s390/kvm/sigp.c | 31

[PATCH 3/6 v2] kvm-s390: make sigp restart return busy when stop pending

2012-02-07 Thread Christian Borntraeger
it's possible that the restart is delivered before the old stop. This means that the IPL CPU isn't restarted and we have no running CPUs. So let's make sure that there is no stop action pending when we do the restart. Signed-off-by: Jens Freimann jf...@linux.vnet.ibm.com Signed-off-by: Christian

[PATCH 0/6] Fixes for kvm on s390

2012-02-06 Thread Christian Borntraeger
atomic problem. - 3.3? Patches 3-5 are bugs but can wait - next Patches 6 extends to sync register feature to control registers. - next Christian Christian Borntraeger (2): kvm-s390: Sanitize fpc registers for KVM_SET_FPU kvm-s390: provide control registers via kvm_run Jens Freimann (4

[PATCH 3/6] kvm-s390: make sigp restart return busy when stop pending

2012-02-06 Thread Christian Borntraeger
it's possible that the restart is delivered before the old stop. This means that the IPL CPU isn't restarted and we have no running CPUs. So let's make sure that there is no stop action pending when we do the restart. Signed-off-by: Jens Freimann jf...@linux.vnet.ibm.com Signed-off-by: Christian

[PATCH 5/6] kvm-s390: add stop_on_stop flag when doing stop and store

2012-02-06 Thread Christian Borntraeger
From: Jens Freimann jf...@linux.vnet.ibm.com When we do a stop and store status we need to pass ACTION_STOP_ON_STOP flag to __sigp_stop(). Signed-off-by: Jens Freimann jf...@linux.vnet.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/sigp.c |3 ++- 1

[PATCH 1/6] kvm-s390: Sanitize fpc registers for KVM_SET_FPU

2012-02-06 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com commit 7eef87dc99e419b1cc051e4417c37e4744d7b661 (KVM: s390: fix register setting) added a load of the floating point control register to the KVM_SET_FPU path. Lets make sure that the fpc is valid. Signed-off-by: Christian Borntraeger borntrae

[PATCH 6/6] kvm-s390: provide control registers via kvm_run

2012-02-06 Thread Christian Borntraeger
There are several cases were we need the control registers for userspace. Lets also provide those in kvm_run. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |2 ++ arch/s390/kvm/kvm-s390.c|9 - 2 files changed, 10 insertions(+), 1

[PATCH 2/6] kvm-s390: do store status after handling STOP_ON_STOP bit

2012-02-06 Thread Christian Borntraeger
sleep. Since local_int.lock only protects local_int.* and not guest memory we can give up the lock. Signed-off-by: Jens Freimann jf...@linux.vnet.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/intercept.c | 20 1 files changed, 12

Re: [PATCH 3/6] kvm-s390: make sigp restart return busy when stop pending

2012-02-06 Thread Christian Borntraeger
On 06/02/12 12:53, Carsten Otte wrote: Am 06.02.2012 10:59, schrieb Christian Borntraeger: +static int __sigp_restart(struct kvm_vcpu *vcpu, u16 cpu_addr) +{ +int rc = 0; +struct kvm_s390_float_interrupt *fi =vcpu-kvm-arch.float_int; + +spin_lock(fi-lock); +if (fi-local_int

Re: [PATCH 4/4 v3] KVM: Introduce kvm_memory_slot::arch and move lpage_info into it

2012-01-30 Thread Christian Borntraeger
On 31/01/12 02:17, Takuya Yoshikawa wrote: Added s390 and ppc developers to Cc, (2012/01/30 14:35), Takuya Yoshikawa wrote: Some members of kvm_memory_slot are not used by every architecture. This patch is the first step to make this difference clear by introducing kvm_memory_slot::arch;

kvm-s390: prep cleanup for sync registers patch series

2012-01-11 Thread Christian Borntraeger
Avi, Marcelo, here is a patch that reworks the setting of the prefix register. It is a prereq for the prefix patch in the following patch series about the sync registers in kvm_run. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[PATCH] kvm-s390: rework code that sets the prefix

2012-01-11 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com There are several places in the kvm module, which set the prefix register. Since we need to flush the cpu, lets combine this operation into a helper function. This helper will also explicitely mask out the unused bits. Signed-off-by: Christian

[PATCH 2/4] kvm-s390: provide the prefix register via kvm_run

2012-01-11 Thread Christian Borntraeger
Add the prefix register to the synced register field in kvm_run. While we need the prefix register most of the time read-only, this patch also adds handling for guest dirtying of the prefix register. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h

[PATCH 4/4] kvm-s390: provide access guest registers via kvm_run

2012-01-11 Thread Christian Borntraeger
This patch adds the access registers to the kvm_run structure. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |2 ++ arch/s390/include/asm/kvm_host.h |1 - arch/s390/kvm/kvm-s390.c | 16 +--- 3 files changed, 11

kvm: provide synchronous registers in kvm_run

2012-01-11 Thread Christian Borntraeger
Avi, Marcelo, here is the next version of the sync register patch series. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 3/4] kvm-s390: provide general purpose guest registers via kvm_run

2012-01-11 Thread Christian Borntraeger
This patch adds the general purpose registers to the kvm_run structure. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |2 ++ arch/s390/include/asm/kvm_host.h |3 +-- arch/s390/kvm/diag.c |6 +++--- arch/s390/kvm

Re: synchronous register in kvm_run

2012-01-09 Thread Christian Borntraeger
On 05/01/12 10:54, Christian Borntraeger wrote: Avi, Marcelo, here is the latest update of my patch set about guest registers in kvm_run. I have added an u64 flag field to make the whole structure extensible (and shrinkable). For s390 I added the prefix register as read-only and access

[PATCH 2/4] kvm-s390: provide the prefix register via kvm_run

2012-01-05 Thread Christian Borntraeger
The prefix register is a read-mostly value that is necessary to emulate memory accesses on behalf of the guest cpu in an architecture compliant way. Avoid an additional ioctl by providing the prefix content in the r/o section of kvm_run. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com

[PATCH 1/4] kvm: provide synchronous registers in kvm_run

2012-01-05 Thread Christian Borntraeger
will define that a group of registers (like general purpose) or a single register is valid. In that way we can extend and shrink the interface. (The structure definition itself can only grow of course). Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- Documentation/virtual/kvm/api.txt | 28

[PATCH 3/4] kvm-s390: provide general purpose guest registers via kvm_run

2012-01-05 Thread Christian Borntraeger
This patch adds the general purpose registers to the kvm_run structure. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |2 ++ arch/s390/include/asm/kvm_host.h |3 +-- arch/s390/kvm/diag.c |6 +++--- arch/s390/kvm

[PATCH 4/4] kvm-s390: provide access guest registers via kvm_run

2012-01-05 Thread Christian Borntraeger
This patch adds the access registers to the kvm_run structure. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm.h |2 ++ arch/s390/include/asm/kvm_host.h |1 - arch/s390/kvm/kvm-s390.c | 15 --- 3 files changed, 10

synchronous register in kvm_run

2012-01-05 Thread Christian Borntraeger
Avi, Marcelo, here is the latest update of my patch set about guest registers in kvm_run. I have added an u64 flag field to make the whole structure extensible (and shrinkable). For s390 I added the prefix register as read-only and access and general purpose as read write. -- To unsubscribe from

Re: [PATCH 3/3] kvm-s390: provide standard guest registers via kvm_run

2012-01-04 Thread Christian Borntraeger
On 04/01/12 09:16, Heiko Carstens wrote: save_fp_regs(vcpu-arch.host_fpregs); save_access_regs(vcpu-arch.host_acrs); -vcpu-arch.guest_fpregs.fpc = FPC_VALID_MASK; -restore_fp_regs(vcpu-arch.guest_fpregs); -restore_access_regs(vcpu-arch.guest_acrs); +

[patch 1/3] kvm: provide synchronous registers in kvm_run

2011-12-22 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com On some cpus the overhead for virtualization instructions is in the same range as a system call. Having to call multiple ioctls to get set registers will make userspace handled exits more expensive than necessary. Lets provide two sections

[patch 3/3] kvm-s390: provide general purpose registers via kvm_run

2011-12-22 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com The general purpose registers are often necessary to handle SIE exits. Avoid additional ioctls by providing the guest registers in the r/w section of the kvm_run structure. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch

[patch 0/3] RFC: provide synchronous registers in kvm_run

2011-12-22 Thread Christian Borntraeger
Avi, Marcelo, currently userspace can access guest registers via several ioctls. Some of these registers might be useful very often. Here the system call overhead for ioctl can make an exit more expensive than necessary. In a discussion with Alex Graf we concluded that it might be beneficial to

[patch 2/3] kvm-s390: provide the prefix register via kvm_run

2011-12-22 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com The prefix register is a read-mostly value that is necessary to emulate memory accesses in an architecture compliant-way. Avoid an additional ioctl by providing the prefix content in the r/o section of kvm_run. Signed-off-by: Christian

Re: [patch 3/3] kvm-s390: provide general purpose registers via kvm_run

2011-12-22 Thread Christian Borntraeger
On 22/12/11 13:34, Avi Kivity wrote: The general purpose registers are often necessary to handle SIE exits. Avoid additional ioctls by providing the guest registers in the r/w section of the kvm_run structure. This is only needed for S390_UCONTROL? No for the standard path. It was more

Re: [patch 0/3] RFC: provide synchronous registers in kvm_run

2011-12-22 Thread Christian Borntraeger
On 22/12/11 13:54, Avi Kivity wrote: My main concern was the prefix register (this is a per cpu register that defines the address of two pages that are swapped with the pages at 0 for this cpu). SMP on s390 is done that way (e.g. interrupt things are stored in page 0 for this cpu) The

[PATCH]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs

2011-12-20 Thread Christian Borntraeger
Avi, Marcelo, let me know if you would prefer to reuse another register load/save ioctls that is still unused for s390 (e.g. XCRS). From: Christian Borntraeger borntrae...@de.ibm.com For guest relocation and virsh dump qemu needs an interface to get/set additional registers from kvm. We also

Re: [PATCH]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs

2011-12-20 Thread Christian Borntraeger
arch/s390/include/asm/kvm.h |9 + arch/s390/kvm/kvm-s390.c| 24 include/linux/kvm.h |4 3 files changed, 37 insertions(+) The lack of documentation is not. Ok, will do. @@ -673,6 +674,29 @@ long kvm_arch_vcpu_ioctl(struct

[PATCH 1/2]: kvm-s390: use guest flush inline function

2011-12-20 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com Move all open-coded guest flush operations into an inline function. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/interrupt.c |2 +- arch/s390/kvm/kvm-s390.c |2 +- arch/s390/kvm/kvm-s390.h |7

[PATCH 2/2]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs

2011-12-20 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com For guest relocation and virsh dump qemu needs an interface to get/set additional registers from kvm. We also need the prefix register for all guest memory accesses to the prefix pages. The prefix register could also be set via

Re: [PATCH 2/2]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs

2011-12-20 Thread Christian Borntraeger
On 20/12/11 15:20, Alexander Graf wrote: +Reads special registers from the vcpu which are not covered by sregs. + +/* s390x */ +struct kvm_sregs2 { +__u64 ckc; /* clock comparator */ +__u64 cputm;/* cpu timer */ +__u64 gbea; /* guest breaking event address */ +

Re: [PATCH 2/2]: kvm-s390: add KVM_S390_GET/SET_SREGS2 call for additional hw regs

2011-12-20 Thread Christian Borntraeger
On 20/12/11 17:28, Alexander Graf wrote: Would it make sense to instead use the GET_ONE_REG and SET_ONE_REG interfaces? http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/80854 What is the status of these patches? - Is the interface limited to 56 registers? (see the ID) Uh.

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Christian Borntraeger
On 15/12/11 17:11, Heiko Carstens wrote: Why again is this needed? Or put in other words: what prevents a guest to change the storage key contents via sske of a page that is mapped read-only into the guest address space? As far as I can see: nothing. Interestingly I could -in theory- do some

Re: [patch 2/4] [PATCH] kvm-s390: handle SIGP sense running intercepts.

2011-11-17 Thread Christian Borntraeger
On 17/11/11 11:15, Avi Kivity wrote: On 11/17/2011 12:00 PM, Carsten Otte wrote: From: Cornelia Huck cornelia.h...@de.ibm.com SIGP sense running may cause an intercept on higher level virtualization, so handle it by checking the CPUSTAT_RUNNING flag. What does higher level virtualization

Re: [patch 2/2] [PATCH] kvm-s390: pseudo page fault support

2011-11-17 Thread Christian Borntraeger
+VCPU_EVENT(vcpu, 5, synchronous page fault at guest %lx user %lx, + current-thread.gmap_addr, uaddr); + +fault_in_pages_readable((char __user *)uaddr, PAGE_SIZE); +} These may make sense as tracepoints (this is what x86 does). The kvm_stat script knows how to pick

[patch 0/4] Fixes for kvm-s390

2011-10-18 Thread Christian Borntraeger
Avi, Marcelo, here are 4 fixes for kvm on s390: 1. check cpu_id prior to using it 2. fix return value of kvm_arch_init_vm 3. fix register setting 4. implement sigp external call All patches have been tested in house and should be ok for the next merge windows. Patch 1 fixes a potential index

[patch 2/4] kvm-s390: fix return value of kvm_arch_init_vm

2011-10-18 Thread Christian Borntraeger
From: Carsten Otte co...@de.ibm.com This patch fixes the return value of kvm_arch_init_vm in case a memory allocation goes wrong. Signed-off-by: Carsten Otte co...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm/kvm-s390.c |2 ++ 1 file changed, 2

[patch 3/4] kvm-s390: fix register setting

2011-10-18 Thread Christian Borntraeger
registers and overwrites the new content 3b. vcpu put loads the userspace register set again This patch loads the new guest register state into the cpu, so that the correct (new) set of guest registers will be stored in step 3a. Signed-off-by: Carsten Otte co...@de.ibm.com Signed-off-by: Christian

[patch 4/4] kvm-s390: implement sigp external call

2011-10-18 Thread Christian Borntraeger
Ehrhardt ehrha...@linux.vnet.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm_host.h |7 ++ arch/s390/kvm/interrupt.c| 30 ++ arch/s390/kvm/kvm-s390.c |2 + arch/s390/kvm/sigp.c | 45

[patch 1/4] kvm-s390: check cpu_id prior to using it

2011-10-18 Thread Christian Borntraeger
From: Carsten Otte co...@de.ibm.com We use the cpu id provided by userspace as array index here. Thus we clearly need to check it first. Ooops. CC: sta...@vger.kernel.org Signed-off-by: Carsten Otte co...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/kvm

[RFC/PATCH] kvm: Handle diagnose 0x10 (release pages)

2011-10-14 Thread Christian Borntraeger
on diagnose 0x10. (aka as collaborative memory management). This patch implements diagnose 0x10 on the guest address space. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- arch/s390/include/asm/kvm_host.h |1 arch/s390/include/asm/pgtable.h |1 arch/s390/kvm/diag.c

Re: [RFC/PATCH] virtio-console: wait for console ports

2011-09-22 Thread Christian Borntraeger
On 22/09/11 12:08, Amit Shah wrote: +/* If there was an early virtio console, assume that there are no + * other consoles. We need to wait until the hvc_alloc matches the + * hvc_instantiate, otherwise tty_open will complain, resulting in + * a Warning: unable to open an

[PATCHv2] virtio-console: wait for console ports

2011-09-22 Thread Christian Borntraeger
-guest interaction is required before hvc_alloc is called. This might be too late, especially if an initramfs is involved. Lets use a completion if we have multiport and an early console. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- drivers/char/virtio_console.c | 20

Re: [PATCH 0/1] virtio: console: fix for early console

2011-09-22 Thread Christian Borntraeger
On 22/09/11 20:14, Amit Shah wrote: Hi Rusty, This is a fix from Christian for early console handling with multiport support. Please apply. Christian, I've made some changes to the patch as noted in the commit message. Nothing major, but an ACK would be nice. The changes look fine.

[RFC/PATCH] virtio-console: wait for console ports

2011-09-21 Thread Christian Borntraeger
-by: Christian Borntraeger borntrae...@de.ibm.com --- drivers/char/virtio_console.c | 18 ++ 1 file changed, 18 insertions(+) Index: b/drivers/char/virtio_console.c === --- a/drivers/char/virtio_console.c +++ b/drivers

RFC: s390: extension capability for new address space layout

2011-09-20 Thread Christian Borntraeger
to be submitted via the s390 stream for 3.1. Christian Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -123,6 +123,7 @@ int kvm_dev_ioctl_check_extension(long ext) switch (ext) { case KVM_CAP_S390_PSW

Re: RFC: s390: extension capability for new address space layout

2011-09-20 Thread Christian Borntraeger
On 20/09/11 14:00, Alexander Graf wrote: +#define KVM_CAP_S390_GMAP 66 I would really appreciate if you could take capability number 71. I already have patches pending (partly already in avi's tree) that occupy everything up to 70 :) Whatever number is best for you all. Just waiting for

[PATCH] s390 Fix address mode switching

2011-09-20 Thread Christian Borntraeger
discussed with Martin Schwidefsky. Christian From: Christian Borntraeger borntrae...@de.ibm.com 598841ca9919d008b520114d8a4378c4ce4e40a1 ([S390] use gmap address spaces for kvm guest images) changed kvm to use a separate address space for kvm guests. This address space was switched in __vcpu_run

Re: [PATCH] kvm-s390: userspace access to guest storage keys

2011-05-10 Thread Christian Borntraeger
On 09/05/11 13:32, Alexander Graf wrote: On 09.05.2011, at 13:20, Avi Kivity wrote: On 05/09/2011 01:11 PM, Alexander Graf wrote: And not in main memory, either? Nope - storage keys are only accessible using special instructions. They're not in RAM (visible to a guest) :).

Re: [PATCH] KVM: Clean up vm creation and release

2010-11-09 Thread Christian Borntraeger
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 985d825..d8d1877 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -164,24 +164,18 @@ long kvm_arch_vm_ioctl(struct file *filp, return r; } -struct kvm *kvm_arch_create_vm(void) +int

Re: [PATCH] KVM: Clean up vm creation and release

2010-11-09 Thread Christian Borntraeger
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 985d825..d8d1877 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -164,24 +164,18 @@ long kvm_arch_vm_ioctl(struct file *filp, return r; } -struct kvm *kvm_arch_create_vm(void) +int

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 23.08.2010 23:31, schrieb Alexander Graf: Currenty the ext_param field only distinguishes between config change and vring interrupt. We can do a lot more with it though, so let's enable a full byte of possible values and constants to #defines while at it. Makes a lot of sense. [...]

Re: [PATCH 2/2] S390: Add virtio hotplug add support

2010-08-24 Thread Christian Borntraeger
leverage the functionality. Signed-off-by: Alexander Graf ag...@suse.de With the minor nits below fixed: Acked-by: Christian Borntraeger borntrae...@de.ibm.com #define VIRTIO_PARAM_MASK0xff #define VIRTIO_PARAM_VRING_INTERRUPT 0x0 #define VIRTIO_PARAM_CONFIG_CHANGED 0x1 +#define

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 24.08.2010 14:06, schrieb Alexander Graf: #define VIRTIO_SUBCODE_64 0x0D00 +#define VIRTIO_PARAM_MASK 0xff +#define VIRTIO_PARAM_VRING_INTERRUPT 0x0 +#define VIRTIO_PARAM_CONFIG_CHANGED0x1 Maybe this should be exported in a header, something like

Re: [PATCH 1/2] S390: take a full byte as ext_param indicator

2010-08-24 Thread Christian Borntraeger
Am 24.08.2010 14:22, schrieb Avi Kivity: First of all we need a virtio/s390 specification, like we have a virtio/pci spec. Here is something that I started a year ago but never finished. Christian guest/host interface for s390/virtio devices KVM_DEVICE_DESCRIPTOR PAGE

Re: kvm-s390: Dont exit SIE on SIGP sense running

2010-06-21 Thread Christian Borntraeger
Am Montag 21 Juni 2010, 10:27:50 schrieb Avi Kivity: [...] VCPU_EVENT(vcpu, 3, %s, free cpu); + clear_bit(63 - vcpu-vcpu_id, (unsigned long *)vcpu-kvm-arch.sca-mcn); if (vcpu-kvm-arch.sca-cpu[vcpu-vcpu_id].sda == (__u64) vcpu-arch.sie_block)

kvm-s390: Dont exit SIE on SIGP sense running

2010-06-17 Thread Christian Borntraeger
Avi, Marcello, Newer (guest) kernels use sigp sense running in their spinlock implementation to check if the other cpu is running before yielding the processor. This revealed some wrong guest settings, causing unnecessary exits for every sigp sense running. Signed-off-by: Christian Borntraeger

Re: [PATCH 3/3] arch/s390/kvm: Use GFP_ATOMIC when a lock is held

2010-05-31 Thread Christian Borntraeger
The containing function is called from several places. At one of them, in the function __sigp_stop, the spin lock fi-lock is held. [...] Signed-off-by: Julia Lawall ju...@diku.dk Acked-by: Christian Borntraeger borntrae...@de.ibm.com [...] --- a/arch/s390/kvm/sigp.c +++ b/arch/s390/kvm

[PATCH] kvm-s390: fix potential array overrun in intercept handling

2010-01-21 Thread Christian Borntraeger
array overflow if code == 0x48. Since the table is only populated up to (0x28 2), we can reduce the jump table size while fixing the off-by-one. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- (patch was refreshed with -U8 to see the full jump table.) arch/s390/kvm/intercept.c

[PATCHv2] kvm-s390: fix potential array overrun in intercept handling

2010-01-21 Thread Christian Borntraeger
which would cause an off-by-one array overflow if code == 0x48. Use the compiler and ARRAY_SIZE to automatically set the limits. Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- (patch was refreshed with -U8 to see the full jump table.) arch/s390/kvm/intercept.c |4 ++-- 1

Re: [PATCHv2] kvm-s390: fix potential array overrun in intercept handling

2010-01-21 Thread Christian Borntraeger
Am Donnerstag 21 Januar 2010 12:24:18 schrieb Heiko Carstens: - if (code 3 || code 0x48) + if (code 3 || (code 2) = ARRAY_SIZE(intercept_funcs)) return -ENOTSUPP; Not that it matters for this patch, but -ENOTSUPP should not leak to userspace. Not sure if it does

Re: [PATCH] qemu-kvm: fix __user export

2009-12-02 Thread Christian Borntraeger
Am Montag 30 November 2009 13:02:08 schrieb Michael S. Tsirkin: __user macro does not appear in exported headers and should not be in headers qemu-kvm includes. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- kvm/include/linux/kvm.h |2 +- 1 files changed, 1 insertions(+), 1

Re: [PATCH] qemu-kvm: fix __user export

2009-12-02 Thread Christian Borntraeger
This is in the copy of the headers that qemu-kvm.git carries, not the kernel master. Right, I missed that. Thanks -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH] kvm-s390: fix memsize =4G on linus git head

2009-09-21 Thread Christian Borntraeger
Avi, Marcelo, commit 628eb9b8a8f3ef31d8316112a4596b1a21b38159 KVM: s390: streamline memslot handling introduced kvm_s390_vcpu_get_memsize. This broke guests =4G, since this function returned an int. This patch changes the return value to a long. Signed-off-by: Christian Borntraeger

Re: [PATCH] virtio-blk: set QUEUE_ORDERED_DRAIN by default

2009-08-21 Thread Christian Borntraeger
-by: Christian Borntraeger borntrae...@de.ibm.com [...] - /* If barriers are supported, tell block layer that queue is ordered */ + /* + * If barriers are supported, tell block layer that queue is ordered. + * + * If no barriers are supported assume the host uses

[patch 0/3] fixes for kvm on s390

2009-06-23 Thread Christian Borntraeger
Hello Avi, here are three patches against kvm.git that fix several issues in our kvm port. Please review and consider all patches for 2.6.31. Christian -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[patch 3/3] kvm-s390: Remove some unused variables

2009-06-23 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com This patch fixes the following warnings that were introduced by commit 2921292f45733bccdb53e426bcf65ceb13f53d94 Author: Gleb Natapov g...@redhat.com KVM: Use macro to iterate over vcpus. arch/s390/kvm/kvm-s390.c: In function

[patch 2/3] kvm-s390: Allow stfle instruction in the guest

2009-06-23 Thread Christian Borntraeger
From: Christian Borntraeger borntrae...@de.ibm.com 2.6.31-rc introduced an architecture level set checker based on facility bits. e.g. if the kernel is compiled to run only on z9, several facility bits are checked very early and the kernel refuses to boot if a z9 specific facility is missing

<    5   6   7   8   9   10   11   >