• Simon Guo's avatar
    KVM: PPC: Fix a mmio_host_swabbed uninitialized usage issue · f19d1f36
    Simon Guo authored
    When KVM emulates VMX store, it will invoke kvmppc_get_vmx_data() to
    retrieve VMX reg val. kvmppc_get_vmx_data() will check mmio_host_swabbed
    to decide which double word of vr[] to be used. But the
    mmio_host_swabbed can be uninitialized during VMX store procedure:
    
    kvmppc_emulate_loadstore
    	\- kvmppc_handle_store128_by2x64
    		\- kvmppc_get_vmx_data
    
    So vcpu->arch.mmio_host_swabbed is not meant to be used at all for
    emulation of store instructions, and this patch makes that true for
    VMX stores. This patch also initializes mmio_host_swabbed to avoid
    possible future problems.
    Signed-off-by: default avatarSimon Guo <wei.guo.simon@gmail.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    f19d1f36
powerpc.c 49.9 KB