diff mbox series

x86/kvm/VMX: drop bad asm() clobber from nested_vmx_check_vmentry_hw()

Message ID 5CEBA3B80200007800232856@prv1-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show
Series x86/kvm/VMX: drop bad asm() clobber from nested_vmx_check_vmentry_hw() | expand

Commit Message

Jan Beulich May 27, 2019, 8:45 a.m. UTC
While upstream gcc doesn't detect conflicts on cc (yet), it really
should, and hence "cc" should not be specified for asm()-s also having
"=@cc<cond>" outputs. (It is quite pointless anyway to specify a "cc"
clobber in x86 inline assembly, since the compiler assumes it to be
always clobbered, and has no means [yet] to suppress this behavior.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Sean Christopherson May 30, 2019, 6:30 p.m. UTC | #1
On Mon, May 27, 2019 at 02:45:44AM -0600, Jan Beulich wrote:
> While upstream gcc doesn't detect conflicts on cc (yet), it really
> should, and hence "cc" should not be specified for asm()-s also having
> "=@cc<cond>" outputs. (It is quite pointless anyway to specify a "cc"
> clobber in x86 inline assembly, since the compiler assumes it to be
> always clobbered, and has no means [yet] to suppress this behavior.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

FWIW (mostly to satisfy my curiosity):

Fixes: bbc0b8239257 ("KVM: nVMX: Capture VM-Fail via CC_{SET,OUT} in nested early checks")

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>

> 
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -2781,7 +2781,7 @@ static int nested_vmx_check_vmentry_hw(s
>  		[launched]"i"(offsetof(struct loaded_vmcs, launched)),
>  		[host_state_rsp]"i"(offsetof(struct loaded_vmcs, host_state.rsp)),
>  		[wordsize]"i"(sizeof(ulong))
> -	      : "cc", "memory"
> +	      : "memory"
>  	);
>  
>  	if (vmx->msr_autoload.host.nr)
> 
>
Paolo Bonzini June 4, 2019, 5:20 p.m. UTC | #2
On 27/05/19 10:45, Jan Beulich wrote:
> While upstream gcc doesn't detect conflicts on cc (yet), it really
> should, and hence "cc" should not be specified for asm()-s also having
> "=@cc<cond>" outputs. (It is quite pointless anyway to specify a "cc"
> clobber in x86 inline assembly, since the compiler assumes it to be
> always clobbered, and has no means [yet] to suppress this behavior.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -2781,7 +2781,7 @@ static int nested_vmx_check_vmentry_hw(s
>  		[launched]"i"(offsetof(struct loaded_vmcs, launched)),
>  		[host_state_rsp]"i"(offsetof(struct loaded_vmcs, host_state.rsp)),
>  		[wordsize]"i"(sizeof(ulong))
> -	      : "cc", "memory"
> +	      : "memory"
>  	);
>  
>  	if (vmx->msr_autoload.host.nr)
> 
> 

Queued, thanks.

Paolo
diff mbox series

Patch

--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2781,7 +2781,7 @@  static int nested_vmx_check_vmentry_hw(s
 		[launched]"i"(offsetof(struct loaded_vmcs, launched)),
 		[host_state_rsp]"i"(offsetof(struct loaded_vmcs, host_state.rsp)),
 		[wordsize]"i"(sizeof(ulong))
-	      : "cc", "memory"
+	      : "memory"
 	);
 
 	if (vmx->msr_autoload.host.nr)