From patchwork Tue Feb 19 06:10:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10819299 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 164491390 for ; Tue, 19 Feb 2019 06:26:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 023872B53A for ; Tue, 19 Feb 2019 06:26:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9D052B550; Tue, 19 Feb 2019 06:26:50 +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 8C0422B53A for ; Tue, 19 Feb 2019 06:26:50 +0000 (UTC) Received: from localhost ([127.0.0.1]:42539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvyrh-0007wu-Qs for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 01:26:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvydf-0005Mw-Gw for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvyda-00075D-9S for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:16 -0500 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:38326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvyda-000754-2J for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:14 -0500 Received: by mail-lf1-x142.google.com with SMTP id n15so14019057lfe.5 for ; Mon, 18 Feb 2019 22:12:13 -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=AY/OW2EUYDYYyhIQlu2HjwWLu+XGnY0rsITs4ntZdy4=; b=NIq83OMh00LVN5GYVWJEHYk5/aaVNHzQkSjAoVT968T9Cruegz+D1ZkdNqIMdJ3TNH wfKqBkkO953M72HtigLQkpyC2ANlOFo7ib52pcJ+jKXEkG0PJHLabziettR1g+vKiKJF 5wLtH8nRO2+B9Rw1f+JrqYfdSi3HZE1rR0YQc8+ERL6WHkUiFIfyzOFNoerayOWnPqfa /GWTZ015Nuo88VaOWfvz/mMgnWceXOIFphjLuoEHE7oIzUvslY4RLPAMQFSVZ0HjLLAm 5NaIK2Ij4EFCs8+9p2onPluse1LvWcVwlkabVJFShq4hWLxpQFMXosznswO/oROiPpft zVDA== 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=AY/OW2EUYDYYyhIQlu2HjwWLu+XGnY0rsITs4ntZdy4=; b=kNX9NvmldDLnK4OFZOw2+a8NO3Hwh082OAesl1B0nMA999Edw7rwT6Glpgvux87iTG 78tANCqQW9HDPBPZzbkb/auO2DA27rNRGK3dBEaDgx1O8NBH6OVqr8E+hKg2AC9+2a7U ra/Xi6bu1uJyBBTBpo4bQnpin6qQ3QiUxup9so2KaqHpsp3Rn0oxmr2ogC3cA+m2bAos D3WtAz80gC7uKyf5rGs68/VjoPRFtzvFrFz++PntF8ZD5JTrUyY5ooULvh45BiF5hD3H Bijd7IB4y0QxXqTeCw0UGaOajhpoU9X6BdNckFWQCgdm033OaWd03bGQZFQSDd3zQV8h Bdvw== X-Gm-Message-State: AHQUAuaMGROWjm+KSA50S5gGh6HnZrIvk9BSQhrHLDQ1l8+U8jWVKDBi rmGuXgzWQ0LaRQvhZnHNncH5KJkC0jw= X-Google-Smtp-Source: AHgI3IaMjAaecMllETBN45JI08nwCPz1atdj9YiKWrXuY7/8O0NVk0QnNrfKKjMga+mRgcCmoOZCeQ== X-Received: by 2002:ac2:5489:: with SMTP id t9mr15519440lfk.49.1550556732415; Mon, 18 Feb 2019 22:12:12 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 22:12:11 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 22:10:57 -0800 Message-Id: <20190219061111.10231-10-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::142 Subject: [Qemu-devel] [PATCH 09/23] tests/tcg/xtensa: conditionalize cache 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 data/instruction tests conditional on the presence of data/instruction cache, whether they're lockable and whether data cache is writeback. Signed-off-by: Max Filippov --- tests/tcg/xtensa/test_cache.S | 62 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/tests/tcg/xtensa/test_cache.S b/tests/tcg/xtensa/test_cache.S index 6b2df9734b2e..7e6ba4c18a2b 100644 --- a/tests/tcg/xtensa/test_cache.S +++ b/tests/tcg/xtensa/test_cache.S @@ -7,6 +7,8 @@ test_suite cache +#if XCHAL_HAVE_PTP_MMU + .macro pf_op op \op a2, 0 \op a3, 0 @@ -18,14 +20,23 @@ test prefetch movi a3, 0xd8000000 /* non-cacheable */ movi a4, 0x00001235 /* unmapped */ +#if XCHAL_DCACHE_SIZE pf_op dpfr pf_op dpfro pf_op dpfw pf_op dpfwo +#endif +#ifdef XCHAL_ICACHE_SIZE pf_op ipf - +#endif +#if XCHAL_HAVE_PTP_MMU && !XCHAL_HAVE_SPANNING_WAY +#if XCHAL_DCACHE_LINE_LOCKABLE dpfl a2, 0 +#endif +#if XCHAL_ICACHE_LINE_LOCKABLE ipfl a2, 0 +#endif +#endif test_end .macro cache_fault op, addr, exc_code @@ -46,10 +57,16 @@ test_end assert eq, a2, a3 .endm +#if XCHAL_HAVE_PTP_MMU && !XCHAL_HAVE_SPANNING_WAY + +#if XCHAL_DCACHE_LINE_LOCKABLE test dpfl_tlb_miss cache_fault dpfl, 0x00002345, 24 test_end +#endif +#if XCHAL_DCACHE_SIZE +#if XCHAL_DCACHE_IS_WRITEBACK test dhwb_tlb_miss cache_fault dhwb, 0x00002345, 24 test_end @@ -57,16 +74,21 @@ test_end test dhwbi_tlb_miss cache_fault dhwbi, 0x00002345, 24 test_end +#endif test dhi_tlb_miss cache_fault dhi, 0x00002345, 24 test_end +#if XCHAL_DCACHE_LINE_LOCKABLE test dhu_tlb_miss cache_fault dhu, 0x00002345, 24 test_end +#endif +#endif - +#if XCHAL_ICACHE_SIZE +#if XCHAL_ICACHE_LINE_LOCKABLE test ipfl_tlb_miss cache_fault ipfl, 0x00002345, 16 test_end @@ -74,24 +96,40 @@ test_end test ihu_tlb_miss cache_fault ihu, 0x00002345, 16 test_end +#endif test ihi_tlb_miss cache_fault ihi, 0x00002345, 16 test_end +#endif + +#endif + +#endif test_suite_end -.macro cache_all op1, op2, size, linesize +cache_unlock_invalidate: +#if XCHAL_DCACHE_SIZE movi a2, 0 - movi a3, \size + movi a3, XCHAL_DCACHE_SIZE 1: - \op1 a2, 0 - \op2 a2, 0 - addi a2, a2, \linesize +#if XCHAL_DCACHE_LINE_LOCKABLE + diu a2, 0 +#endif + dii a2, 0 + addi a2, a2, XCHAL_DCACHE_LINESIZE bltu a2, a3, 1b -.endm - -cache_unlock_invalidate: - cache_all diu, dii, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE - cache_all iiu, iii, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE +#endif +#if XCHAL_ICACHE_SIZE + movi a2, 0 + movi a3, XCHAL_ICACHE_SIZE +1: +#if XCHAL_ICACHE_LINE_LOCKABLE + iiu a2, 0 +#endif + iii a2, 0 + addi a2, a2, XCHAL_ICACHE_LINESIZE + bltu a2, a3, 1b +#endif ret