Skip to main content
8 events
when toggle format what by license comment
Jun 11, 2020 at 14:16 history edited CommunityBot
Commonmark migration
Jun 1, 2019 at 18:15 vote accept Mario Carneiro
May 31, 2019 at 18:30 comment added Johan Myréen @MarioCarneiro Yes, you are right, even the manual says so. It is not an error to just store the non-canonical address in rsp, you have to reference memory using the invalid address to trigger the exception. I don't know why they mention the non-canonical addresses separately, because they are illegal anyway.
May 31, 2019 at 16:34 comment added Mario Carneiro I was unable to demonstrate any side effects of, for example, setting R10 <- RSP, RSP <- 0xbababa, RSP <- R10 where the bad value of RSP is never used before it is restored to a reasonable value. This probably isn't a very good test, but I have a hard time believing that this would ever cause a fault on its own without significant performance overhead in the hardware.
May 31, 2019 at 12:12 comment added Johan Myréen I guess they still call it Stack Fault Exception, since they mention the Violation Exception in the manual. One thing is for sure: you'll get an exception of you tread outside the allowed memory region.
May 31, 2019 at 11:27 comment added Philip Couling @JohanMyréen Thanks that's pretty close to what I thought. The one detail I couldn't find was what this change has done to the Stack Fault Exception. Has the loss of SP removed the exception entirely or can it now be triggered by rsp?
May 31, 2019 at 11:22 comment added Johan Myréen The old SP register has become just RSP, and SS has effectively vanished. The x86-64 in long mode, which is the "normal" mode in 64-bit Linux, does not really use segmentation anymore. Only "the FS and GS segments are retained in vestigial form for use as extra-base pointers to operating system structures". WIkipedia. Loading the rsp with a non-canonical address can cause an exception, where a non-canonical means an address that does not contain all ones or all zeroes in (typically) the upper 16 bits of the 64-bit virtual address.
May 31, 2019 at 11:00 history answered Philip Couling CC BY-SA 4.0