From: "Jan Beulich" Subject: Re: [PATCH 1/2] iommu/amd: Fix logic for clearing the IOMMU interrupt bits Date: Fri, 19 Apr 2013 08:37:41 +0100 Message-ID: <5171106502000078000CED55@nat28.tlf.novell.com> References: <1366310471-2569-1-git-send-email-suravee.suthikulpanit@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366310471-2569-1-git-send-email-suravee.suthikulpanit@amd.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: suravee.suthikulpanit@amd.com Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 18.04.13 at 20:41, 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