* [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset
@ 2010-05-14 14:14 Alexander Graf
2010-05-18 19:24 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2010-05-14 14:14 UTC (permalink / raw)
To: qemu-devel Developers; +Cc: Carsten Otte, Aurelien Jarno
For SMP to work with KVM, we need to properly emulate the SIGP Initial Reset
Command. Recent (2.6.32) kernels issue that before the SIGP Reset command that
actually wakes up the vcpu.
This patch makes -smp work on S390x.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
target-s390x/kvm.c | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index a2d7741..9bf6abb 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -344,9 +344,20 @@ static int s390_store_status(CPUState *env, uint32_t parameter)
static int s390_cpu_initial_reset(CPUState *env)
{
- /* XXX */
- fprintf(stderr, "XXX SIGP init\n");
- return -1;
+ int i;
+
+ if (kvm_vcpu_ioctl(env, KVM_S390_INITIAL_RESET, NULL) < 0) {
+ perror("cannot init reset vcpu");
+ }
+
+ /* Manually zero out all registers */
+ cpu_synchronize_state(env);
+ for (i = 0; i < 16; i++) {
+ env->regs[i] = 0;
+ }
+
+ dprintf("DONE: SIGP initial reset: %p\n", env);
+ return 0;
}
static int handle_sigp(CPUState *env, struct kvm_run *run, uint8_t ipa1)
--
1.6.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset
2010-05-14 14:14 [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset Alexander Graf
@ 2010-05-18 19:24 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2010-05-18 19:24 UTC (permalink / raw)
To: Alexander Graf; +Cc: Carsten Otte, qemu-devel Developers
On Fri, May 14, 2010 at 04:14:31PM +0200, Alexander Graf wrote:
> For SMP to work with KVM, we need to properly emulate the SIGP Initial Reset
> Command. Recent (2.6.32) kernels issue that before the SIGP Reset command that
> actually wakes up the vcpu.
>
> This patch makes -smp work on S390x.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
Thanks, applied.
> ---
> target-s390x/kvm.c | 17 ++++++++++++++---
> 1 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
> index a2d7741..9bf6abb 100644
> --- a/target-s390x/kvm.c
> +++ b/target-s390x/kvm.c
> @@ -344,9 +344,20 @@ static int s390_store_status(CPUState *env, uint32_t parameter)
>
> static int s390_cpu_initial_reset(CPUState *env)
> {
> - /* XXX */
> - fprintf(stderr, "XXX SIGP init\n");
> - return -1;
> + int i;
> +
> + if (kvm_vcpu_ioctl(env, KVM_S390_INITIAL_RESET, NULL) < 0) {
> + perror("cannot init reset vcpu");
> + }
> +
> + /* Manually zero out all registers */
> + cpu_synchronize_state(env);
> + for (i = 0; i < 16; i++) {
> + env->regs[i] = 0;
> + }
> +
> + dprintf("DONE: SIGP initial reset: %p\n", env);
> + return 0;
> }
>
> static int handle_sigp(CPUState *env, struct kvm_run *run, uint8_t ipa1)
> --
> 1.6.0.2
>
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-18 19:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14 14:14 [Qemu-devel] [PATCH] [S390] [KVM] Enable SIGP Initial Reset Alexander Graf
2010-05-18 19:24 ` Aurelien Jarno
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).