lkml.org 
[lkml]   [2021]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC][PATCH 15/22] x86,vmx: Remove .fixup usage
From
On 11/6/21 09:36, Peter Zijlstra wrote:
>> Ouch, good catch. It should be actually very simple to fix it, just mark
>> "value" as an "early clobber" output:
>>
>> : ASM_CALL_CONSTRAINT, "=&r"(value) : "r"(field) : "cc");
>>
>> That's an output which is written before the instruction is finished using
>> the input operands. The manual even says "this operand may not lie in a
>> register that is read by the instruction or as part of any memory address",
>> which is exactly what you caught with %1 and %2 both being the same GPR.
> Yes, but as Sean points out, that will negatively affect code-gen on the
> happy path. But perhaps that's acceptable if we add the asm-goto-output
> variant?

I think it's acceptable even without the #ifdef. Forcing registers
using the a/b/c/d/S/D constraints takes away some freedom from the
compiler, but using two "r" registers is going to give as good assembly
as anything else. Most callers of __vmcs_readl call it either at the
beginning or at the end of a function, where there aren't many live
registers anyway.

Paolo

\
 
 \ /
  Last update: 2021-11-07 20:15    [W:0.100 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site