I released v2 of this series to incorporate Alex's changes with the generic instruction emulator into it. I'll incorporate this feedback into v3. On Mon, Aug 10, 2020 at 10:24 AM Jim Mattson <jmattson@xxxxxxxxxx> wrote: > > On Fri, Aug 7, 2020 at 4:28 PM Alexander Graf <graf@xxxxxxxxxx> wrote: > > > > > > > > On 04.08.20 06:20, Aaron Lewis wrote: > > > > + __asm__ __volatile__("rdmsr_start: rdmsr; rdmsr_end:" : > > > + "=a"(a), "=d"(d) : "c"(msr) : "memory"); > > > > I personally would find > > > > asm volatile("rdmsr_start:"); > > r = rdmsr(msr); > > asm volatile("rdmsr_end:"); > > > > more readable. Same for wrmsr. > > I don't think the suggested approach is guaranteed to work, because "r > = rdmsr(msr)" isn't always going to be a single instruction. The > compiler may do some register shuffling before and/or after the rdmsr > instruction itself, and I believe Aaron wants the labels immediately > before and after the rdmsr instruction.