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

RE: [PATCH v2 1/3] VMX: sync VM-exit perf counters with known VM-exit reasons


  • To: "Beulich, Jan" <JBeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
  • Date: Sun, 30 Jan 2022 03:08:59 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5IkzbfmcN2+CErwxVase6v7i7D+DE2BdKqUL5KDlsc8=; b=Y9ltvMNjFq89MFkme73QkPe9/z78NDtjwJpYrxUZbOfdnFQcvkHVH9P3hnvt5X+4wUI2hzid8yDW16bqTewgVzsE3lxnE/K4nGKR2PC3TsNHtT7KRCxuh4RKuBTS1tJJvLY/omeLqlBIo1JLt3Z4kU5AziZ/adi6rS6HjMQxyWMseEoFvKD5+gv1b4BBxBUFf33DeiXZnyFdDt2CF4f2PqPL96F/J07YHUgCL2KTpZ83RYBlm0UIDbJas7HRFcSE1tStlKBWz/Cd7WyKofiPqeQVVCPdtYpWGNKWLoEcU4WiB76heG3XhwY43fRXm8dphTw7VDYXn1BrIPba/u49SA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j89iHZ78YLsXtqG5hAhl/KiDoJ7ls6sXCq8rwrFqED9Tb5FC0NO3Ll1/8y4C3G6lnoY+YAIEMaG1fm6NyUOPsg2YGmVd6e14+lUmcB1KDPbVa4JRWgaKeRmnJDeXWE7PcmrgUZDqkELGnqKgVubdfINI7NGt1sO3JtlCH9Vd80BIOTbk/+ift9t1s+gNE+JhbhNIz6yF7irh5BPDIEFk4fAw66Ud4B1JMypfkBUyjUIRu5HE1HlO1sFYl+rGkX0cMA94qTNvLX6FtEWEpCTdViEdCBwm8DB3B0e5lDX/A0KCV/CpXgWKgUM8VB5JtaKEqgnkzw39m0lRag9qCbWSDQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com;
  • Cc: "Cooper, Andrew" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Pau Monné, Roger <roger.pau@xxxxxxxxxx>, "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>
  • Delivery-date: Sun, 30 Jan 2022 03:09:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYAj+mrfy4jhb6gEO6nCskr+JyMax7CMyw
  • Thread-topic: [PATCH v2 1/3] VMX: sync VM-exit perf counters with known VM-exit reasons

> From: Beulich
> Sent: Wednesday, January 5, 2022 9:58 PM
> 
> This has gone out of sync over time. Introduce a simplistic mechanism to
> hopefully keep things in sync going forward.
> 
> Also limit the array index to just the "basic exit reason" part, which is
> what the pseudo-enumeration covers.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>

> ---
> v2: Use sentinel comment only.
> 
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -3869,7 +3869,7 @@ void vmx_vmexit_handler(struct cpu_user_
>      else
>          HVMTRACE_ND(VMEXIT, 0, 1/*cycles*/, exit_reason, regs->eip);
> 
> -    perfc_incra(vmexits, exit_reason);
> +    perfc_incra(vmexits, (uint16_t)exit_reason);
> 
>      /* Handle the interrupt we missed before allowing any more in. */
>      switch ( (uint16_t)exit_reason )
> --- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
> @@ -219,6 +219,7 @@ static inline void pi_clear_sn(struct pi
>  #define EXIT_REASON_PML_FULL            62
>  #define EXIT_REASON_XSAVES              63
>  #define EXIT_REASON_XRSTORS             64
> +/* Remember to also update VMX_PERF_EXIT_REASON_SIZE! */
> 
>  /*
>   * Interruption-information format
> --- a/xen/arch/x86/include/asm/perfc_defn.h
> +++ b/xen/arch/x86/include/asm/perfc_defn.h
> @@ -6,7 +6,7 @@ PERFCOUNTER_ARRAY(exceptions,
> 
>  #ifdef CONFIG_HVM
> 
> -#define VMX_PERF_EXIT_REASON_SIZE 56
> +#define VMX_PERF_EXIT_REASON_SIZE 65
>  #define VMX_PERF_VECTOR_SIZE 0x20
>  PERFCOUNTER_ARRAY(vmexits,              "vmexits",
> VMX_PERF_EXIT_REASON_SIZE)
>  PERFCOUNTER_ARRAY(cause_vector,         "cause vector",
> VMX_PERF_VECTOR_SIZE)
> 


 


Rackspace

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