From patchwork Fri Nov 7 20:40:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 408254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 59F951400A8 for ; Sat, 8 Nov 2014 07:43:11 +1100 (AEDT) Received: from localhost ([::1]:33852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmqNB-00026b-A9 for incoming@patchwork.ozlabs.org; Fri, 07 Nov 2014 15:43:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmqLK-00085q-1t for qemu-devel@nongnu.org; Fri, 07 Nov 2014 15:41:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmqLA-0002UZ-VL for qemu-devel@nongnu.org; Fri, 07 Nov 2014 15:41:13 -0500 Received: from mail-lb0-x22c.google.com ([2a00:1450:4010:c04::22c]:43745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmqLA-0002TX-Mi for qemu-devel@nongnu.org; Fri, 07 Nov 2014 15:41:04 -0500 Received: by mail-lb0-f172.google.com with SMTP id w7so3298201lbi.31 for ; Fri, 07 Nov 2014 12:41:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5Sq36l6h1BleGbMXxa/HPvb8WXAInncfWp7mDIFED+I=; b=IdW38SLgP7SvJPE/k7HdSkOmn/bO9newa5AAQRnRNafLYJj3AqlDGFwZOGGx7eHaJR ueK+DcGihH+XDcZPZb1Z3CF0SMrvjNfimNuHw/qLfL2v47PJhBzMG9DPDfVXQyFeBE3+ pJJCwuLDmRsjtciHR+s8svppuAN+dQzhpT5qfebF0ZyViAG56LrYQNkNQMK7+2SPXjOC lf66KufDkYo2pJ4iS4kdtm6GTcbOEJU3zzkp148azoLqJ6VKwk6MvfUPlj734PYemxIu ToiP9ayOn3zo1CsmIYp9dvBik8ry2+uABX0PawXlgyWM15IPxz/GNgyjBurhAPmeC/VG cY1Q== X-Received: by 10.112.11.133 with SMTP id q5mr5506215lbb.77.1415392863905; Fri, 07 Nov 2014 12:41:03 -0800 (PST) Received: from octofox.metropolis ([5.19.183.212]) by mx.google.com with ESMTPSA id js14sm3438599lab.23.2014.11.07.12.41.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Nov 2014 12:41:03 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Fri, 7 Nov 2014 23:40:48 +0300 Message-Id: <1415392848-19134-3-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1415392848-19134-1-git-send-email-jcmvbkbc@gmail.com> References: <1415392848-19134-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::22c Cc: Max Filippov Subject: [Qemu-devel] [PATCH 2.2 2/2] target-xtensa: add entry overflow test X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Check that entry instruction raises window overflow exception when PS.CALLINC points to live registers. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_windowed.S | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/tcg/xtensa/test_windowed.S b/tests/tcg/xtensa/test_windowed.S index 3de6d37..d851e8f 100644 --- a/tests/tcg/xtensa/test_windowed.S +++ b/tests/tcg/xtensa/test_windowed.S @@ -299,4 +299,55 @@ test entry entry_test 12 test_end +.macro entry_overflow_test window, free, next_window + set_vector window_overflow_4, 0 + set_vector window_overflow_8, 0 + set_vector window_overflow_12, 0 + set_vector window_overflow_\next_window, 10f + + movi a2, \window + movi a2, \free + movi a2, \next_window + reset_window %(1 | ((1 | (1 << ((\next_window) / 4))) << ((\free) / 4))) + reset_ps + movi a2, 0x4000f | ((\window) << 14) + wsr a2, ps + isync + movi a3, 0x12345678 + j 1f + .align 4 +1: + entry a3, 0x5678 + test_fail + .align 4 +10: + rsr a2, epc1 + movi a3, 1b + assert eq, a2, a3 + movi a2, 2f + wsr a2, epc1 + + rsr a2, windowbase + movi a3, (\free) / 4 + assert eq, a2, a3 + rfwo +2: +.endm + +.macro all_entry_overflow_tests + .irp window, 4, 8, 12 + .irp next_window, 4, 8, 12 + .irp free, 4, 8, 12 + .if \free <= \window + entry_overflow_test \window, \free, \next_window + .endif + .endr + .endr + .endr +.endm + +test entry_overflow + all_entry_overflow_tests +test_end + test_suite_end