• Roman Pen's avatar
    i386/kvm: do not zero out segment flags if segment is unusable or not present · d45fc087
    Roman Pen authored
    This is a fix for the problem [1], where VMCB.CPL was set to 0 and interrupt
    was taken on userspace stack.  The root cause lies in the specific AMD CPU
    behaviour which manifests itself as unusable segment attributes on SYSRET[2].
    
    Here in this patch flags are not touched even segment is unusable or is not
    present, therefore CPL (which is stored in DPL field) should not be lost and
    will be successfully restored on kvm/svm kernel side.
    
    Also current patch should not break desired behavior described in this commit:
    
    4cae9c97 ("target-i386: kvm: clear unusable segments' flags in migration")
    
    since present bit will be dropped if segment is unusable or is not present.
    
    This is the second part of the whole fix of the corresponding problem [1],
    first part is related to kvm/svm kernel side and does exactly the same:
    segment attributes are not zeroed out.
    
    [1] Message id: CAJrWOzD6Xq==b-zYCDdFLgSRMPM-NkNuTSDFEtX=7MreT45i7Q@mail.gmail.com
    [2] Message id: 5d120f358612d73fc909f5bfa47e7bd082db0af0.1429841474.git.luto@kernel.org
    Signed-off-by: 's avatarRoman Pen <roman.penyaev@profitbricks.com>
    Signed-off-by: 's avatarMikhail Sennikovskii <mikhail.sennikovskii@profitbricks.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krčmář <rkrcmar@redhat.com>
    Cc: Michael Chapman <mike@very.puzzling.org>
    Cc: qemu-devel@nongnu.org
    Message-Id: <20170601085604.12980-1-roman.penyaev@profitbricks.com>
    Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
    d45fc087
Name
Last commit
Last update
..
alpha Loading commit data...
arm Loading commit data...
cris Loading commit data...
hppa Loading commit data...
i386 Loading commit data...
lm32 Loading commit data...
m68k Loading commit data...
microblaze Loading commit data...
mips Loading commit data...
moxie Loading commit data...
nios2 Loading commit data...
openrisc Loading commit data...
ppc Loading commit data...
s390x Loading commit data...
sh4 Loading commit data...
sparc Loading commit data...
tilegx Loading commit data...
tricore Loading commit data...
unicore32 Loading commit data...
xtensa Loading commit data...