Luca Dariz, le jeu. 02 mars 2023 14:54:51 +0100, a ecrit:
> we could even sum up the discussion above with:
>
> : "memory" /* wrmsr is a Serializing Instruction,
> * therefore we need serialization from the
> * compiler
Il 02/03/23 14:14, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 09:20:15 +0100, a ecrit:
Il 02/03/23 09:00, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18:
On Thu, Mar 2, 2023 at 4:14 PM Samuel Thibault wrote:
> Ok, then perhaps
>
> "memory" /* wrmsr usage needs serialization from the compiler too */
How about /* wrmsr may cause a read from memory, so make the compiler
flush any changes */
Sergey
Luca Dariz, le jeu. 02 mars 2023 09:20:15 +0100, a ecrit:
> Il 02/03/23 09:00, Samuel Thibault ha scritto:
> > Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
> > > Il 01/03/23 21:18, Samuel Thibault ha scritto:
> > > > Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
> > > > > +
Il 02/03/23 09:00, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
+asm volatile("wrmsr"
+ :
+ : "c" (regaddr), "a"
My, should have re-read...
Samuel Thibault, le jeu. 02 mars 2023 09:00:40 +0100, a ecrit:
> I'm not saying it's not a serializing instruction.
>
> I'm saying that the compiler does not have to *care* about the
> instruction being serializing.
>
> But I'm also saying that the very reason why the
Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
> Il 01/03/23 21:18, Samuel Thibault ha scritto:
> > Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
> > > +asm volatile("wrmsr"
> > > + :
> > > + : "c" (regaddr), "a" (low), "d" (high)
> > > +
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
+asm volatile("wrmsr"
+ :
+ : "c" (regaddr), "a" (low), "d" (high)
+ : "memory" /* wrmsr is a serializing instruction */
The comment cou
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
> +asm volatile("wrmsr"
> + :
> + : "c" (regaddr), "a" (low), "d" (high)
> + : "memory" /* wrmsr is a serializing instruction */
The comment could be misleading.
The fact that it's a ser
While theoretically we could still use the same call gate as for
32-bit userspace, it doesn't seem very common, and gcc seems to not
encode properly the instruction. Instead we use syscall/sysret as
other kernels (e.g. XNU,Linux). This version still has some
limitations, but should be enough to sta
10 matches
Mail list logo