[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/4] x86/pv: Drop {compat_, }create_bounce_frame() and use the C version instead



>>> On 08.05.17 at 17:48, <andrew.cooper3@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/x86_64/compat/entry.S
> +++ b/xen/arch/x86/x86_64/compat/entry.S
> @@ -51,7 +51,7 @@ compat_test_guest_events:
>          movl  VCPU_event_sel(%rbx),%eax
>          movw  %ax,TRAPBOUNCE_cs(%rdx)
>          movb  $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
> -        call  compat_create_bounce_frame
> +        call  pv_create_exception_frame
>          jmp   compat_test_all_events
>  
>          ALIGN
> @@ -95,7 +95,7 @@ compat_process_nmi:
>          /* FALLTHROUGH */
>  compat_process_trap:
>          leaq  VCPU_trap_bounce(%rbx),%rdx
> -        call  compat_create_bounce_frame
> +        call  pv_create_exception_frame
>          jmp   compat_test_all_events

The leaq should go away then too.

> @@ -181,8 +181,7 @@ ENTRY(compat_post_handle_exception)
>          testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
>          jz    compat_test_all_events
>  .Lcompat_bounce_exception:
> -        call  compat_create_bounce_frame
> -        movb  $0,TRAPBOUNCE_flags(%rdx)
> +        call  pv_create_exception_frame
>          jmp   compat_test_all_events

Considering this recurring pattern of call/jmp I wonder whether we
could reduce the branch tracking structure utilization in the CPU a
little by folding these paths.

> --- a/xen/arch/x86/x86_64/entry.S
> +++ b/xen/arch/x86/x86_64/entry.S
> @@ -28,7 +28,7 @@ ENTRY(switch_to_kernel)
>          setc  %cl
>          leal  (,%rcx,TBF_INTERRUPT),%ecx
>          movb  %cl,TRAPBOUNCE_flags(%rdx)
> -        call  create_bounce_frame
> +        call  pv_create_exception_frame
>          andl  $~X86_EFLAGS_DF,UREGS_eflags(%rsp)
>          jmp   test_all_events
>  
> @@ -131,7 +131,7 @@ test_guest_events:
>          movq  VCPU_event_addr(%rbx),%rax
>          movq  %rax,TRAPBOUNCE_eip(%rdx)
>          movb  $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
> -        call  create_bounce_frame
> +        call  pv_create_exception_frame
>          jmp   test_all_events
>  
>          ALIGN
> @@ -175,7 +175,7 @@ process_nmi:
>          /* FALLTHROUGH */
>  process_trap:
>          leaq VCPU_trap_bounce(%rbx),%rdx
> -        call create_bounce_frame
> +        call pv_create_exception_frame
>          jmp  test_all_events

Leftover leaq again.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.