# Re: \[PATCH v3 5/8\] x86/sme: Replace occurrences of sme\_active() with cc\_platform\_has()

- From: Kirill A. Shutemov \<hidden\>
- Date: 2021-09-22 21:06:01 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2021/09/214788
- Thread: https://ratatoskr.run/linuxppc-dev/2021/09/213849/t.md

```text
On Wed, Sep 22, 2021 at 09:52:07PM +0200, Borislav Petkov wrote:
> On Wed, Sep 22, 2021 at 05:30:15PM +0300, Kirill A. Shutemov wrote:
> > Not fine, but waiting to blowup with random build environment change.
> 
> Why is it not fine?
> 
> Are you suspecting that the compiler might generate something else and
> not a rip-relative access?

Yes. We had it before for __supported_pte_mask and other users of
fixup_pointer().

See for instance 4a09f0210c8b ("x86/boot/64/clang: Use fixup_pointer() to
access '__supported_pte_mask'")

Unless we find other way to guarantee RIP-relative access, we must use
fixup_pointer() to access any global variables.

-- 
 Kirill A. Shutemov
```
