but I haven't (yet) found anywhere that these values are actually used for anything. What are the RSPn for?RSPn—Bytes 1Bh–04h. The full 64-bit canonical forms of the stack pointers (RSP) for privilege levels 0 through 2.
What is the purpose of the RSPn in a 64-bit TSS?
What is the purpose of the RSPn in a 64-bit TSS?
The AMD manual says:
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: What is the purpose of the RSPn in a 64-bit TSS?
The SPx values in the TSS hold the stack pointer for when a higher privilege is entered. (userspace should not be able to dictate where the kernel stack is)
Re: What is the purpose of the RSPn in a 64-bit TSS?
Aaaah, I have found my misunderstanding of the AMD manual: I had only read the information about 64-bit interrupt stack switching, not the 32-bit, and when it said legacy stack switching mechanism was used for IST=0, I assumed that was 'leave stack as it is' for some reason...looking now at the 32-bit interrupt stack switching it *does* explain how the ESPn are used in 32-bit mode, and hence RSPn in 64-bit mode! Thanks!