Looks good. 
Reviewed-by: Babu Moger <babu.mo...@amd.com>

> -----Original Message-----
> From: Woods, Brian
> Sent: Tuesday, February 20, 2018 6:13 PM
> To: xen-de...@lists.xen.org
> Cc: Boris Ostrovsky <boris.ostrov...@oracle.com>; Suthikulpanit, Suravee
> <suravee.suthikulpa...@amd.com>; Jan Beulich <jbeul...@suse.com>;
> Andrew Cooper <andrew.coop...@citrix.com>; Woods, Brian
> <brian.wo...@amd.com>
> Subject: [PATCH 2/2] x86/svm: enable pause filtering threshold
> 
> If available, enable the pause filtering threshold feature.  See the
> previous commit for more information.
> 
> Signed-off-by: Brian Woods <brian.wo...@amd.com>
> ---
>  xen/arch/x86/hvm/svm/svm.c  | 1 +
>  xen/arch/x86/hvm/svm/vmcb.c | 3 +++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
> index 9f58afc2d8..b6b92365bf 100644
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -1694,6 +1694,7 @@ const struct hvm_function_table * __init
> start_svm(void)
>      P(cpu_has_svm_vloadsave, "Virtual VMLOAD/VMSAVE");
>      P(cpu_has_svm_vgif, "Virtual GIF");
>      P(cpu_has_pause_filter, "Pause-Intercept Filter");
> +    P(cpu_has_pause_thresh, "Pause-Intercept Filter Threshold");
>      P(cpu_has_tsc_ratio, "TSC Rate MSR");
>  #undef P
> 
> diff --git a/xen/arch/x86/hvm/svm/vmcb.c
> b/xen/arch/x86/hvm/svm/vmcb.c
> index 0e6cba5b7b..ebe6f0c751 100644
> --- a/xen/arch/x86/hvm/svm/vmcb.c
> +++ b/xen/arch/x86/hvm/svm/vmcb.c
> @@ -227,6 +227,9 @@ static int construct_vmcb(struct vcpu *v)
>      {
>          vmcb->_pause_filter_count = SVM_PAUSEFILTER_INIT;
>          vmcb->_general1_intercepts |= GENERAL1_INTERCEPT_PAUSE;
> +
> +        if ( cpu_has_pause_thresh )
> +            vmcb->_pause_filter_thresh = SVM_PAUSETHRESH_INIT;
>      }
> 
>      vmcb->cleanbits.bytes = 0;
> --
> 2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to