Commit c03c520d authored by Andreas Färber's avatar Andreas Färber
Browse files

cpu: Unconditionalize CPUState fields



Commits fc8c5b8c (Makefile.user: Define
CONFIG_USER_ONLY for libuser/) and
dd83b06a (qom: Introduce CPU class)
specifically prepared the qom/cpu.c file to be compiled differently for
softmmu and *-user. This broke as part of build system refactorings
while CPU patches were in flight, adding conditional fields
kvm_fd (8737c51c) and
kvm_vcpu_dirty (20d695a9) for softmmu.

linux-user and bsd-user would therefore get a CPUState type with
instance_size ~8 bytes longer than expected.
Fix this by unconditionally having the fields in CPUState.

In practice, target-specific CPU types' instance_size would compensate
this, and upstream qom/cpu.c does not yet touch any affected field.

Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 2dddbc21
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -93,10 +93,8 @@ struct CPUState {
    bool stop;
    bool stopped;

#if !defined(CONFIG_USER_ONLY)
    int kvm_fd;
    bool kvm_vcpu_dirty;
#endif
    struct KVMState *kvm_state;
    struct kvm_run *kvm_run;