diff mbox series

vmx: Don't open-code vmresume/vmlaunch instructions

Message ID 2d9480b75c80d49952812769f283a220c1753571.1744899753.git.teddy.astie@vates.tech (mailing list archive)
State New
Headers show
Series vmx: Don't open-code vmresume/vmlaunch instructions | expand

Commit Message

Teddy Astie April 17, 2025, 2:24 p.m. UTC
binutils 2.25 has support for assembling vmresume/vmlaunch
instructions, so we don't need to open-code the byte sequences
for these opcodes anymore.

Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/hvm/vmx/entry.S | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Teddy Astie April 17, 2025, 2:26 p.m. UTC | #1
Le 17/04/2025 à 16:24, Teddy Astie a écrit :
> binutils 2.25 has support for assembling vmresume/vmlaunch
> instructions, so we don't need to open-code the byte sequences
> for these opcodes anymore.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> ---
>   xen/arch/x86/hvm/vmx/entry.S | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
> index 6aaeb28a5b..2bfee715b3 100644
> --- a/xen/arch/x86/hvm/vmx/entry.S
> +++ b/xen/arch/x86/hvm/vmx/entry.S
> @@ -21,9 +21,6 @@
>   #include <asm/asm_defns.h>
>   #include <asm/page.h>
>   
> -#define VMRESUME     .byte 0x0f,0x01,0xc3
> -#define VMLAUNCH     .byte 0x0f,0x01,0xc2
> -
>   FUNC(vmx_asm_vmexit_handler)
>           SAVE_ALL
>   
> @@ -166,11 +163,11 @@ UNLIKELY_END(realmode)
>           jns  .Lvmx_launch
>   
>   /*.Lvmx_resume:*/
> -        VMRESUME
> +        vmresume
>           jmp  .Lvmx_vmentry_fail
>   
>   .Lvmx_launch:
> -        VMLAUNCH
> +        vmlaunch
>   
>   .Lvmx_vmentry_fail:
>           sti

Not a security issue, I sent by mistake to the wrong mailing list.


Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Jan Beulich April 17, 2025, 2:28 p.m. UTC | #2
On 17.04.2025 16:24, Teddy Astie wrote:
> binutils 2.25 has support for assembling vmresume/vmlaunch
> instructions, so we don't need to open-code the byte sequences
> for these opcodes anymore.
> 
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Acked-by: Jan Beulich <jbeulich@suse.com>
Andrew Cooper April 17, 2025, 2:29 p.m. UTC | #3
On 17/04/2025 3:24 pm, Teddy Astie wrote:
> binutils 2.25 has support for assembling vmresume/vmlaunch
> instructions, so we don't need to open-code the byte sequences
> for these opcodes anymore.
>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/hvm/vmx/entry.S b/xen/arch/x86/hvm/vmx/entry.S
index 6aaeb28a5b..2bfee715b3 100644
--- a/xen/arch/x86/hvm/vmx/entry.S
+++ b/xen/arch/x86/hvm/vmx/entry.S
@@ -21,9 +21,6 @@ 
 #include <asm/asm_defns.h>
 #include <asm/page.h>
 
-#define VMRESUME     .byte 0x0f,0x01,0xc3
-#define VMLAUNCH     .byte 0x0f,0x01,0xc2
-
 FUNC(vmx_asm_vmexit_handler)
         SAVE_ALL
 
@@ -166,11 +163,11 @@  UNLIKELY_END(realmode)
         jns  .Lvmx_launch
 
 /*.Lvmx_resume:*/
-        VMRESUME
+        vmresume
         jmp  .Lvmx_vmentry_fail
 
 .Lvmx_launch:
-        VMLAUNCH
+        vmlaunch
 
 .Lvmx_vmentry_fail:
         sti