On Wed, Aug 12, 2015 at 10:35:27AM +0800, Feng Wu wrote:
> This patch adds some helper functions to manipulate the
> Posted-Interrupts Descriptor.
> 
> CC: Kevin Tian <kevin.t...@intel.com>
> CC: Keir Fraser <k...@xen.org>
> CC: Jan Beulich <jbeul...@suse.com>
> CC: Andrew Cooper <andrew.coop...@citrix.com>
> Signed-off-by: Feng Wu <feng...@intel.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
> ---
> v4:
> - Newly added
> 
>  xen/include/asm-x86/hvm/vmx/vmx.h | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h 
> b/xen/include/asm-x86/hvm/vmx/vmx.h
> index 3fbfa44..acd4aec 100644
> --- a/xen/include/asm-x86/hvm/vmx/vmx.h
> +++ b/xen/include/asm-x86/hvm/vmx/vmx.h
> @@ -101,6 +101,7 @@ void vmx_update_cpu_exec_control(struct vcpu *v);
>  void vmx_update_secondary_exec_control(struct vcpu *v);
>  
>  #define POSTED_INTR_ON  0
> +#define POSTED_INTR_SN  1
>  static inline int pi_test_and_set_pir(int vector, struct pi_desc *pi_desc)
>  {
>      return test_and_set_bit(vector, pi_desc->pir);
> @@ -121,11 +122,31 @@ static inline int pi_test_and_clear_on(struct pi_desc 
> *pi_desc)
>      return test_and_clear_bit(POSTED_INTR_ON, &pi_desc->control);
>  }
>  
> +static inline int pi_test_on(struct pi_desc *pi_desc)
> +{
> +    return test_bit(POSTED_INTR_ON, &pi_desc->control);
> +}
> +
>  static inline unsigned long pi_get_pir(struct pi_desc *pi_desc, int group)
>  {
>      return xchg(&pi_desc->pir[group], 0);
>  }
>  
> +static inline int pi_test_sn(struct pi_desc *pi_desc)
> +{
> +    return test_bit(POSTED_INTR_SN, &pi_desc->control);
> +}
> +
> +static inline void pi_set_sn(struct pi_desc *pi_desc)
> +{
> +    set_bit(POSTED_INTR_SN, &pi_desc->control);
> +}
> +
> +static inline void pi_clear_sn(struct pi_desc *pi_desc)
> +{
> +    clear_bit(POSTED_INTR_SN, &pi_desc->control);
> +}
> +
>  /*
>   * Exit Reasons
>   */
> -- 
> 2.1.0
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

Reply via email to