Skip to contentSkip to conversation

sysret sets invalid ss

Qemu-devel dascandy 1 participant 3 messages Sep 3, 2010 – Jan 17, 2017

lore
Share & tools
lore

dascandy

author
#0 lore raw

Public bug reported:

I'm developing an OS. I use only sysret to enter user space. When an interrupt occurred, it would GPF on iretq'ing from it. On investigating, the cs on the stack is 0x2b (valid and correct). The ss on the stack is 0x20, which has a rpl of 0 which is incorrect. iretq checks that and gpf's. Making the irq handler manually modify it to 0x23 fixes it locally.

This happens on the non-kvm'ed qemu. I haven't tried the kvm'ed one. Qemu version 0.12.5. I haven't tried with the current development version either.

** Affects: qemu
Importance: Undecided
Status: New

** Tags: dpl ss sysret

Signature · 11 lines
sysret sets invalid ss
https://bugs.launchpad.net/bugs/629791
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I'm developing an OS. I use only sysret to enter user space. When an interrupt occurred, it would GPF on iretq'ing from it. On investigating, the cs on the stack is 0x2b (valid and correct). The ss on the stack is 0x20, which has a rpl of 0 which is incorrect. iretq checks that and gpf's. Making the irq handler manually modify it to 0x23 fixes it locally.

This happens on the non-kvm'ed qemu. I haven't tried the kvm'ed one. Qemu version 0.12.5. I haven't tried with the current development version either.
author
#1 lore raw

Minor update, I found that I made a mistake with the value in STAR. I loaded 0x18 into the top 16 bits, so the bug is not that SS is 0x20 (which I thought to be wrong but was my own mistake). Why does it set CS=0x2b from that value & run?

Signature · 11 lines
sysret sets invalid ss
https://bugs.launchpad.net/bugs/629791
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
I'm developing an OS. I use only sysret to enter user space. When an interrupt occurred, it would GPF on iretq'ing from it. On investigating, the cs on the stack is 0x2b (valid and correct). The ss on the stack is 0x20, which has a rpl of 0 which is incorrect. iretq checks that and gpf's. Making the irq handler manually modify it to 0x23 fixes it locally.

This happens on the non-kvm'ed qemu. I haven't tried the kvm'ed one. Qemu version 0.12.5. I haven't tried with the current development version either.
#2 lore raw
In reply to dascandy

** Changed in: qemu
Status: New => Invalid

Signature · 24 lines
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/629791

Title:
  sysret sets invalid ss

Status in QEMU:
  Invalid

Bug description:
  I'm developing an OS. I use only sysret to enter user space. When an
  interrupt occurred, it would GPF on iretq'ing from it. On
  investigating, the cs on the stack is 0x2b (valid and correct). The ss
  on the stack is 0x20, which has a rpl of 0 which is incorrect. iretq
  checks that and gpf's. Making the irq handler manually modify it to
  0x23 fixes it locally.

  This happens on the non-kvm'ed qemu. I haven't tried the kvm'ed one.
  Qemu version 0.12.5. I haven't tried with the current development
  version either.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/629791/+subscriptions