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

Re: [Xen-devel] [PATCH 1/2] iommu/amd: Fix logic for clearing the IOMMU interrupt bits



>>> On 18.04.13 at 20:41, <suravee.suthikulpanit@xxxxxxx> wrote:
> --- a/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
> +++ b/xen/include/asm-x86/hvm/svm/amd-iommu-defs.h
> @@ -385,19 +385,22 @@
>  
>  /* Status Register*/
>  #define IOMMU_STATUS_MMIO_OFFSET             0x2020
> -#define IOMMU_STATUS_EVENT_OVERFLOW_MASK     0x00000001
>  #define IOMMU_STATUS_EVENT_OVERFLOW_SHIFT    0
> -#define IOMMU_STATUS_EVENT_LOG_INT_MASK              0x00000002
> +#define IOMMU_STATUS_EVENT_OVERFLOW_MASK     (1 << 
> IOMMU_STATUS_EVENT_OVERFLOW_SHIFT)
>  #define IOMMU_STATUS_EVENT_LOG_INT_SHIFT     1
> -#define IOMMU_STATUS_COMP_WAIT_INT_MASK              0x00000004
> +#define IOMMU_STATUS_EVENT_LOG_INT_MASK              (1 << 
> IOMMU_STATUS_EVENT_LOG_INT_SHIFT)
>  #define IOMMU_STATUS_COMP_WAIT_INT_SHIFT     2
> -#define IOMMU_STATUS_EVENT_LOG_RUN_MASK              0x00000008
> +#define IOMMU_STATUS_COMP_WAIT_INT_MASK              (1 << 
> IOMMU_STATUS_COMP_WAIT_INT_SHIFT)
>  #define IOMMU_STATUS_EVENT_LOG_RUN_SHIFT     3
> -#define IOMMU_STATUS_CMD_BUFFER_RUN_MASK     0x00000010
> +#define IOMMU_STATUS_EVENT_LOG_RUN_MASK              (1 << 
> IOMMU_STATUS_EVENT_LOG_RUN_SHIFT)
>  #define IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT    4
> +#define IOMMU_STATUS_CMD_BUFFER_RUN_MASK     (1 << 
> IOMMU_STATUS_CMD_BUFFER_RUN_SHIFT)
>  #define IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT     5
> +#define IOMMU_STATUS_PPR_LOG_OVERFLOW_MASK   (1 << 
> IOMMU_STATUS_PPR_LOG_OVERFLOW_SHIFT)
>  #define IOMMU_STATUS_PPR_LOG_INT_SHIFT          6
> +#define IOMMU_STATUS_PPR_LOG_INT_MASK           (1 << 
> IOMMU_STATUS_PPR_LOG_INT_SHIFT)
>  #define IOMMU_STATUS_PPR_LOG_RUN_SHIFT          7
> +#define IOMMU_STATUS_PPR_LOG_RUN_MASK                (1 << 
> IOMMU_STATUS_PPR_LOG_RUN_SHIFT)

I'll take this as is, but mid term (post-4.3) most if not all of these
_SHIFT/_MASK pairs should be reduced to just one of them,
generally the _MASK one (as the shift value can be easily
reconstructed from the mask even when the mask is multiple bits
wide).

Jan


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


 


Rackspace

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