From patchwork Fri May 6 15:48:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Lagerwall X-Patchwork-Id: 9034241 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 551B7BF29F for ; Fri, 6 May 2016 15:55:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F6D2203A0 for ; Fri, 6 May 2016 15:55:35 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id ACF4420394 for ; Fri, 6 May 2016 15:55:34 +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 1ayi4P-0002dV-Nd; Fri, 06 May 2016 15:53:37 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayi4O-0002dA-EU for xen-devel@lists.xen.org; Fri, 06 May 2016 15:53:36 +0000 Received: from [85.158.137.68] by server-10.bemta-3.messagelabs.com id D1/6B-03002-FFDBC275; Fri, 06 May 2016 15:53:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIIsWRWlGSWpSXmKPExsXitHRDpO7/vTr hBm/Xclgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlzzvxgK9jJUXFpz2HGBsYZ7F2MnBwSAv4S K14tZgax2QQMJG5d+g5miwjISqzumgNUw8XBLPCeSeLPzttgDcICIRJ/Xj5kAbFZBFQk7jx4A 2bzCnhKHP25FmqonMS59V/A4pwCXhLNf1+DDRUCqlkyZSuUrSbxdvkZqF5BiZMzn4DZzAISEg dfvGCGmMMtcfv0VOYJjHyzkJTNQlK2gJFpFaN6cWpRWWqRroVeUlFmekZJbmJmjq6hgbFebmp xcWJ6ak5iUrFecn7uJkZgUDEAwQ7GC+3OhxglOZiURHm/F+iEC/El5adUZiQWZ8QXleakFh9i lOHgUJLgjdoDlBMsSk1PrUjLzAGGN0xagoNHSYR3JUiat7ggMbc4Mx0idYpRUUocIiEAksgoz YNrg8XUJUZZKWFeRqBDhHgKUotyM0tQ5V8xinMwKgnzvgCZwpOZVwI3/RXQYiagxe/naoIsLk lESEk1MK52sVuxxDc1f3dDlW5Cl9g34VOva68XnXQJET1+ml2qKPjl1KjKY0Jzc5Y8Unx9c73 d3zpXM5NG7+qPLtv/xz35stU9u8pqYfCio3omeU2PDpzg3MvgK/B7618D7qX/fL+elE1TzIkt 47Sdw2pdLbwy3jE69sKMV7m8fZ+KQh9FG86atX5ZtBJLcUaioRZzUXEiAF2YtDekAgAA X-Env-Sender: prvs=92798eb09=ross.lagerwall@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1462550011!35718337!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36064 invoked from network); 6 May 2016 15:53:34 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 6 May 2016 15:53:34 -0000 X-IronPort-AV: E=Sophos;i="5.24,587,1454976000"; d="scan'208";a="352117116" From: Ross Lagerwall To: Date: Fri, 6 May 2016 16:48:05 +0100 Message-ID: <1462549688-29263-5-git-send-email-ross.lagerwall@citrix.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com> References: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Stefano Stabellini , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Ross Lagerwall , Jan Beulich Subject: [Xen-devel] [PATCH v1 4/7] page-alloc: 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When using xsplice, use of __LINE__ can generate spurious changes in functions due to embedded line numbers. For release builds, remove the use of these line numbers in BOOT_BUG_ON() and print the current text address instead. Signed-off-by: Ross Lagerwall --- xen/common/page_alloc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 98e30e5..8355894 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -206,11 +206,19 @@ struct scrub_region { static struct scrub_region __initdata region[MAX_NUMNODES]; static unsigned long __initdata chunk_size; +#ifdef NDEBUG +static void __init boot_bug(void *addr) +{ + panic("Boot BUG at %p", addr); +} +#define BOOT_BUG_ON(p) if ( p ) boot_bug(current_text_addr()); +#else static void __init boot_bug(int line) { panic("Boot BUG at %s:%d", __FILE__, line); } #define BOOT_BUG_ON(p) if ( p ) boot_bug(__LINE__); +#endif static void __init bootmem_region_add(unsigned long s, unsigned long e) {