From patchwork Tue Feb 19 06:10:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10819263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E214D139A for ; Tue, 19 Feb 2019 06:13:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF0942B88C for ; Tue, 19 Feb 2019 06:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C105A2B949; Tue, 19 Feb 2019 06:13:38 +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=-2.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DF7B2B88C for ; Tue, 19 Feb 2019 06:13:38 +0000 (UTC) Received: from localhost ([127.0.0.1]:42322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvyev-0005JV-Hv for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 01:13:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvydZ-0005Hs-30 for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvydY-00074Y-8d for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:13 -0500 Received: from mail-lf1-x141.google.com ([2a00:1450:4864:20::141]:35131) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvydX-00074B-Se for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:12 -0500 Received: by mail-lf1-x141.google.com with SMTP id v7so14039250lfd.2 for ; Mon, 18 Feb 2019 22:12:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iX+zRBVWvdB2WXpVmwdlzBdzxk88buVvlx+4rwcgayQ=; b=l7Yff6o01ELIjjppHr7+jfoYefDJ9vS/UUsCEIfgcQLOmEL+4KrJ60mx9tcJswyZCn TrHWrYEV276DCvQ2Tf0HLCD6qAUm2pwLCug9iCohFB53fNXGAolnA9rZod5PkdxnHO3c D84rRbjOyyppO287xKJXo0D1/JpUpSVsI2GMIRfyKUOpa4SQ2bUElq0XfIqMpLmU/4Ry zYY0d8TX6jZsiwPHWu5siq4MG9FaoLWb7RenVf6jKg/hUTQuPF5RQ9Mh0opFFcTO7l02 H1l4Gg+1A/IT7ePrH2Ctd9XpoXTbvzInMCKqL6YPrQt+H+FtQd68Ilb4CwtvMEiF9lff Omtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iX+zRBVWvdB2WXpVmwdlzBdzxk88buVvlx+4rwcgayQ=; b=XR5x//czhdl07Qf4kEI+peRmQXgH/ID/+MlseLPN+sB1wod0aP221fK8MyZK40PFi7 yUkhS8ub6jPsJkHk0WV9ch0osS4unFoxVtuH4WtNAwlElaJo6ysuMFgOwJxNGz8v3RF9 a4i2FLJnrQ6Wl3N7DjWo0sZIG2V7EXl0+jFF7cb7380yqWPQMmje7mgaR/hH5mStxYnu 9OKv+kChgenqVVfNbPyMlTFCYin707kvg6pCZmnJ2kMkQoZsregipzeAt/d1WMFQjSxV rjIS6kEwfvyv6HUwIkSvzTSNUfTJR3GLW08SjORmP7r2ZnUYba+wZfVeqaxQLtzNRpWF Vf3A== X-Gm-Message-State: AHQUAuY+31UPG/pIIYEKYpDsHbm+gaccpROUPjB30LiPTdOFRiSdnX98 Z/vJDQO7m0GU8S3NOQfd8Lf2ARknuZM= X-Google-Smtp-Source: AHgI3Ibyn1IGBC0Kth9T8H3O3py3H1Wz2B22aWajayYdTDD06RTtiDt23VXjek0W7z8G657qsAyHLw== X-Received: by 2002:ac2:4191:: with SMTP id z17mr15666284lfh.117.1550556730379; Mon, 18 Feb 2019 22:12:10 -0800 (PST) Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id f16-v6sm4235745lji.88.2019.02.18.22.12.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 22:12:09 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 22:10:56 -0800 Message-Id: <20190219061111.10231-9-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190219061111.10231-1-jcmvbkbc@gmail.com> References: <20190219061111.10231-1-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::141 Subject: [Qemu-devel] [PATCH 08/23] tests/tcg/xtensa: conditionalize debug option tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Make debug tests conditional on the presence of the debug option in the config and tests that depend on the presence/number of instruction or data breakpoint registers on the corresponding definitions. Use configured debug interrupt level instead of the hardcoded value to set up IRQ handler and access debug EPC register. Signed-off-by: Max Filippov --- tests/tcg/xtensa/macros.inc | 3 +++ tests/tcg/xtensa/test_break.S | 27 ++++++++++++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/tests/tcg/xtensa/macros.inc b/tests/tcg/xtensa/macros.inc index 93825dc7b513..5265c8606bff 100644 --- a/tests/tcg/xtensa/macros.inc +++ b/tests/tcg/xtensa/macros.inc @@ -97,3 +97,6 @@ test_\name: movi a3, \addr s32i a3, a2, 0 .endm + +#define glue(a, b) _glue(a, b) +#define _glue(a, b) a ## b diff --git a/tests/tcg/xtensa/test_break.S b/tests/tcg/xtensa/test_break.S index 775cd7c26063..3379a3f9f06e 100644 --- a/tests/tcg/xtensa/test_break.S +++ b/tests/tcg/xtensa/test_break.S @@ -1,10 +1,13 @@ #include "macros.inc" -#define debug_level 6 -#define debug_vector level6 - test_suite break +#if XCHAL_HAVE_DEBUG + +#define debug_level XCHAL_DEBUGLEVEL +#define debug_vector glue(level, XCHAL_DEBUGLEVEL) +#define EPC_DEBUG glue(epc, XCHAL_DEBUGLEVEL) + test break set_vector debug_vector, 0 rsil a2, debug_level @@ -21,7 +24,7 @@ test break and a2, a2, a3 movi a3, 0x10 | debug_level assert eq, a2, a3 - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 1b assert eq, a2, a3 rsr a2, debugcause @@ -45,7 +48,7 @@ test breakn and a2, a2, a3 movi a3, 0x10 | debug_level assert eq, a2, a3 - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 1b assert eq, a2, a3 rsr a2, debugcause @@ -53,6 +56,7 @@ test breakn assert eq, a2, a3 test_end +#if XCHAL_NUM_IBREAK test ibreak set_vector debug_vector, 0 rsil a2, debug_level @@ -83,7 +87,7 @@ test ibreak and a2, a2, a3 movi a3, 0x10 | debug_level assert eq, a2, a3 - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 1b assert eq, a2, a3 rsr a2, debugcause @@ -110,7 +114,7 @@ test ibreak_remove and a2, a2, a3 movi a3, 0x10 | debug_level assert eq, a2, a3 - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 2b assert eq, a2, a3 rsr a2, debugcause @@ -141,6 +145,7 @@ test ibreak_priority movi a3, 0x2 assert eq, a2, a3 test_end +#endif test icount set_vector debug_vector, 2f @@ -158,7 +163,7 @@ test icount 2: movi a2, 0 wsr a2, icountlevel - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 1b assert eq, a2, a3 rsr a2, debugcause @@ -167,7 +172,7 @@ test icount test_end .macro check_dbreak dr - rsr a2, epc6 + rsr a2, EPC_DEBUG movi a3, 1b assert eq, a2, a3 rsr a2, debugcause @@ -194,6 +199,7 @@ test_end reset_ps .endm +#if XCHAL_NUM_DBREAK test dbreak_exact dbreak_test 0, 0x4000003f, 0xd000007f, 0xd000007f, l8ui dbreak_test 1, 0x4000003e, 0xd000007e, 0xd000007e, l16ui @@ -253,5 +259,8 @@ test dbreak_invalid dbreak_test 0, 0x40000030, 0xd0000071, 0xd0000070, l16ui dbreak_test 1, 0x40000035, 0xd0000072, 0xd0000070, l32i test_end +#endif + +#endif test_suite_end