Messages in this thread | | | From | Kevin Loughlin <> | Date | Wed, 10 Jan 2024 09:28:21 -0800 | Subject | Re: [RFC PATCH] x86/sev: x86/sev: enforce PC-relative addressing in clang |
| |
On Wed, Jan 10, 2024 at 5:37 AM Kirill A. Shutemov <kirill.shutemov@linux.intel.com> wrote: > > Similar issues was fixed before with fixup_pointer() tricks. Have you > tried looking this direction. > > Relevant thread starting with: > > https://lore.kernel.org/all/20210920192341.maue7db4lcbdn46x@box.shutemov.name
Yes, I considered using `fixup_pointer()` as well, and I agree that it remains a valid option to solve this problem. I just now mentioned the primary downside to using `fixup_pointer()` in my response to Andi (https://lore.kernel.org/lkml/CAGdbjmJcQeLWroBkbRC-cFQ6OuMHONsGLzpUrrA5k3uc8Rzkmw@mail.gmail.com/). Namely, we would have to pass around `physaddr` from `__startup64()` to any functions wanting to use `fixup_pointer()`). However, we should be able to get around needing `physaddr` by using something like the `GET_RIP_RELATIVE_PTR()` macro that I proposed in the same reply (forthcoming in v2 of this RFC PATCH).
| |