Re: [PATCH v2 RESEND] x86/asm: Force native_apic_mem_read to use mov

From: Tom Lendacky
Date: Wed Oct 05 2022 - 09:29:12 EST


On 10/3/22 18:11, H. Peter Anvin wrote:
On October 3, 2022 4:01:01 PM PDT, Adam Dunlap <acdunlap@xxxxxxxxxx> wrote:
Thanks for all the responses. Is the consensus that we should use the
readl function here or instead use inline assembly directly as in the patch
I originally sent out:

asm_inline("movl %1, %0" : "=r"(out) : "m"(*addr));

? The readl function has this exact same code, I'm just not sure
which version fits better stylistically.

Is mov with an arbitrary addressing mode still acceptable for whatever is causing this problem?

The acceptable forms of MOV are covered by insn_decode_mmio() in arch/x86/lib/insn-eval.c.

Thanks,
Tom