Message ID | 1488995215-7647-5-git-send-email-ross.lagerwall@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 08.03.17 at 18:46, <ross.lagerwall@citrix.com> wrote: When seeing the title I wondered by I didn't get Cc-ed. Perhaps the prefix would better have been VT-d: ? > --- a/xen/drivers/passthrough/vtd/dmar.h > +++ b/xen/drivers/passthrough/vtd/dmar.h > @@ -108,6 +108,19 @@ struct acpi_atsr_unit > *acpi_find_matched_atsr_unit(const struct pci_dev *); > > #define DMAR_OPERATION_TIMEOUT MILLISECS(1000) > > +#if defined(NDEBUG) && defined(CONFIG_LIVEPATCH) > +#define iommu_wait_op_panic() \ > + do { \ > + panic("%pS: DMAR hardware is malfunctional", current_text_addr()); \ > + } while (0) > +#else > +#define iommu_wait_op_panic() \ > + do { \ > + panic("%s:%d:%s: DMAR hardware is malfunctional", \ > + __FILE__, __LINE__, __func__); \ If you touch this already, may I suggest eliminating the redundancy here: Either file or function name should suffice to uniquely identify the origin. Jan
> From: Ross Lagerwall [mailto:ross.lagerwall@citrix.com] > Sent: Thursday, March 9, 2017 1:47 AM > > When using LivePatch, use of __LINE__ can generate spurious changes in > functions due to embedded line numbers. For release builds with LivePatch > enabled, remove the use of these line numbers in > IOMMU_WAIT_OP() and print the current text address instead. > > Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> with title fixed per Jan's suggestion: Acked-by: Kevin Tian <kevin.tian@intel.com>
diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h index 729b603..c3d4adc 100644 --- a/xen/drivers/passthrough/vtd/dmar.h +++ b/xen/drivers/passthrough/vtd/dmar.h @@ -108,6 +108,19 @@ struct acpi_atsr_unit *acpi_find_matched_atsr_unit(const struct pci_dev *); #define DMAR_OPERATION_TIMEOUT MILLISECS(1000) +#if defined(NDEBUG) && defined(CONFIG_LIVEPATCH) +#define iommu_wait_op_panic() \ + do { \ + panic("%pS: DMAR hardware is malfunctional", current_text_addr()); \ + } while (0) +#else +#define iommu_wait_op_panic() \ + do { \ + panic("%s:%d:%s: DMAR hardware is malfunctional", \ + __FILE__, __LINE__, __func__); \ + } while (0) +#endif + #define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ do { \ s_time_t start_time = NOW(); \ @@ -117,8 +130,7 @@ do { \ break; \ if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) { \ if ( !kexecing ) \ - panic("%s:%d:%s: DMAR hardware is malfunctional",\ - __FILE__, __LINE__, __func__); \ + iommu_wait_op_panic(); \ else \ break; \ } \
When using LivePatch, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds with LivePatch enabled, remove the use of these line numbers in IOMMU_WAIT_OP() and print the current text address instead. Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com> --- Changes in v2: * Simplified macros. * Use %pS. xen/drivers/passthrough/vtd/dmar.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)