1abff1abfSPaolo Bonzinis390x_ss = ss.source_set() 2abff1abfSPaolo Bonzinis390x_ss.add(files( 3abff1abfSPaolo Bonzini 'cpu.c', 4abff1abfSPaolo Bonzini 'cpu_features.c', 5abff1abfSPaolo Bonzini 'cpu_models.c', 6abff1abfSPaolo Bonzini 'gdbstub.c', 7abff1abfSPaolo Bonzini 'helper.c', 8abff1abfSPaolo Bonzini 'interrupt.c', 9abff1abfSPaolo Bonzini)) 10abff1abfSPaolo Bonzini 11abff1abfSPaolo Bonzinis390x_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c')) 12abff1abfSPaolo Bonzini 13d3b18480SMarc-André Lureaugen_features = executable('gen-features', 'gen-features.c', native: true, 14d3b18480SMarc-André Lureau build_by_default: false) 15d3b18480SMarc-André Lureau 16d3b18480SMarc-André Lureaugen_features_h = custom_target('gen-features.h', 17d3b18480SMarc-André Lureau output: 'gen-features.h', 18d3b18480SMarc-André Lureau capture: true, 19d3b18480SMarc-André Lureau command: gen_features) 20d3b18480SMarc-André Lureau 21abff1abfSPaolo Bonzinis390x_ss.add(gen_features_h) 22abff1abfSPaolo Bonzini 23abff1abfSPaolo Bonzinis390x_softmmu_ss = ss.source_set() 24abff1abfSPaolo Bonzinis390x_softmmu_ss.add(files( 25abff1abfSPaolo Bonzini 'arch_dump.c', 26abff1abfSPaolo Bonzini 'diag.c', 27abff1abfSPaolo Bonzini 'ioinst.c', 28abff1abfSPaolo Bonzini 'machine.c', 29abff1abfSPaolo Bonzini 'mmu_helper.c', 30abff1abfSPaolo Bonzini 'sigp.c', 31abff1abfSPaolo Bonzini)) 32abff1abfSPaolo Bonzini 3364ed6f92SPaolo Bonzini# Newer kernels on s390 check for an S390_PGSTE program header and 3464ed6f92SPaolo Bonzini# enable the pgste page table extensions in that case. This makes 3564ed6f92SPaolo Bonzini# the vm.allocate_pgste sysctl unnecessary. We enable this program 3664ed6f92SPaolo Bonzini# header if 3764ed6f92SPaolo Bonzini# - we build on s390x 3864ed6f92SPaolo Bonzini# - we build the system emulation for s390x (qemu-system-s390x) 3964ed6f92SPaolo Bonzini# - KVM is enabled 4064ed6f92SPaolo Bonzini# - the linker supports --s390-pgste 4164ed6f92SPaolo Bonziniif host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste') 4264ed6f92SPaolo Bonzini s390x_softmmu_ss.add(when: 'CONFIG_KVM', 4364ed6f92SPaolo Bonzini if_true: declare_dependency(link_args: ['-Wl,--s390-pgste'])) 4464ed6f92SPaolo Bonziniendif 4564ed6f92SPaolo Bonzini 4633f6a7d6SCho, Yu-Chens390x_user_ss = ss.source_set() 4733f6a7d6SCho, Yu-Chen 48*c9274b6bSCho, Yu-Chensubdir('tcg') 49*c9274b6bSCho, Yu-Chen 50abff1abfSPaolo Bonzinitarget_arch += {'s390x': s390x_ss} 51abff1abfSPaolo Bonzinitarget_softmmu_arch += {'s390x': s390x_softmmu_ss} 5233f6a7d6SCho, Yu-Chentarget_user_arch += {'s390x': s390x_user_ss} 53