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 'interrupt.c', 898be64d2SCho, Yu-Chen 'cpu-dump.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( 25*da944885SCho, Yu-Chen 'helper.c', 26abff1abfSPaolo Bonzini 'arch_dump.c', 27abff1abfSPaolo Bonzini 'diag.c', 28abff1abfSPaolo Bonzini 'ioinst.c', 29abff1abfSPaolo Bonzini 'machine.c', 30abff1abfSPaolo Bonzini 'mmu_helper.c', 31abff1abfSPaolo Bonzini 'sigp.c', 3272ffb631SCho, Yu-Chen 'cpu-sysemu.c', 33abff1abfSPaolo Bonzini)) 34abff1abfSPaolo Bonzini 3564ed6f92SPaolo Bonzini# Newer kernels on s390 check for an S390_PGSTE program header and 3664ed6f92SPaolo Bonzini# enable the pgste page table extensions in that case. This makes 3764ed6f92SPaolo Bonzini# the vm.allocate_pgste sysctl unnecessary. We enable this program 3864ed6f92SPaolo Bonzini# header if 3964ed6f92SPaolo Bonzini# - we build on s390x 4064ed6f92SPaolo Bonzini# - we build the system emulation for s390x (qemu-system-s390x) 4164ed6f92SPaolo Bonzini# - KVM is enabled 4264ed6f92SPaolo Bonzini# - the linker supports --s390-pgste 4364ed6f92SPaolo Bonziniif host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste') 4464ed6f92SPaolo Bonzini s390x_softmmu_ss.add(when: 'CONFIG_KVM', 4564ed6f92SPaolo Bonzini if_true: declare_dependency(link_args: ['-Wl,--s390-pgste'])) 4664ed6f92SPaolo Bonziniendif 4764ed6f92SPaolo Bonzini 4833f6a7d6SCho, Yu-Chens390x_user_ss = ss.source_set() 4933f6a7d6SCho, Yu-Chen 50c9274b6bSCho, Yu-Chensubdir('tcg') 51c9274b6bSCho, Yu-Chen 52abff1abfSPaolo Bonzinitarget_arch += {'s390x': s390x_ss} 53abff1abfSPaolo Bonzinitarget_softmmu_arch += {'s390x': s390x_softmmu_ss} 5433f6a7d6SCho, Yu-Chentarget_user_arch += {'s390x': s390x_user_ss} 55