From patchwork Wed Mar 8 17:46:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9611739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 10058602B4 for ; Wed, 8 Mar 2017 17:49:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F06CD28618 for ; Wed, 8 Mar 2017 17:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D1A28624; Wed, 8 Mar 2017 17:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D94728618 for ; Wed, 8 Mar 2017 17:49:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clfgM-0004Zo-Ge; Wed, 08 Mar 2017 17:47:26 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clfgL-0004Z4-2L for xen-devel@lists.xen.org; Wed, 08 Mar 2017 17:47:25 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 19/A8-20080-CA340C85; Wed, 08 Mar 2017 17:47:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmkeJIrShJLcpLzFFi42JxWrrBXneN84E Ig2lXRS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1owp56YyF7QLVfxau5G1gXEiVxcjJ4eEgL/E oT/dbCA2m4CBxK1L35lBbBEBdYnTHRdZQWxmgSCJSZ8+MILYwkD1d27dYgKxWQRUJK4umQHWy yvgIbF933omiJlyEjfPdYLN4RTwlFjYOB3I5uAQAqppeWAOEhYSUJN4u/wMC0SroMTJmU9YIF ZJSBx88YJ5AiPvLCSpWUhSCxiZVjGqF6cWlaUW6ZrrJRVlpmeU5CZm5ugaGpjq5aYWFyemp+Y kJhXrJefnbmIEBg4DEOxgPDbZ+RCjJAeTkijvVdUDEUJ8SfkplRmJxRnxRaU5qcWHGGU4OJQk eC2dgHKCRanpqRVpmTnAEIZJS3DwKInwJoOkeYsLEnOLM9MhUqcYFaXEeeNBEgIgiYzSPLg2W NxcYpSVEuZlBDpEiKcgtSg3swRV/hWjOAejkjBvHsgUnsy8Erjpr4AWMwEt1nbdC7K4JBEhJd XAWNgTzaTlveRJTNulL5kz/ghXZNSufbFfRefCM4MrMpM/nXi96ti2XTq6v1/6rtx6Ke4bb9O 3ae/fruZOZKlaaH92RatQY1F07c4nOnOsz6Zvu/K7M/G42dnFF5QtHi99+u2E4lPD71xJzefd 36a/D91QcF5jTl3eJq+IOb5qwc26y5qj3V9OWqzEUpyRaKjFXFScCAAbERdulgIAAA== X-Env-Sender: prvs=233b396aa=ross.lagerwall@citrix.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1488995242!72972379!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13390 invoked from network); 8 Mar 2017 17:47:24 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-13.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 8 Mar 2017 17:47:24 -0000 X-IronPort-AV: E=Sophos;i="5.36,265,1486425600"; d="scan'208";a="421279773" From: Ross Lagerwall To: Xen-devel Date: Wed, 8 Mar 2017 17:46:53 +0000 Message-ID: <1488995215-7647-5-git-send-email-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488995215-7647-1-git-send-email-ross.lagerwall@citrix.com> References: <1488995215-7647-1-git-send-email-ross.lagerwall@citrix.com> MIME-Version: 1.0 Cc: Ross Lagerwall , Kevin Tian Subject: [Xen-devel] [PATCH v2 4/6] iommu: Remove dependency on __LINE__ for release builds X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Kevin Tian --- Changes in v2: * Simplified macros. * Use %pS. xen/drivers/passthrough/vtd/dmar.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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; \ } \