qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v6 09/18] intel_iommu: vtd_slpt_level_shift chec


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH v6 09/18] intel_iommu: vtd_slpt_level_shift check level
Date: Tue, 7 Feb 2017 13:42:55 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0



On 2017年02月03日 16:22, Peter Xu wrote:
This helps in debugging incorrect level passed in.

Signed-off-by: Peter Xu <address@hidden>
---
  hw/i386/intel_iommu.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c672621..d74aa27 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -168,6 +168,7 @@ static gboolean vtd_hash_remove_by_domain(gpointer key, 
gpointer value,
  /* The shift of an addr for a certain level of paging structure */
  static inline uint32_t vtd_slpt_level_shift(uint32_t level)
  {
+    assert(level != 0);
      return VTD_PAGE_SHIFT_4K + (level - 1) * VTD_SL_LEVEL_BITS;
  }

No harm but not sure we really need this.

Reviewed-by: Jason Wang <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]