From patchwork Sun Jan 15 21:11:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 9517875 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 87600600F6 for ; Sun, 15 Jan 2017 21:21:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48F8428402 for ; Sun, 15 Jan 2017 21:21:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C21D2840A; Sun, 15 Jan 2017 21:21:00 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UPPERCASE_50_75 autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF93E28402 for ; Sun, 15 Jan 2017 21:20:59 +0000 (UTC) Received: from localhost ([::1]:52998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSsEU-0006zU-QV for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Jan 2017 16:20:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSs5u-0007ok-GY for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:12:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSs5r-00030f-BU for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:12:06 -0500 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33074) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSs5r-00030U-5k for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:12:03 -0500 Received: by mail-pg0-x242.google.com with SMTP id 194so3587309pgd.0 for ; Sun, 15 Jan 2017 13:12:03 -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; bh=QUN/+rQeJdMpWHApqKP3Z5fo78R20jhuDT1OrbMsfGg=; b=ABgKISuCjqb0XdkHrqsOCZuAzRNy1WsXutZYUf3Z2/sk73ntYNuJtH+/8j1/2DUdVS 1zLekK6wWtHS7r/dPrquTH0jsWGquuMwyDXvn91sfTmonBMv6t9zzAuYWfmgJVR8z36k Ay/o/H4Z+3cNHX+Y8j9wJAx1iOCdEQauEMdCWvGHPPAuFmqu4YS4Itnq+BvSVAx0zTMD ijfMKg5WoOc/AwOoiBnvQeFH2Jn0SPkO0JucgbZajTQyI2ZnNp+Ly2wpyTR7DuDdJu9U sb4uS20iGiGfyMejIrIxYZKyneC6XYKBXYEEEtoCcELOXHxGZRIjCp9XCbIbL9SiRXy8 pDQA== 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; bh=QUN/+rQeJdMpWHApqKP3Z5fo78R20jhuDT1OrbMsfGg=; b=cZS+veaFyPQjROjeGoD9Ap4+MtNEuhU0GBeEdAem0HpZhh4we2yrD4FkJBsIfhNLxY HZcw9o9Y4K1C+M06uMFYzEEJ5GvmGgaSHPmi+WEUybIpr9t1iaOE8lx0KE5EK9stxhAS qLJhs9u1ovbK5WmNy6RWdTcD8Lv+qTWiDYdU15Nh1Wun/uv8RZovVT2lF71Xl1FlwYzp CGOErZmdpDXTFCgfALLUrJseD6i9EE0jOH6RqLhrFEKSzta4uhGvn1N3BOXL2KmhIK70 8tFfcudbF6dQ9UheXyKuQZEEmxfz0031PM//DM+Ti8+YYXgpDURKyAFVRBh09pcSpanl I0Hg== X-Gm-Message-State: AIkVDXLrzb4K6jO5OPJcYn2vW2j59mR36YdbQ0wLzGGHZtz8sYCTULzFbUGIgJusz2omyw== X-Received: by 10.99.184.18 with SMTP id p18mr36277634pge.33.1484514722467; Sun, 15 Jan 2017 13:12:02 -0800 (PST) Received: from octofox.net (c-73-202-152-109.hsd1.ca.comcast.net. [73.202.152.109]) by smtp.gmail.com with ESMTPSA id e88sm42288017pfb.16.2017.01.15.13.12.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Jan 2017 13:12:01 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 15 Jan 2017 13:11:47 -0800 Message-Id: <1484514707-11781-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH] target/xtensa: fix ICACHE/DCACHE options detection 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 Configuration overlay does not explicitly say whether there are ICACHE and DCACHE in the core. Current code uses XCHAL_[ID]CACHE_WAYS to detect if corresponding cache option is enabled, but that's not correct: on cores without cache these macros are defined as 1, not as 0. Check XCHAL_[ID]CACHE_SIZE instead. Signed-off-by: Max Filippov --- target/xtensa/overlay_tool.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h index 5357142..b73fd14 100644 --- a/target/xtensa/overlay_tool.h +++ b/target/xtensa/overlay_tool.h @@ -92,10 +92,10 @@ XTENSA_OPTION_HIGH_PRIORITY_INTERRUPT) | \ XCHAL_OPTION(XCHAL_HAVE_CCOUNT, XTENSA_OPTION_TIMER_INTERRUPT) | \ /* Local memory, TODO */ \ - XCHAL_OPTION(XCHAL_ICACHE_WAYS, XTENSA_OPTION_ICACHE) | \ + XCHAL_OPTION(XCHAL_ICACHE_SIZE, XTENSA_OPTION_ICACHE) | \ XCHAL_OPTION(XCHAL_ICACHE_LINE_LOCKABLE, \ XTENSA_OPTION_ICACHE_INDEX_LOCK) | \ - XCHAL_OPTION(XCHAL_DCACHE_WAYS, XTENSA_OPTION_DCACHE) | \ + XCHAL_OPTION(XCHAL_DCACHE_SIZE, XTENSA_OPTION_DCACHE) | \ XCHAL_OPTION(XCHAL_DCACHE_LINE_LOCKABLE, \ XTENSA_OPTION_DCACHE_INDEX_LOCK) | \ XCHAL_OPTION(XCHAL_UNALIGNED_LOAD_HW, XTENSA_OPTION_HW_ALIGNMENT) | \