From: Ian Campbell Subject: Re: [PATCH] VTD: Remove the check for reserved device scope type Date: Tue, 16 Apr 2013 09:06:35 +0100 Message-ID: <1366099595.8399.93.camel@zakaz.uk.xensource.com> References: <1366093131-30609-1-git-send-email-yang.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1366093131-30609-1-git-send-email-yang.z.zhang@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Yang Zhang Cc: "keir.xen@gmail.com" , "JBeulich@suse.com" , Xiantao Zhang , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-04-16 at 07:18 +0100, Yang Zhang wrote: > From: Yang Zhang > > Though we only have four valid types now, the new type may be added in future. > It's better to remove the check and only deal with the type that we can > recognize. > > Signed-off-by: Yang Zhang > Signed-off-by: Xiantao Zhang > --- > xen/drivers/passthrough/vtd/dmar.c | 7 +++++-- > xen/include/acpi/actbl2.h | 1 - > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c > index 370d5d6..eda04a3 100644 > --- a/xen/drivers/passthrough/vtd/dmar.c > +++ b/xen/drivers/passthrough/vtd/dmar.c > @@ -283,8 +283,7 @@ static int __init scope_device_count(const void *start, const void *end) > while ( start < end ) > { > scope = start; > - if ( (scope->length < MIN_SCOPE_LEN) || > - (scope->entry_type >= ACPI_DMAR_SCOPE_TYPE_RESERVED) ) > + if ( scope->length < MIN_SCOPE_LEN ) > { > dprintk(XENLOG_WARNING VTDPREFIX, "Invalid device scope.\n"); > return -EINVAL; > @@ -409,6 +408,10 @@ static int __init acpi_parse_dev_scope( > } > > break; > + > + default: Worth a log message? At least if iommu_verbose? > + start += acpi_scope->length; > + continue; > } > scope->devices[didx++] = PCI_BDF(bus, path->dev, path->fn); > start += acpi_scope->length; > diff --git a/xen/include/acpi/actbl2.h b/xen/include/acpi/actbl2.h > index a28226a..87bc6b3 100644 > --- a/xen/include/acpi/actbl2.h > +++ b/xen/include/acpi/actbl2.h > @@ -303,7 +303,6 @@ enum acpi_dmar_scope_type { > ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, > ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, > ACPI_DMAR_SCOPE_TYPE_HPET = 4, > - ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */ > }; > > struct acpi_dmar_pci_path {