On Wed, Jan 05, 2022 at 02:59:03PM +0100, Jan Beulich wrote:
> Only one of them can be in use at a time, so make the whole set union-
> like. While doing the rename in SVM code, combine the two perf_incra(),
> generalizing the range upwards of VMEXIT_NPF.
> 
> Signed-off-by: Jan Beulich <jbeul...@suse.com>

Reviewed-by: Roger Pau Monné <roger....@citrix.com>

> ---
> v2: New.
> 
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2644,7 +2644,10 @@ void svm_vmexit_handler(struct cpu_user_
>          goto out;
>      }
>  
> -    perfc_incra(svmexits, exit_reason);
> +    perfc_incra(vmexits,
> +                exit_reason < VMEXIT_NPF
> +                ? exit_reason
> +                : exit_reason - VMEXIT_NPF + VMEXIT_NPF_PERFC);

Should we assert that the index used here < SVM_PERF_EXIT_REASON_SIZE?

Just so that adding new exit reasons without increasing
SVM_PERF_EXIT_REASON_SIZE is not likely to go unnoticed?

Thanks, Roger.

Reply via email to