38 changes: 19 additions & 19 deletions net/meson.build
@@ -1,4 +1,4 @@
softmmu_ss.add(files(
system_ss.add(files(
'announce.c',
'checksum.c',
'dump.c',
Expand All @@ -18,41 +18,41 @@ softmmu_ss.add(files(

if get_option('replication').allowed() or \
get_option('colo_proxy').allowed()
softmmu_ss.add(files('colo-compare.c'))
softmmu_ss.add(files('colo.c'))
system_ss.add(files('colo-compare.c'))
system_ss.add(files('colo.c'))
endif

if get_option('colo_proxy').allowed()
softmmu_ss.add(files('filter-rewriter.c'))
system_ss.add(files('filter-rewriter.c'))
endif

softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c'))
system_ss.add(when: 'CONFIG_TCG', if_true: files('filter-replay.c'))

if have_l2tpv3
softmmu_ss.add(files('l2tpv3.c'))
system_ss.add(files('l2tpv3.c'))
endif
softmmu_ss.add(when: slirp, if_true: files('slirp.c'))
softmmu_ss.add(when: vde, if_true: files('vde.c'))
system_ss.add(when: slirp, if_true: files('slirp.c'))
system_ss.add(when: vde, if_true: files('vde.c'))
if have_netmap
softmmu_ss.add(files('netmap.c'))
system_ss.add(files('netmap.c'))
endif
if have_vhost_net_user
softmmu_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c'))
system_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-user.c'), if_false: files('vhost-user-stub.c'))
system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-user-stub.c'))
endif

softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c'))
softmmu_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c'))
softmmu_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c'))
system_ss.add(when: 'CONFIG_LINUX', if_true: files('tap-linux.c'))
system_ss.add(when: 'CONFIG_BSD', if_true: files('tap-bsd.c'))
system_ss.add(when: 'CONFIG_SOLARIS', if_true: files('tap-solaris.c'))
tap_posix = ['tap.c']
if not config_host.has_key('CONFIG_LINUX') and not config_host.has_key('CONFIG_BSD') and not config_host.has_key('CONFIG_SOLARIS')
tap_posix += 'tap-stub.c'
endif
softmmu_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix))
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c'))
system_ss.add(when: 'CONFIG_POSIX', if_true: files(tap_posix))
system_ss.add(when: 'CONFIG_WIN32', if_true: files('tap-win32.c'))
if have_vhost_net_vdpa
softmmu_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-vdpa.c'), if_false: files('vhost-vdpa-stub.c'))
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-vdpa-stub.c'))
system_ss.add(when: 'CONFIG_VIRTIO_NET', if_true: files('vhost-vdpa.c'), if_false: files('vhost-vdpa-stub.c'))
system_ss.add(when: 'CONFIG_ALL', if_true: files('vhost-vdpa-stub.c'))
endif

vmnet_files = files(
Expand All @@ -61,5 +61,5 @@ vmnet_files = files(
'vmnet-host.c',
'vmnet-shared.c'
)
softmmu_ss.add(when: vmnet, if_true: vmnet_files)
system_ss.add(when: vmnet, if_true: vmnet_files)
subdir('can')
1 change: 0 additions & 1 deletion plugins/core.c
Expand Up @@ -25,7 +25,6 @@

#include "exec/exec-all.h"
#include "exec/tb-flush.h"
#include "exec/helper-proto.h"
#include "tcg/tcg.h"
#include "tcg/tcg-op.h"
#include "plugin.h"
Expand Down
2 changes: 1 addition & 1 deletion qapi/meson.build
Expand Up @@ -141,6 +141,6 @@ foreach output : qapi_specific_outputs + qapi_nonmodule_outputs
if output.endswith('.trace-events')
qapi_trace_events += qapi_files[i]
endif
specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: qapi_files[i])
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: qapi_files[i])
i = i + 1
endforeach
2 changes: 1 addition & 1 deletion qom/meson.build
Expand Up @@ -7,4 +7,4 @@ qom_ss.add(files(
))

qmp_ss.add(files('qom-qmp-cmds.c'))
softmmu_ss.add(files('qom-hmp-cmds.c'))
system_ss.add(files('qom-hmp-cmds.c'))
2 changes: 1 addition & 1 deletion replay/meson.build
@@ -1,4 +1,4 @@
softmmu_ss.add(when: 'CONFIG_TCG', if_true: files(
system_ss.add(when: 'CONFIG_TCG', if_true: files(
'replay.c',
'replay-internal.c',
'replay-events.c',
Expand Down
2 changes: 1 addition & 1 deletion semihosting/meson.build
Expand Up @@ -3,7 +3,7 @@ specific_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files(
'syscalls.c',
))

specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_SOFTMMU'], if_true: files(
specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_SYSTEM_ONLY'], if_true: files(
'config.c',
'console.c',
'uaccess.c',
Expand Down
12 changes: 6 additions & 6 deletions softmmu/meson.build
@@ -1,16 +1,16 @@
specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files(
specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files(
'arch_init.c',
'ioport.c',
'memory.c',
'physmem.c',
'watchpoint.c',
)])

specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: [files(
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: [files(
'icount.c',
)])

softmmu_ss.add(files(
system_ss.add(files(
'balloon.c',
'bootdevice.c',
'cpus.c',
Expand All @@ -32,8 +32,8 @@ softmmu_ss.add(files(
), sdl, libpmem, libdaxctl)

if have_tpm
softmmu_ss.add(files('tpm.c'))
system_ss.add(files('tpm.c'))
endif

softmmu_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
softmmu_ss.add(when: fdt, if_true: files('device_tree.c'))
system_ss.add(when: seccomp, if_true: files('qemu-seccomp.c'))
system_ss.add(when: fdt, if_true: files('device_tree.c'))
2 changes: 1 addition & 1 deletion stats/meson.build
@@ -1 +1 @@
softmmu_ss.add(files('stats-hmp-cmds.c', 'stats-qmp-cmds.c'))
system_ss.add(files('stats-hmp-cmds.c', 'stats-qmp-cmds.c'))
6 changes: 3 additions & 3 deletions target/alpha/meson.build
Expand Up @@ -11,8 +11,8 @@ alpha_ss.add(files(
'vax_helper.c',
))

alpha_softmmu_ss = ss.source_set()
alpha_softmmu_ss.add(files('machine.c'))
alpha_system_ss = ss.source_set()
alpha_system_ss.add(files('machine.c'))

target_arch += {'alpha': alpha_ss}
target_softmmu_arch += {'alpha': alpha_softmmu_ss}
target_softmmu_arch += {'alpha': alpha_system_ss}
2 changes: 1 addition & 1 deletion target/arm/hvf/meson.build
@@ -1,3 +1,3 @@
arm_softmmu_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files(
arm_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files(
'hvf.c',
))
6 changes: 3 additions & 3 deletions target/arm/meson.build
Expand Up @@ -16,8 +16,8 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files(
'gdbstub64.c',
))

arm_softmmu_ss = ss.source_set()
arm_softmmu_ss.add(files(
arm_system_ss = ss.source_set()
arm_system_ss.add(files(
'arch_dump.c',
'arm-powerctl.c',
'arm-qmp-cmds.c',
Expand All @@ -35,4 +35,4 @@ else
endif

target_arch += {'arm': arm_ss}
target_softmmu_arch += {'arm': arm_softmmu_ss}
target_softmmu_arch += {'arm': arm_system_ss}
2 changes: 1 addition & 1 deletion target/arm/tcg/meson.build
Expand Up @@ -48,6 +48,6 @@ arm_ss.add(when: 'TARGET_AARCH64', if_true: files(
'sve_helper.c',
))

arm_softmmu_ss.add(files(
arm_system_ss.add(files(
'psci.c',
))
6 changes: 3 additions & 3 deletions target/avr/meson.build
Expand Up @@ -4,7 +4,7 @@ gen = [
]

avr_ss = ss.source_set()
avr_softmmu_ss = ss.source_set()
avr_system_ss = ss.source_set()

avr_ss.add(gen)
avr_ss.add(files(
Expand All @@ -14,7 +14,7 @@ avr_ss.add(files(
'gdbstub.c',
'disas.c'))

avr_softmmu_ss.add(files('machine.c'))
avr_system_ss.add(files('machine.c'))

target_arch += {'avr': avr_ss}
target_softmmu_arch += {'avr': avr_softmmu_ss}
target_softmmu_arch += {'avr': avr_system_ss}
6 changes: 3 additions & 3 deletions target/cris/meson.build
Expand Up @@ -6,12 +6,12 @@ cris_ss.add(files(
'translate.c',
))

cris_softmmu_ss = ss.source_set()
cris_softmmu_ss.add(files(
cris_system_ss = ss.source_set()
cris_system_ss.add(files(
'helper.c',
'machine.c',
'mmu.c',
))

target_arch += {'cris': cris_ss}
target_softmmu_arch += {'cris': cris_softmmu_ss}
target_softmmu_arch += {'cris': cris_system_ss}
6 changes: 3 additions & 3 deletions target/hppa/meson.build
Expand Up @@ -11,13 +11,13 @@ hppa_ss.add(files(
'translate.c',
))

hppa_softmmu_ss = ss.source_set()
hppa_softmmu_ss.add(files(
hppa_system_ss = ss.source_set()
hppa_system_ss.add(files(
'int_helper.c',
'machine.c',
'mem_helper.c',
'sys_helper.c',
))

target_arch += {'hppa': hppa_ss}
target_softmmu_arch += {'hppa': hppa_softmmu_ss}
target_softmmu_arch += {'hppa': hppa_system_ss}
6 changes: 3 additions & 3 deletions target/i386/hax/meson.build
@@ -1,7 +1,7 @@
i386_softmmu_ss.add(when: 'CONFIG_HAX', if_true: files(
i386_system_ss.add(when: 'CONFIG_HAX', if_true: files(
'hax-all.c',
'hax-mem.c',
'hax-accel-ops.c',
))
i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_POSIX'], if_true: files('hax-posix.c'))
i386_softmmu_ss.add(when: ['CONFIG_HAX', 'CONFIG_WIN32'], if_true: files('hax-windows.c'))
i386_system_ss.add(when: ['CONFIG_HAX', 'CONFIG_POSIX'], if_true: files('hax-posix.c'))
i386_system_ss.add(when: ['CONFIG_HAX', 'CONFIG_WIN32'], if_true: files('hax-windows.c'))
2 changes: 1 addition & 1 deletion target/i386/hvf/meson.build
@@ -1,4 +1,4 @@
i386_softmmu_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files(
i386_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files(
'hvf.c',
'x86.c',
'x86_cpuid.c',
Expand Down
4 changes: 2 additions & 2 deletions target/i386/kvm/meson.build
Expand Up @@ -11,6 +11,6 @@ i386_softmmu_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files('xen-emu.c'))

i386_softmmu_kvm_ss.add(when: 'CONFIG_SEV', if_false: files('sev-stub.c'))

i386_softmmu_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'), if_false: files('hyperv-stub.c'))
i386_system_ss.add(when: 'CONFIG_HYPERV', if_true: files('hyperv.c'), if_false: files('hyperv-stub.c'))

i386_softmmu_ss.add_all(when: 'CONFIG_KVM', if_true: i386_softmmu_kvm_ss)
i386_system_ss.add_all(when: 'CONFIG_KVM', if_true: i386_softmmu_kvm_ss)
8 changes: 4 additions & 4 deletions target/i386/meson.build
Expand Up @@ -12,15 +12,15 @@ i386_ss.add(when: 'CONFIG_SEV', if_true: files('host-cpu.c'))
i386_ss.add(when: 'CONFIG_KVM', if_true: files('host-cpu.c'))
i386_ss.add(when: 'CONFIG_HVF', if_true: files('host-cpu.c'))

i386_softmmu_ss = ss.source_set()
i386_softmmu_ss.add(files(
i386_system_ss = ss.source_set()
i386_system_ss.add(files(
'arch_dump.c',
'arch_memory_mapping.c',
'machine.c',
'monitor.c',
'cpu-sysemu.c',
))
i386_softmmu_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-sysemu-stub.c'))
i386_system_ss.add(when: 'CONFIG_SEV', if_true: files('sev.c'), if_false: files('sev-sysemu-stub.c'))

i386_user_ss = ss.source_set()

Expand All @@ -32,5 +32,5 @@ subdir('hvf')
subdir('tcg')

target_arch += {'i386': i386_ss}
target_softmmu_arch += {'i386': i386_softmmu_ss}
target_softmmu_arch += {'i386': i386_system_ss}
target_user_arch += {'i386': i386_user_ss}
4 changes: 2 additions & 2 deletions target/i386/nvmm/meson.build
@@ -1,8 +1,8 @@
i386_softmmu_ss.add(when: 'CONFIG_NVMM', if_true:
i386_system_ss.add(when: 'CONFIG_NVMM', if_true:
files(
'nvmm-all.c',
'nvmm-accel-ops.c',
)
)

i386_softmmu_ss.add(when: 'CONFIG_NVMM', if_true: nvmm)
i386_system_ss.add(when: 'CONFIG_NVMM', if_true: nvmm)
2 changes: 1 addition & 1 deletion target/i386/tcg/sysemu/meson.build
@@ -1,4 +1,4 @@
i386_softmmu_ss.add(when: ['CONFIG_TCG', 'CONFIG_SOFTMMU'], if_true: files(
i386_system_ss.add(when: ['CONFIG_TCG', 'CONFIG_SYSTEM_ONLY'], if_true: files(
'tcg-cpu.c',
'smm_helper.c',
'excp_helper.c',
Expand Down
3 changes: 0 additions & 3 deletions target/i386/tcg/translate.c
Expand Up @@ -6914,10 +6914,7 @@ static void i386_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cpu)
dc->cc_op_dirty = false;
dc->popl_esp_hack = 0;
/* select memory access functions */
dc->mem_index = 0;
#ifdef CONFIG_SOFTMMU
dc->mem_index = cpu_mmu_index(env, false);
#endif
dc->cpuid_features = env->features[FEAT_1_EDX];
dc->cpuid_ext_features = env->features[FEAT_1_ECX];
dc->cpuid_ext2_features = env->features[FEAT_8000_0001_EDX];
Expand Down
2 changes: 1 addition & 1 deletion target/i386/whpx/meson.build
@@ -1,4 +1,4 @@
i386_softmmu_ss.add(when: 'CONFIG_WHPX', if_true: files(
i386_system_ss.add(when: 'CONFIG_WHPX', if_true: files(
'whpx-all.c',
'whpx-apic.c',
'whpx-accel-ops.c',
Expand Down
6 changes: 3 additions & 3 deletions target/loongarch/meson.build
Expand Up @@ -15,8 +15,8 @@ loongarch_tcg_ss.add(files(
))
loongarch_tcg_ss.add(zlib)

loongarch_softmmu_ss = ss.source_set()
loongarch_softmmu_ss.add(files(
loongarch_system_ss = ss.source_set()
loongarch_system_ss.add(files(
'loongarch-qmp-cmds.c',
'machine.c',
'tlb_helper.c',
Expand All @@ -30,4 +30,4 @@ common_ss.add(when: 'CONFIG_LOONGARCH_DIS', if_true: [files('disas.c'), gen])
loongarch_ss.add_all(when: 'CONFIG_TCG', if_true: [loongarch_tcg_ss])

target_arch += {'loongarch': loongarch_ss}
target_softmmu_arch += {'loongarch': loongarch_softmmu_ss}
target_softmmu_arch += {'loongarch': loongarch_system_ss}
14 changes: 6 additions & 8 deletions target/m68k/cpu.c
Expand Up @@ -80,10 +80,10 @@ static void m68k_cpu_reset_hold(Object *obj)
}

memset(env, 0, offsetof(CPUM68KState, end_reset_fields));
#ifdef CONFIG_SOFTMMU
cpu_m68k_set_sr(env, SR_S | SR_I);
#else
#ifdef CONFIG_USER_ONLY
cpu_m68k_set_sr(env, 0);
#else
cpu_m68k_set_sr(env, SR_S | SR_I);
#endif
for (i = 0; i < 8; i++) {
env->fregs[i].d = nan;
Expand Down Expand Up @@ -334,7 +334,7 @@ static void m68k_cpu_initfn(Object *obj)
cpu_set_cpustate_pointers(cpu);
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
static bool fpu_needed(void *opaque)
{
M68kCPU *s = opaque;
Expand Down Expand Up @@ -525,15 +525,13 @@ static const VMStateDescription vmstate_m68k_cpu = {
NULL
},
};
#endif

#ifndef CONFIG_USER_ONLY
#include "hw/core/sysemu-cpu-ops.h"

static const struct SysemuCPUOps m68k_sysemu_ops = {
.get_phys_page_debug = m68k_cpu_get_phys_page_debug,
};
#endif
#endif /* !CONFIG_USER_ONLY */

#include "hw/core/tcg-cpu-ops.h"

Expand Down Expand Up @@ -568,7 +566,7 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data)
cc->get_pc = m68k_cpu_get_pc;
cc->gdb_read_register = m68k_cpu_gdb_read_register;
cc->gdb_write_register = m68k_cpu_gdb_write_register;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
dc->vmsd = &vmstate_m68k_cpu;
cc->sysemu_ops = &m68k_sysemu_ops;
#endif
Expand Down
4 changes: 2 additions & 2 deletions target/m68k/helper.c
Expand Up @@ -1480,7 +1480,7 @@ void HELPER(set_mac_extu)(CPUM68KState *env, uint32_t val, uint32_t acc)
env->macc[acc + 1] = res;
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
void HELPER(ptest)(CPUM68KState *env, uint32_t addr, uint32_t is_read)
{
hwaddr physical;
Expand Down Expand Up @@ -1534,4 +1534,4 @@ void HELPER(reset)(CPUM68KState *env)
{
/* FIXME: reset all except CPU */
}
#endif
#endif /* !CONFIG_USER_ONLY */
2 changes: 1 addition & 1 deletion target/m68k/helper.h
Expand Up @@ -124,7 +124,7 @@ DEF_HELPER_FLAGS_4(bfffo_mem, TCG_CALL_NO_WG, i64, env, i32, s32, i32)
DEF_HELPER_3(chk, void, env, s32, s32)
DEF_HELPER_4(chk2, void, env, s32, s32, s32)

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
DEF_HELPER_3(ptest, void, env, i32, i32)
DEF_HELPER_3(pflush, void, env, i32, i32)
DEF_HELPER_FLAGS_1(reset, TCG_CALL_NO_RWG, void, env)
Expand Down
6 changes: 3 additions & 3 deletions target/m68k/meson.build
Expand Up @@ -9,11 +9,11 @@ m68k_ss.add(files(
'translate.c',
))

m68k_softmmu_ss = ss.source_set()
m68k_softmmu_ss.add(files(
m68k_system_ss = ss.source_set()
m68k_system_ss.add(files(
'm68k-semi.c',
'monitor.c'
))

target_arch += {'m68k': m68k_ss}
target_softmmu_arch += {'m68k': m68k_softmmu_ss}
target_softmmu_arch += {'m68k': m68k_system_ss}
28 changes: 14 additions & 14 deletions target/m68k/translate.c
Expand Up @@ -2637,10 +2637,10 @@ DISAS_INSN(swap)

DISAS_INSN(bkpt)
{
#if defined(CONFIG_SOFTMMU)
gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
#else
#if defined(CONFIG_USER_ONLY)
gen_exception(s, s->base.pc_next, EXCP_DEBUG);
#else
gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
#endif
}

Expand Down Expand Up @@ -2838,7 +2838,7 @@ DISAS_INSN(unlk)
tcg_gen_addi_i32(QREG_SP, src, 4);
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
DISAS_INSN(reset)
{
if (IS_USER(s)) {
Expand Down Expand Up @@ -4398,7 +4398,7 @@ DISAS_INSN(move_from_sr)
DEST_EA(env, insn, OS_WORD, sr, NULL);
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
DISAS_INSN(moves)
{
int opsize;
Expand Down Expand Up @@ -4605,7 +4605,7 @@ DISAS_INSN(cinv)
/* Invalidate cache line. Implement as no-op. */
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
DISAS_INSN(pflush)
{
TCGv opmode;
Expand Down Expand Up @@ -5352,7 +5352,7 @@ DISAS_INSN(ftrapcc)
do_trapcc(s, &c);
}

#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
DISAS_INSN(frestore)
{
TCGv addr;
Expand Down Expand Up @@ -5795,7 +5795,7 @@ void register_m68k_insns (CPUM68KState *env)
BASE(bitop_im, 08c0, ffc0);
INSN(arith_im, 0a80, fff8, CF_ISA_A);
INSN(arith_im, 0a00, ff00, M68K);
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
INSN(moves, 0e00, ff00, M68K);
#endif
INSN(cas, 0ac0, ffc0, CAS);
Expand Down Expand Up @@ -5824,7 +5824,7 @@ void register_m68k_insns (CPUM68KState *env)
BASE(move_to_ccr, 44c0, ffc0);
INSN(not, 4680, fff8, CF_ISA_A);
INSN(not, 4600, ff00, M68K);
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
BASE(move_to_sr, 46c0, ffc0);
#endif
INSN(nbcd, 4800, ffc0, M68K);
Expand All @@ -5841,7 +5841,7 @@ void register_m68k_insns (CPUM68KState *env)
BASE(tst, 4a00, ff00);
INSN(tas, 4ac0, ffc0, CF_ISA_B);
INSN(tas, 4ac0, ffc0, M68K);
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
INSN(halt, 4ac8, ffff, CF_ISA_A);
INSN(halt, 4ac8, ffff, M68K);
#endif
Expand All @@ -5855,7 +5855,7 @@ void register_m68k_insns (CPUM68KState *env)
BASE(trap, 4e40, fff0);
BASE(link, 4e50, fff8);
BASE(unlk, 4e58, fff8);
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
INSN(move_to_usp, 4e60, fff8, USP);
INSN(move_from_usp, 4e68, fff8, USP);
INSN(reset, 4e70, ffff, M68K);
Expand Down Expand Up @@ -5980,7 +5980,7 @@ void register_m68k_insns (CPUM68KState *env)
INSN(ftrapcc, f27a, fffe, FPU); /* opmode 010, 011 */
INSN(ftrapcc, f27c, ffff, FPU); /* opmode 100 */
INSN(fbcc, f280, ff80, FPU);
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
INSN(frestore, f340, ffc0, CF_FPU);
INSN(fsave, f300, ffc0, CF_FPU);
INSN(frestore, f340, ffc0, FPU);
Expand Down Expand Up @@ -6190,7 +6190,7 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, int flags)
break;
}
qemu_fprintf(f, "\n");
#ifdef CONFIG_SOFTMMU
#ifndef CONFIG_USER_ONLY
qemu_fprintf(f, "%sA7(MSP) = %08x %sA7(USP) = %08x %sA7(ISP) = %08x\n",
env->current_sp == M68K_SSP ? "->" : " ", env->sp[M68K_SSP],
env->current_sp == M68K_USP ? "->" : " ", env->sp[M68K_USP],
Expand All @@ -6204,5 +6204,5 @@ void m68k_cpu_dump_state(CPUState *cs, FILE *f, int flags)
env->mmu.ttr[M68K_ITTR0], env->mmu.ttr[M68K_ITTR1]);
qemu_fprintf(f, "MMUSR %08x, fault at %08x\n",
env->mmu.mmusr, env->mmu.ar);
#endif
#endif /* !CONFIG_USER_ONLY */
}
6 changes: 3 additions & 3 deletions target/microblaze/meson.build
Expand Up @@ -10,11 +10,11 @@ microblaze_ss.add(files(
'translate.c',
))

microblaze_softmmu_ss = ss.source_set()
microblaze_softmmu_ss.add(files(
microblaze_system_ss = ss.source_set()
microblaze_system_ss.add(files(
'mmu.c',
'machine.c',
))

target_arch += {'microblaze': microblaze_ss}
target_softmmu_arch += {'microblaze': microblaze_softmmu_ss}
target_softmmu_arch += {'microblaze': microblaze_system_ss}
4 changes: 2 additions & 2 deletions target/mips/meson.build
@@ -1,5 +1,5 @@
mips_user_ss = ss.source_set()
mips_softmmu_ss = ss.source_set()
mips_system_ss = ss.source_set()
mips_ss = ss.source_set()
mips_ss.add(files(
'cpu.c',
Expand All @@ -19,5 +19,5 @@ endif
mips_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'))

target_arch += {'mips': mips_ss}
target_softmmu_arch += {'mips': mips_softmmu_ss}
target_softmmu_arch += {'mips': mips_system_ss}
target_user_arch += {'mips': mips_user_ss}
2 changes: 1 addition & 1 deletion target/mips/sysemu/meson.build
@@ -1,4 +1,4 @@
mips_softmmu_ss.add(files(
mips_system_ss.add(files(
'addr.c',
'cp0.c',
'cp0_timer.c',
Expand Down
2 changes: 1 addition & 1 deletion target/mips/tcg/sysemu/meson.build
@@ -1,4 +1,4 @@
mips_softmmu_ss.add(files(
mips_system_ss.add(files(
'cp0_helper.c',
'mips-semi.c',
'special_helper.c',
Expand Down
6 changes: 3 additions & 3 deletions target/nios2/meson.build
Expand Up @@ -5,13 +5,13 @@ nios2_ss.add(files(
'translate.c',
))

nios2_softmmu_ss = ss.source_set()
nios2_softmmu_ss.add(files(
nios2_system_ss = ss.source_set()
nios2_system_ss.add(files(
'helper.c',
'monitor.c',
'mmu.c',
'nios2-semi.c',
))

target_arch += {'nios2': nios2_ss}
target_softmmu_arch += {'nios2': nios2_softmmu_ss}
target_softmmu_arch += {'nios2': nios2_system_ss}
6 changes: 3 additions & 3 deletions target/openrisc/meson.build
Expand Up @@ -14,12 +14,12 @@ openrisc_ss.add(files(
'translate.c',
))

openrisc_softmmu_ss = ss.source_set()
openrisc_softmmu_ss.add(files(
openrisc_system_ss = ss.source_set()
openrisc_system_ss.add(files(
'interrupt.c',
'machine.c',
'mmu.c',
))

target_arch += {'openrisc': openrisc_ss}
target_softmmu_arch += {'openrisc': openrisc_softmmu_ss}
target_softmmu_arch += {'openrisc': openrisc_system_ss}
20 changes: 10 additions & 10 deletions target/ppc/cpu_init.c
Expand Up @@ -5841,7 +5841,7 @@ POWERPC_FAMILY(970)(ObjectClass *oc, void *data)
(1ull << MSR_PMM) |
(1ull << MSR_RI);
pcc->mmu_model = POWERPC_MMU_64B;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
pcc->hash64_opts = &ppc_hash64_opts_basic;
#endif
pcc->excp_model = POWERPC_EXCP_970;
Expand Down Expand Up @@ -5920,7 +5920,7 @@ POWERPC_FAMILY(POWER5P)(ObjectClass *oc, void *data)
pcc->lpcr_mask = LPCR_RMLS | LPCR_ILE | LPCR_LPES0 | LPCR_LPES1 |
LPCR_RMI | LPCR_HDICE;
pcc->mmu_model = POWERPC_MMU_2_03;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
pcc->hash64_opts = &ppc_hash64_opts_basic;
pcc->lrg_decr_bits = 32;
#endif
Expand Down Expand Up @@ -6037,7 +6037,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data)
LPCR_LPES0 | LPCR_LPES1 | LPCR_HDICE;
pcc->lpcr_pm = LPCR_P7_PECE0 | LPCR_P7_PECE1 | LPCR_P7_PECE2;
pcc->mmu_model = POWERPC_MMU_2_06;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
pcc->hash64_opts = &ppc_hash64_opts_POWER7;
pcc->lrg_decr_bits = 32;
#endif
Expand Down Expand Up @@ -6181,7 +6181,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
pcc->lpcr_pm = LPCR_P8_PECE0 | LPCR_P8_PECE1 | LPCR_P8_PECE2 |
LPCR_P8_PECE3 | LPCR_P8_PECE4;
pcc->mmu_model = POWERPC_MMU_2_07;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
pcc->hash64_opts = &ppc_hash64_opts_POWER7;
pcc->lrg_decr_bits = 32;
pcc->n_host_threads = 8;
Expand All @@ -6197,7 +6197,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data)
pcc->l1_icache_size = 0x8000;
}

#ifdef CONFIG_SOFTMMU
#ifndef CONFIG_USER_ONLY
/*
* Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings
* Encoded as array of int_32s in the form:
Expand All @@ -6214,7 +6214,7 @@ static struct ppc_radix_page_info POWER9_radix_page_info = {
0x4000001e /* 1G - enc: 0x2 */
}
};
#endif /* CONFIG_SOFTMMU */
#endif /* CONFIG_USER_ONLY */

static void init_proc_POWER9(CPUPPCState *env)
{
Expand Down Expand Up @@ -6371,7 +6371,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
LPCR_HEIC | LPCR_LPES0 | LPCR_HVICE | LPCR_HDICE;
pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE;
pcc->mmu_model = POWERPC_MMU_3_00;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
/* segment page size remain the same */
pcc->hash64_opts = &ppc_hash64_opts_POWER7;
pcc->radix_page_info = &POWER9_radix_page_info;
Expand All @@ -6389,7 +6389,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data)
pcc->l1_icache_size = 0x8000;
}

#ifdef CONFIG_SOFTMMU
#ifndef CONFIG_USER_ONLY
/*
* Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings
* Encoded as array of int_32s in the form:
Expand All @@ -6406,7 +6406,7 @@ static struct ppc_radix_page_info POWER10_radix_page_info = {
0x4000001e /* 1G - enc: 0x2 */
}
};
#endif /* CONFIG_SOFTMMU */
#endif /* !CONFIG_USER_ONLY */

static void init_proc_POWER10(CPUPPCState *env)
{
Expand Down Expand Up @@ -6547,7 +6547,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data)

pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE;
pcc->mmu_model = POWERPC_MMU_3_00;
#if defined(CONFIG_SOFTMMU)
#if !defined(CONFIG_USER_ONLY)
/* segment page size remain the same */
pcc->hash64_opts = &ppc_hash64_opts_POWER7;
pcc->radix_page_info = &POWER10_radix_page_info;
Expand Down
6 changes: 2 additions & 4 deletions target/ppc/helper_regs.c
Expand Up @@ -310,7 +310,7 @@ int hreg_store_msr(CPUPPCState *env, target_ulong value, int alter_hv)
return excp;
}

#ifdef CONFIG_SOFTMMU
#ifndef CONFIG_USER_ONLY
void store_40x_sler(CPUPPCState *env, uint32_t val)
{
/* XXX: TO BE FIXED */
Expand All @@ -320,9 +320,7 @@ void store_40x_sler(CPUPPCState *env, uint32_t val)
}
env->spr[SPR_405_SLER] = val;
}
#endif /* CONFIG_SOFTMMU */

#ifndef CONFIG_USER_ONLY
void check_tlb_flush(CPUPPCState *env, bool global)
{
CPUState *cs = env_cpu(env);
Expand All @@ -341,7 +339,7 @@ void check_tlb_flush(CPUPPCState *env, bool global)
tlb_flush(cs);
}
}
#endif
#endif /* !CONFIG_USER_ONLY */

/**
* _spr_register
Expand Down
10 changes: 5 additions & 5 deletions target/ppc/meson.build
Expand Up @@ -33,26 +33,26 @@ ppc_ss.add(gen)
ppc_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c'))
ppc_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user_only_helper.c'))

ppc_softmmu_ss = ss.source_set()
ppc_softmmu_ss.add(files(
ppc_system_ss = ss.source_set()
ppc_system_ss.add(files(
'arch_dump.c',
'machine.c',
'mmu-hash32.c',
'mmu_common.c',
'ppc-qmp-cmds.c',
))
ppc_softmmu_ss.add(when: 'CONFIG_TCG', if_true: files(
ppc_system_ss.add(when: 'CONFIG_TCG', if_true: files(
'mmu_helper.c',
), if_false: files(
'tcg-stub.c',
))

ppc_softmmu_ss.add(when: 'TARGET_PPC64', if_true: files(
ppc_system_ss.add(when: 'TARGET_PPC64', if_true: files(
'compat.c',
'mmu-book3s-v3.c',
'mmu-hash64.c',
'mmu-radix64.c',
))

target_arch += {'ppc': ppc_ss}
target_softmmu_arch += {'ppc': ppc_softmmu_ss}
target_softmmu_arch += {'ppc': ppc_system_ss}
6 changes: 3 additions & 3 deletions target/riscv/meson.build
Expand Up @@ -24,8 +24,8 @@ riscv_ss.add(files(
))
riscv_ss.add(when: 'CONFIG_KVM', if_true: files('kvm.c'), if_false: files('kvm-stub.c'))

riscv_softmmu_ss = ss.source_set()
riscv_softmmu_ss.add(files(
riscv_system_ss = ss.source_set()
riscv_system_ss.add(files(
'arch_dump.c',
'pmp.c',
'debug.c',
Expand All @@ -37,4 +37,4 @@ riscv_softmmu_ss.add(files(
))

target_arch += {'riscv': riscv_ss}
target_softmmu_arch += {'riscv': riscv_softmmu_ss}
target_softmmu_arch += {'riscv': riscv_system_ss}
2 changes: 1 addition & 1 deletion target/s390x/kvm/meson.build
Expand Up @@ -14,6 +14,6 @@ s390x_ss.add(when: 'CONFIG_KVM', if_true: files(
# - KVM is enabled
# - the linker supports --s390-pgste
if host_machine.cpu_family() == 's390x' and cc.has_link_argument('-Wl,--s390-pgste')
s390x_softmmu_ss.add(when: 'CONFIG_KVM',
s390x_system_ss.add(when: 'CONFIG_KVM',
if_true: declare_dependency(link_args: ['-Wl,--s390-pgste']))
endif
6 changes: 3 additions & 3 deletions target/s390x/meson.build
Expand Up @@ -18,8 +18,8 @@ gen_features_h = custom_target('gen-features.h',

s390x_ss.add(gen_features_h)

s390x_softmmu_ss = ss.source_set()
s390x_softmmu_ss.add(files(
s390x_system_ss = ss.source_set()
s390x_system_ss.add(files(
'helper.c',
'arch_dump.c',
'diag.c',
Expand All @@ -40,5 +40,5 @@ subdir('tcg')
subdir('kvm')

target_arch += {'s390x': s390x_ss}
target_softmmu_arch += {'s390x': s390x_softmmu_ss}
target_softmmu_arch += {'s390x': s390x_system_ss}
target_user_arch += {'s390x': s390x_user_ss}
6 changes: 3 additions & 3 deletions target/sh4/meson.build
Expand Up @@ -7,8 +7,8 @@ sh4_ss.add(files(
'translate.c',
))

sh4_softmmu_ss = ss.source_set()
sh4_softmmu_ss.add(files('monitor.c'))
sh4_system_ss = ss.source_set()
sh4_system_ss.add(files('monitor.c'))

target_arch += {'sh4': sh4_ss}
target_softmmu_arch += {'sh4': sh4_softmmu_ss}
target_softmmu_arch += {'sh4': sh4_system_ss}
6 changes: 3 additions & 3 deletions target/sparc/meson.build
Expand Up @@ -12,12 +12,12 @@ sparc_ss.add(files(
sparc_ss.add(when: 'TARGET_SPARC', if_true: files('int32_helper.c'))
sparc_ss.add(when: 'TARGET_SPARC64', if_true: files('int64_helper.c', 'vis_helper.c'))

sparc_softmmu_ss = ss.source_set()
sparc_softmmu_ss.add(files(
sparc_system_ss = ss.source_set()
sparc_system_ss.add(files(
'machine.c',
'mmu_helper.c',
'monitor.c',
))

target_arch += {'sparc': sparc_ss}
target_softmmu_arch += {'sparc': sparc_softmmu_ss}
target_softmmu_arch += {'sparc': sparc_system_ss}
2 changes: 0 additions & 2 deletions target/tricore/helper.c
Expand Up @@ -31,7 +31,6 @@ enum {
TLBRET_MATCH = 0
};

#if defined(CONFIG_SOFTMMU)
static int get_physical_address(CPUTriCoreState *env, hwaddr *physical,
int *prot, target_ulong address,
MMUAccessType access_type, int mmu_idx)
Expand All @@ -57,7 +56,6 @@ hwaddr tricore_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
}
return phys_addr;
}
#endif

/* TODO: Add exeption support*/
static void raise_mmu_exception(CPUTriCoreState *env, target_ulong address,
Expand Down
4 changes: 2 additions & 2 deletions target/tricore/meson.build
Expand Up @@ -9,7 +9,7 @@ tricore_ss.add(files(
))
tricore_ss.add(zlib)

tricore_softmmu_ss = ss.source_set()
tricore_system_ss = ss.source_set()

target_arch += {'tricore': tricore_ss}
target_softmmu_arch += {'tricore': tricore_softmmu_ss}
target_softmmu_arch += {'tricore': tricore_system_ss}
6 changes: 3 additions & 3 deletions target/xtensa/meson.build
Expand Up @@ -15,13 +15,13 @@ xtensa_ss.add(files(
'xtensa-isa.c',
))

xtensa_softmmu_ss = ss.source_set()
xtensa_softmmu_ss.add(files(
xtensa_system_ss = ss.source_set()
xtensa_system_ss.add(files(
'dbg_helper.c',
'mmu_helper.c',
'monitor.c',
'xtensa-semi.c',
))

target_arch += {'xtensa': xtensa_ss}
target_softmmu_arch += {'xtensa': xtensa_softmmu_ss}
target_softmmu_arch += {'xtensa': xtensa_system_ss}
2 changes: 1 addition & 1 deletion tcg/meson.build
Expand Up @@ -42,4 +42,4 @@ libtcg_softmmu = static_library('tcg_softmmu',

tcg_softmmu = declare_dependency(link_with: libtcg_softmmu,
dependencies: tcg_ss.dependencies())
softmmu_ss.add(tcg_softmmu)
system_ss.add(tcg_softmmu)
23 changes: 16 additions & 7 deletions tcg/ppc/tcg-target.c.inc
Expand Up @@ -29,15 +29,24 @@
/*
* Standardize on the _CALL_FOO symbols used by GCC:
* Apple XCode does not define _CALL_DARWIN.
* Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV (32-bit).
* Clang defines _CALL_ELF (64-bit) but not _CALL_SYSV or _CALL_AIX.
*/
#if !defined(_CALL_SYSV) && \
!defined(_CALL_DARWIN) && \
!defined(_CALL_AIX) && \
!defined(_CALL_ELF)
# if defined(__APPLE__)
#if TCG_TARGET_REG_BITS == 64
# ifdef _CALL_AIX
/* ok */
# elif defined(_CALL_ELF) && _CALL_ELF == 1
# define _CALL_AIX
# elif defined(_CALL_ELF) && _CALL_ELF == 2
/* ok */
# else
# error "Unknown ABI"
# endif
#else
# if defined(_CALL_SYSV) || defined(_CALL_DARWIN)
/* ok */
# elif defined(__APPLE__)
# define _CALL_DARWIN
# elif defined(__ELF__) && TCG_TARGET_REG_BITS == 32
# elif defined(__ELF__)
# define _CALL_SYSV
# else
# error "Unknown ABI"
Expand Down
2 changes: 1 addition & 1 deletion trace/meson.build
@@ -1,4 +1,4 @@
softmmu_ss.add(files('trace-hmp-cmds.c'))
system_ss.add(files('trace-hmp-cmds.c'))

specific_ss.add(files('control-target.c'))

Expand Down
30 changes: 15 additions & 15 deletions ui/meson.build
@@ -1,9 +1,9 @@
softmmu_ss.add(pixman)
specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: pixman) # for the include path
specific_ss.add(when: ['CONFIG_SOFTMMU'], if_true: opengl) # for the include path
system_ss.add(pixman)
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: pixman) # for the include path
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY'], if_true: opengl) # for the include path

softmmu_ss.add(png)
softmmu_ss.add(files(
system_ss.add(png)
system_ss.add(files(
'clipboard.c',
'console.c',
'cursor.c',
Expand All @@ -19,16 +19,16 @@ softmmu_ss.add(files(
'util.c',
))
if dbus_display
softmmu_ss.add(files('dbus-module.c'))
system_ss.add(files('dbus-module.c'))
endif
softmmu_ss.add([spice_headers, files('spice-module.c')])
softmmu_ss.add(when: spice_protocol, if_true: files('vdagent.c'))
system_ss.add([spice_headers, files('spice-module.c')])
system_ss.add(when: spice_protocol, if_true: files('vdagent.c'))

softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files(
system_ss.add(when: 'CONFIG_LINUX', if_true: files(
'input-linux.c',
'udmabuf.c',
))
softmmu_ss.add(when: cocoa, if_true: files('cocoa.m'))
system_ss.add(when: cocoa, if_true: files('cocoa.m'))

vnc_ss = ss.source_set()
vnc_ss.add(files(
Expand All @@ -45,8 +45,8 @@ vnc_ss.add(files(
))
vnc_ss.add(zlib, jpeg, gnutls)
vnc_ss.add(when: sasl, if_true: files('vnc-auth-sasl.c'))
softmmu_ss.add_all(when: vnc, if_true: vnc_ss)
softmmu_ss.add(when: vnc, if_false: files('vnc-stubs.c'))
system_ss.add_all(when: vnc, if_true: vnc_ss)
system_ss.add(when: vnc, if_false: files('vnc-stubs.c'))

ui_modules = {}

Expand All @@ -56,7 +56,7 @@ if curses.found()
ui_modules += {'curses' : curses_ss}
endif

softmmu_ss.add(opengl)
system_ss.add(opengl)
if opengl.found()
opengl_ss = ss.source_set()
opengl_ss.add(gbm)
Expand Down Expand Up @@ -98,7 +98,7 @@ if dbus_display
endif

if gtk.found()
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))

gtk_ss = ss.source_set()
gtk_ss.add(gtk, vte, pixman, files('gtk.c'))
Expand All @@ -112,7 +112,7 @@ if gtk.found()
endif

if sdl.found()
softmmu_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))
system_ss.add(when: 'CONFIG_WIN32', if_true: files('win32-kbd-hook.c'))

sdl_ss = ss.source_set()
sdl_ss.add(sdl, sdl_image, pixman, glib, files(
Expand Down