Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 1 | s390x_ss = ss.source_set() |
| 2 | s390x_ss.add(files( |
| 3 | 'cpu.c', |
| 4 | 'cpu_features.c', |
| 5 | 'cpu_models.c', |
| 6 | 'gdbstub.c', |
| 7 | 'helper.c', |
| 8 | 'interrupt.c', |
| 9 | )) |
| 10 | |
| 11 | s390x_ss.add(when: 'CONFIG_TCG', if_true: files( |
| 12 | 'cc_helper.c', |
| 13 | 'crypto_helper.c', |
| 14 | 'excp_helper.c', |
| 15 | 'fpu_helper.c', |
| 16 | 'int_helper.c', |
| 17 | 'mem_helper.c', |
| 18 | 'misc_helper.c', |
| 19 | 'translate.c', |
| 20 | 'vec_fpu_helper.c', |
| 21 | 'vec_helper.c', |
| 22 | 'vec_int_helper.c', |
| 23 | 'vec_string_helper.c', |
Paolo Bonzini | 7317317 | 2020-08-21 11:52:37 -0400 | [diff] [blame] | 24 | ), if_false: files('tcg-stub.c')) |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 25 | |
| 26 | s390x_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) |
| 27 | |
Marc-André Lureau | d3b1848 | 2019-08-17 14:55:32 +0400 | [diff] [blame] | 28 | gen_features = executable('gen-features', 'gen-features.c', native: true, |
| 29 | build_by_default: false) |
| 30 | |
| 31 | gen_features_h = custom_target('gen-features.h', |
| 32 | output: 'gen-features.h', |
| 33 | capture: true, |
| 34 | command: gen_features) |
| 35 | |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 36 | s390x_ss.add(gen_features_h) |
| 37 | |
| 38 | s390x_softmmu_ss = ss.source_set() |
| 39 | s390x_softmmu_ss.add(files( |
| 40 | 'arch_dump.c', |
| 41 | 'diag.c', |
| 42 | 'ioinst.c', |
| 43 | 'machine.c', |
| 44 | 'mmu_helper.c', |
| 45 | 'sigp.c', |
| 46 | )) |
| 47 | |
Paolo Bonzini | 64ed6f9 | 2020-08-03 17:04:25 +0200 | [diff] [blame] | 48 | # Newer kernels on s390 check for an S390_PGSTE program header and |
| 49 | # enable the pgste page table extensions in that case. This makes |
| 50 | # the vm.allocate_pgste sysctl unnecessary. We enable this program |
| 51 | # header if |
| 52 | # - we build on s390x |
| 53 | # - we build the system emulation for s390x (qemu-system-s390x) |
| 54 | # - KVM is enabled |
| 55 | # - the linker supports --s390-pgste |
| 56 | if host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste') |
| 57 | s390x_softmmu_ss.add(when: 'CONFIG_KVM', |
| 58 | if_true: declare_dependency(link_args: ['-Wl,--s390-pgste'])) |
| 59 | endif |
| 60 | |
Paolo Bonzini | abff1ab | 2020-08-07 12:10:23 +0200 | [diff] [blame] | 61 | target_arch += {'s390x': s390x_ss} |
| 62 | target_softmmu_arch += {'s390x': s390x_softmmu_ss} |