1 From 56018228deac6e704a7ec8befd9e9dc69f2fe73f Mon Sep 17 00:00:00 2001
2 From: Blue Swirl <blauwirbel@gmail.com>
3 Date: Sun, 2 Sep 2012 07:33:35 +0000
4 Subject: [PATCH] target-s390x: rename op_helper.c to misc_helper.c
6 Now op_helper.c contains miscellaneous helpers, rename
9 Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 Signed-off-by: Alexander Graf <agraf@suse.de>
13 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
15 target-s390x/Makefile.objs | 6 +-
16 target-s390x/cpu.h | 2 +-
17 target-s390x/misc_helper.c | 428 +++++++++++++++++++++++++++++++++++++++++++++
18 target-s390x/op_helper.c | 428 ---------------------------------------------
19 4 files changed, 432 insertions(+), 432 deletions(-)
20 create mode 100644 target-s390x/misc_helper.c
21 delete mode 100644 target-s390x/op_helper.c
23 diff --git a/target-s390x/Makefile.objs b/target-s390x/Makefile.objs
24 index b9b3061..a87d26f 100644
25 --- a/target-s390x/Makefile.objs
26 +++ b/target-s390x/Makefile.objs
28 -obj-y += translate.o op_helper.o helper.o cpu.o interrupt.o
29 -obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o
30 +obj-y += translate.o helper.o cpu.o interrupt.o
31 +obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
32 obj-$(CONFIG_SOFTMMU) += machine.o
33 obj-$(CONFIG_KVM) += kvm.o
35 -$(obj)/op_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
36 $(obj)/int_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
37 $(obj)/fpu_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
38 $(obj)/cc_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
39 $(obj)/mem_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
40 +$(obj)/misc_helper.o: QEMU_CFLAGS += $(HELPER_CFLAGS)
41 diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h
42 index 97fde5e..0ccb551 100644
43 --- a/target-s390x/cpu.h
44 +++ b/target-s390x/cpu.h
45 @@ -1005,7 +1005,7 @@ uint32_t set_cc_f64(float64 v1, float64 v2);
46 uint32_t set_cc_nz_f32(float32 v);
47 uint32_t set_cc_nz_f64(float64 v);
51 void program_interrupt(CPUS390XState *env, uint32_t code, int ilc);
54 diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c
56 index 0000000..1d5137f
58 +++ b/target-s390x/misc_helper.c
61 + * S/390 misc helper routines
63 + * Copyright (c) 2009 Ulrich Hecht
64 + * Copyright (c) 2009 Alexander Graf
66 + * This library is free software; you can redistribute it and/or
67 + * modify it under the terms of the GNU Lesser General Public
68 + * License as published by the Free Software Foundation; either
69 + * version 2 of the License, or (at your option) any later version.
71 + * This library is distributed in the hope that it will be useful,
72 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
73 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74 + * Lesser General Public License for more details.
76 + * You should have received a copy of the GNU Lesser General Public
77 + * License along with this library; if not, see <http://www.gnu.org/licenses/>.
83 +#include "dyngen-exec.h"
84 +#include "host-utils.h"
88 +#include "qemu-timer.h"
90 +#include <linux/kvm.h>
93 +#if !defined(CONFIG_USER_ONLY)
94 +#include "softmmu_exec.h"
98 +/* #define DEBUG_HELPER */
100 +#define HELPER_LOG(x...) qemu_log(x)
102 +#define HELPER_LOG(x...)
105 +/* raise an exception */
106 +void HELPER(exception)(uint32_t excp)
108 + HELPER_LOG("%s: exception %d\n", __func__, excp);
109 + env->exception_index = excp;
110 + cpu_loop_exit(env);
113 +#ifndef CONFIG_USER_ONLY
114 +void program_interrupt(CPUS390XState *env, uint32_t code, int ilc)
116 + qemu_log("program interrupt at %#" PRIx64 "\n", env->psw.addr);
118 + if (kvm_enabled()) {
120 + kvm_s390_interrupt(env, KVM_S390_PROGRAM_INT, code);
123 + env->int_pgm_code = code;
124 + env->int_pgm_ilc = ilc;
125 + env->exception_index = EXCP_PGM;
126 + cpu_loop_exit(env);
131 + * ret < 0 indicates program check, ret = 0, 1, 2, 3 -> cc
133 +int sclp_service_call(CPUS390XState *env, uint32_t sccb, uint64_t code)
139 + printf("sclp(0x%x, 0x%" PRIx64 ")\n", sccb, code);
143 + if (!memory_region_is_ram(phys_page_find(sccb >> TARGET_PAGE_BITS)->mr)) {
144 + return -PGM_ADDRESSING;
146 + if (sccb & ~0x7ffffff8ul) {
147 + return -PGM_SPECIFICATION;
151 + case SCLP_CMDW_READ_SCP_INFO:
152 + case SCLP_CMDW_READ_SCP_INFO_FORCED:
153 + while ((ram_size >> (20 + shift)) > 65535) {
156 + stw_phys(sccb + SCP_MEM_CODE, ram_size >> (20 + shift));
157 + stb_phys(sccb + SCP_INCREMENT, 1 << shift);
158 + stw_phys(sccb + SCP_RESPONSE_CODE, 0x10);
160 + s390_sclp_extint(sccb & ~3);
164 + printf("KVM: invalid sclp call 0x%x / 0x%" PRIx64 "x\n", sccb, code);
173 +/* SCLP service call */
174 +uint32_t HELPER(servc)(uint32_t r1, uint64_t r2)
178 + r = sclp_service_call(env, r1, r2);
180 + program_interrupt(env, -r, 4);
187 +uint64_t HELPER(diag)(uint32_t num, uint64_t mem, uint64_t code)
193 + /* KVM hypercall */
194 + r = s390_virtio_hypercall(env, mem, code);
210 + program_interrupt(env, PGM_OPERATION, ILC_LATER_INC);
217 +void HELPER(stidp)(uint64_t a1)
219 + stq(a1, env->cpu_num);
223 +void HELPER(spx)(uint64_t a1)
228 + env->psa = prefix & 0xfffff000;
229 + qemu_log("prefix: %#x\n", prefix);
230 + tlb_flush_page(env, 0);
231 + tlb_flush_page(env, TARGET_PAGE_SIZE);
235 +uint32_t HELPER(sck)(uint64_t a1)
237 + /* XXX not implemented - is it necessary? */
242 +static inline uint64_t clock_value(CPUS390XState *env)
246 + time = env->tod_offset +
247 + time2tod(qemu_get_clock_ns(vm_clock) - env->tod_basetime);
253 +uint32_t HELPER(stck)(uint64_t a1)
255 + stq(a1, clock_value(env));
260 +/* Store Clock Extended */
261 +uint32_t HELPER(stcke)(uint64_t a1)
264 + /* basically the same value as stck */
265 + stq(a1 + 1, clock_value(env) | env->cpu_num);
266 + /* more fine grained than stck */
268 + /* XXX programmable fields */
274 +/* Set Clock Comparator */
275 +void HELPER(sckc)(uint64_t a1)
277 + uint64_t time = ldq(a1);
279 + if (time == -1ULL) {
283 + /* difference between now and then */
284 + time -= clock_value(env);
286 + time = (time * 125) >> 9;
288 + qemu_mod_timer(env->tod_timer, qemu_get_clock_ns(vm_clock) + time);
291 +/* Store Clock Comparator */
292 +void HELPER(stckc)(uint64_t a1)
294 + /* XXX implement */
299 +void HELPER(spt)(uint64_t a1)
301 + uint64_t time = ldq(a1);
303 + if (time == -1ULL) {
308 + time = (time * 125) >> 9;
310 + qemu_mod_timer(env->cpu_timer, qemu_get_clock_ns(vm_clock) + time);
313 +/* Store CPU Timer */
314 +void HELPER(stpt)(uint64_t a1)
316 + /* XXX implement */
320 +/* Store System Information */
321 +uint32_t HELPER(stsi)(uint64_t a0, uint32_t r0, uint32_t r1)
326 + if ((r0 & STSI_LEVEL_MASK) <= STSI_LEVEL_3 &&
327 + ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK))) {
328 + /* valid function code, invalid reserved bits */
329 + program_interrupt(env, PGM_SPECIFICATION, 2);
332 + sel1 = r0 & STSI_R0_SEL1_MASK;
333 + sel2 = r1 & STSI_R1_SEL2_MASK;
335 + /* XXX: spec exception if sysib is not 4k-aligned */
337 + switch (r0 & STSI_LEVEL_MASK) {
339 + if ((sel1 == 1) && (sel2 == 1)) {
340 + /* Basic Machine Configuration */
341 + struct sysib_111 sysib;
343 + memset(&sysib, 0, sizeof(sysib));
344 + ebcdic_put(sysib.manuf, "QEMU ", 16);
345 + /* same as machine type number in STORE CPU ID */
346 + ebcdic_put(sysib.type, "QEMU", 4);
347 + /* same as model number in STORE CPU ID */
348 + ebcdic_put(sysib.model, "QEMU ", 16);
349 + ebcdic_put(sysib.sequence, "QEMU ", 16);
350 + ebcdic_put(sysib.plant, "QEMU", 4);
351 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
352 + } else if ((sel1 == 2) && (sel2 == 1)) {
353 + /* Basic Machine CPU */
354 + struct sysib_121 sysib;
356 + memset(&sysib, 0, sizeof(sysib));
357 + /* XXX make different for different CPUs? */
358 + ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16);
359 + ebcdic_put(sysib.plant, "QEMU", 4);
360 + stw_p(&sysib.cpu_addr, env->cpu_num);
361 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
362 + } else if ((sel1 == 2) && (sel2 == 2)) {
363 + /* Basic Machine CPUs */
364 + struct sysib_122 sysib;
366 + memset(&sysib, 0, sizeof(sysib));
367 + stl_p(&sysib.capability, 0x443afc29);
368 + /* XXX change when SMP comes */
369 + stw_p(&sysib.total_cpus, 1);
370 + stw_p(&sysib.active_cpus, 1);
371 + stw_p(&sysib.standby_cpus, 0);
372 + stw_p(&sysib.reserved_cpus, 0);
373 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
380 + if ((sel1 == 2) && (sel2 == 1)) {
382 + struct sysib_221 sysib;
384 + memset(&sysib, 0, sizeof(sysib));
385 + /* XXX make different for different CPUs? */
386 + ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16);
387 + ebcdic_put(sysib.plant, "QEMU", 4);
388 + stw_p(&sysib.cpu_addr, env->cpu_num);
389 + stw_p(&sysib.cpu_id, 0);
390 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
391 + } else if ((sel1 == 2) && (sel2 == 2)) {
393 + struct sysib_222 sysib;
395 + memset(&sysib, 0, sizeof(sysib));
396 + stw_p(&sysib.lpar_num, 0);
398 + /* XXX change when SMP comes */
399 + stw_p(&sysib.total_cpus, 1);
400 + stw_p(&sysib.conf_cpus, 1);
401 + stw_p(&sysib.standby_cpus, 0);
402 + stw_p(&sysib.reserved_cpus, 0);
403 + ebcdic_put(sysib.name, "QEMU ", 8);
404 + stl_p(&sysib.caf, 1000);
405 + stw_p(&sysib.dedicated_cpus, 0);
406 + stw_p(&sysib.shared_cpus, 0);
407 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
415 + if ((sel1 == 2) && (sel2 == 2)) {
417 + struct sysib_322 sysib;
419 + memset(&sysib, 0, sizeof(sysib));
421 + /* XXX change when SMP comes */
422 + stw_p(&sysib.vm[0].total_cpus, 1);
423 + stw_p(&sysib.vm[0].conf_cpus, 1);
424 + stw_p(&sysib.vm[0].standby_cpus, 0);
425 + stw_p(&sysib.vm[0].reserved_cpus, 0);
426 + ebcdic_put(sysib.vm[0].name, "KVMguest", 8);
427 + stl_p(&sysib.vm[0].caf, 1000);
428 + ebcdic_put(sysib.vm[0].cpi, "KVM/Linux ", 16);
429 + cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
435 + case STSI_LEVEL_CURRENT:
436 + env->regs[0] = STSI_LEVEL_3;
446 +uint32_t HELPER(sigp)(uint64_t order_code, uint32_t r1, uint64_t cpu_addr)
450 + HELPER_LOG("%s: %016" PRIx64 " %08x %016" PRIx64 "\n",
451 + __func__, order_code, r1, cpu_addr);
453 + /* Remember: Use "R1 or R1 + 1, whichever is the odd-numbered register"
454 + as parameter (input). Status (output) is always R1. */
456 + switch (order_code) {
457 + case SIGP_SET_ARCH:
461 + /* enumerate CPU status */
463 + /* XXX implement when SMP comes */
466 + env->regs[r1] &= 0xffffffff00000000ULL;
469 +#if !defined(CONFIG_USER_ONLY)
471 + qemu_system_reset_request();
472 + cpu_loop_exit(env);
475 + qemu_system_shutdown_request();
476 + cpu_loop_exit(env);
481 + fprintf(stderr, "XXX unknown sigp: 0x%" PRIx64 "\n", order_code);
488 diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
489 deleted file mode 100644
490 index bb8dbf5..0000000
491 --- a/target-s390x/op_helper.c
495 - * S/390 helper routines
497 - * Copyright (c) 2009 Ulrich Hecht
498 - * Copyright (c) 2009 Alexander Graf
500 - * This library is free software; you can redistribute it and/or
501 - * modify it under the terms of the GNU Lesser General Public
502 - * License as published by the Free Software Foundation; either
503 - * version 2 of the License, or (at your option) any later version.
505 - * This library is distributed in the hope that it will be useful,
506 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
507 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
508 - * Lesser General Public License for more details.
510 - * You should have received a copy of the GNU Lesser General Public
511 - * License along with this library; if not, see <http://www.gnu.org/licenses/>.
517 -#include "dyngen-exec.h"
518 -#include "host-utils.h"
522 -#include "qemu-timer.h"
524 -#include <linux/kvm.h>
527 -#if !defined(CONFIG_USER_ONLY)
528 -#include "softmmu_exec.h"
532 -/* #define DEBUG_HELPER */
534 -#define HELPER_LOG(x...) qemu_log(x)
536 -#define HELPER_LOG(x...)
539 -/* raise an exception */
540 -void HELPER(exception)(uint32_t excp)
542 - HELPER_LOG("%s: exception %d\n", __func__, excp);
543 - env->exception_index = excp;
544 - cpu_loop_exit(env);
547 -#ifndef CONFIG_USER_ONLY
548 -void program_interrupt(CPUS390XState *env, uint32_t code, int ilc)
550 - qemu_log("program interrupt at %#" PRIx64 "\n", env->psw.addr);
552 - if (kvm_enabled()) {
554 - kvm_s390_interrupt(env, KVM_S390_PROGRAM_INT, code);
557 - env->int_pgm_code = code;
558 - env->int_pgm_ilc = ilc;
559 - env->exception_index = EXCP_PGM;
560 - cpu_loop_exit(env);
565 - * ret < 0 indicates program check, ret = 0, 1, 2, 3 -> cc
567 -int sclp_service_call(CPUS390XState *env, uint32_t sccb, uint64_t code)
573 - printf("sclp(0x%x, 0x%" PRIx64 ")\n", sccb, code);
577 - if (!memory_region_is_ram(phys_page_find(sccb >> TARGET_PAGE_BITS)->mr)) {
578 - return -PGM_ADDRESSING;
580 - if (sccb & ~0x7ffffff8ul) {
581 - return -PGM_SPECIFICATION;
585 - case SCLP_CMDW_READ_SCP_INFO:
586 - case SCLP_CMDW_READ_SCP_INFO_FORCED:
587 - while ((ram_size >> (20 + shift)) > 65535) {
590 - stw_phys(sccb + SCP_MEM_CODE, ram_size >> (20 + shift));
591 - stb_phys(sccb + SCP_INCREMENT, 1 << shift);
592 - stw_phys(sccb + SCP_RESPONSE_CODE, 0x10);
594 - s390_sclp_extint(sccb & ~3);
598 - printf("KVM: invalid sclp call 0x%x / 0x%" PRIx64 "x\n", sccb, code);
607 -/* SCLP service call */
608 -uint32_t HELPER(servc)(uint32_t r1, uint64_t r2)
612 - r = sclp_service_call(env, r1, r2);
614 - program_interrupt(env, -r, 4);
621 -uint64_t HELPER(diag)(uint32_t num, uint64_t mem, uint64_t code)
627 - /* KVM hypercall */
628 - r = s390_virtio_hypercall(env, mem, code);
644 - program_interrupt(env, PGM_OPERATION, ILC_LATER_INC);
651 -void HELPER(stidp)(uint64_t a1)
653 - stq(a1, env->cpu_num);
657 -void HELPER(spx)(uint64_t a1)
662 - env->psa = prefix & 0xfffff000;
663 - qemu_log("prefix: %#x\n", prefix);
664 - tlb_flush_page(env, 0);
665 - tlb_flush_page(env, TARGET_PAGE_SIZE);
669 -uint32_t HELPER(sck)(uint64_t a1)
671 - /* XXX not implemented - is it necessary? */
676 -static inline uint64_t clock_value(CPUS390XState *env)
680 - time = env->tod_offset +
681 - time2tod(qemu_get_clock_ns(vm_clock) - env->tod_basetime);
687 -uint32_t HELPER(stck)(uint64_t a1)
689 - stq(a1, clock_value(env));
694 -/* Store Clock Extended */
695 -uint32_t HELPER(stcke)(uint64_t a1)
698 - /* basically the same value as stck */
699 - stq(a1 + 1, clock_value(env) | env->cpu_num);
700 - /* more fine grained than stck */
702 - /* XXX programmable fields */
708 -/* Set Clock Comparator */
709 -void HELPER(sckc)(uint64_t a1)
711 - uint64_t time = ldq(a1);
713 - if (time == -1ULL) {
717 - /* difference between now and then */
718 - time -= clock_value(env);
720 - time = (time * 125) >> 9;
722 - qemu_mod_timer(env->tod_timer, qemu_get_clock_ns(vm_clock) + time);
725 -/* Store Clock Comparator */
726 -void HELPER(stckc)(uint64_t a1)
728 - /* XXX implement */
733 -void HELPER(spt)(uint64_t a1)
735 - uint64_t time = ldq(a1);
737 - if (time == -1ULL) {
742 - time = (time * 125) >> 9;
744 - qemu_mod_timer(env->cpu_timer, qemu_get_clock_ns(vm_clock) + time);
747 -/* Store CPU Timer */
748 -void HELPER(stpt)(uint64_t a1)
750 - /* XXX implement */
754 -/* Store System Information */
755 -uint32_t HELPER(stsi)(uint64_t a0, uint32_t r0, uint32_t r1)
760 - if ((r0 & STSI_LEVEL_MASK) <= STSI_LEVEL_3 &&
761 - ((r0 & STSI_R0_RESERVED_MASK) || (r1 & STSI_R1_RESERVED_MASK))) {
762 - /* valid function code, invalid reserved bits */
763 - program_interrupt(env, PGM_SPECIFICATION, 2);
766 - sel1 = r0 & STSI_R0_SEL1_MASK;
767 - sel2 = r1 & STSI_R1_SEL2_MASK;
769 - /* XXX: spec exception if sysib is not 4k-aligned */
771 - switch (r0 & STSI_LEVEL_MASK) {
773 - if ((sel1 == 1) && (sel2 == 1)) {
774 - /* Basic Machine Configuration */
775 - struct sysib_111 sysib;
777 - memset(&sysib, 0, sizeof(sysib));
778 - ebcdic_put(sysib.manuf, "QEMU ", 16);
779 - /* same as machine type number in STORE CPU ID */
780 - ebcdic_put(sysib.type, "QEMU", 4);
781 - /* same as model number in STORE CPU ID */
782 - ebcdic_put(sysib.model, "QEMU ", 16);
783 - ebcdic_put(sysib.sequence, "QEMU ", 16);
784 - ebcdic_put(sysib.plant, "QEMU", 4);
785 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
786 - } else if ((sel1 == 2) && (sel2 == 1)) {
787 - /* Basic Machine CPU */
788 - struct sysib_121 sysib;
790 - memset(&sysib, 0, sizeof(sysib));
791 - /* XXX make different for different CPUs? */
792 - ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16);
793 - ebcdic_put(sysib.plant, "QEMU", 4);
794 - stw_p(&sysib.cpu_addr, env->cpu_num);
795 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
796 - } else if ((sel1 == 2) && (sel2 == 2)) {
797 - /* Basic Machine CPUs */
798 - struct sysib_122 sysib;
800 - memset(&sysib, 0, sizeof(sysib));
801 - stl_p(&sysib.capability, 0x443afc29);
802 - /* XXX change when SMP comes */
803 - stw_p(&sysib.total_cpus, 1);
804 - stw_p(&sysib.active_cpus, 1);
805 - stw_p(&sysib.standby_cpus, 0);
806 - stw_p(&sysib.reserved_cpus, 0);
807 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
814 - if ((sel1 == 2) && (sel2 == 1)) {
816 - struct sysib_221 sysib;
818 - memset(&sysib, 0, sizeof(sysib));
819 - /* XXX make different for different CPUs? */
820 - ebcdic_put(sysib.sequence, "QEMUQEMUQEMUQEMU", 16);
821 - ebcdic_put(sysib.plant, "QEMU", 4);
822 - stw_p(&sysib.cpu_addr, env->cpu_num);
823 - stw_p(&sysib.cpu_id, 0);
824 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
825 - } else if ((sel1 == 2) && (sel2 == 2)) {
827 - struct sysib_222 sysib;
829 - memset(&sysib, 0, sizeof(sysib));
830 - stw_p(&sysib.lpar_num, 0);
832 - /* XXX change when SMP comes */
833 - stw_p(&sysib.total_cpus, 1);
834 - stw_p(&sysib.conf_cpus, 1);
835 - stw_p(&sysib.standby_cpus, 0);
836 - stw_p(&sysib.reserved_cpus, 0);
837 - ebcdic_put(sysib.name, "QEMU ", 8);
838 - stl_p(&sysib.caf, 1000);
839 - stw_p(&sysib.dedicated_cpus, 0);
840 - stw_p(&sysib.shared_cpus, 0);
841 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
849 - if ((sel1 == 2) && (sel2 == 2)) {
851 - struct sysib_322 sysib;
853 - memset(&sysib, 0, sizeof(sysib));
855 - /* XXX change when SMP comes */
856 - stw_p(&sysib.vm[0].total_cpus, 1);
857 - stw_p(&sysib.vm[0].conf_cpus, 1);
858 - stw_p(&sysib.vm[0].standby_cpus, 0);
859 - stw_p(&sysib.vm[0].reserved_cpus, 0);
860 - ebcdic_put(sysib.vm[0].name, "KVMguest", 8);
861 - stl_p(&sysib.vm[0].caf, 1000);
862 - ebcdic_put(sysib.vm[0].cpi, "KVM/Linux ", 16);
863 - cpu_physical_memory_rw(a0, (uint8_t *)&sysib, sizeof(sysib), 1);
869 - case STSI_LEVEL_CURRENT:
870 - env->regs[0] = STSI_LEVEL_3;
880 -uint32_t HELPER(sigp)(uint64_t order_code, uint32_t r1, uint64_t cpu_addr)
884 - HELPER_LOG("%s: %016" PRIx64 " %08x %016" PRIx64 "\n",
885 - __func__, order_code, r1, cpu_addr);
887 - /* Remember: Use "R1 or R1 + 1, whichever is the odd-numbered register"
888 - as parameter (input). Status (output) is always R1. */
890 - switch (order_code) {
891 - case SIGP_SET_ARCH:
895 - /* enumerate CPU status */
897 - /* XXX implement when SMP comes */
900 - env->regs[r1] &= 0xffffffff00000000ULL;
903 -#if !defined(CONFIG_USER_ONLY)
905 - qemu_system_reset_request();
906 - cpu_loop_exit(env);
909 - qemu_system_shutdown_request();
910 - cpu_loop_exit(env);
915 - fprintf(stderr, "XXX unknown sigp: 0x%" PRIx64 "\n", order_code);