From patchwork Tue Feb 19 06:10:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10819259 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 8A4826CB for ; Tue, 19 Feb 2019 06:13:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68DF42B88C for ; Tue, 19 Feb 2019 06:13:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5882E2B925; Tue, 19 Feb 2019 06:13:20 +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 F28ED2B88C for ; Tue, 19 Feb 2019 06:13:19 +0000 (UTC) Received: from localhost ([127.0.0.1]:42326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvyed-00067O-7f for patchwork-qemu-devel@patchwork.kernel.org; Tue, 19 Feb 2019 01:13:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvydO-0005AG-NS for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvydM-00071S-RY for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:02 -0500 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:44796) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gvydK-0006zz-Se for qemu-devel@nongnu.org; Tue, 19 Feb 2019 01:12:00 -0500 Received: by mail-lj1-x242.google.com with SMTP id q128so16334334ljb.11 for ; Mon, 18 Feb 2019 22:11:56 -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=z324Q5+1YzReCKnbHatpLZh0WV9wLdXVJwMrqe4At7c=; b=CM3P4brtkG5K+/Q5X+uvg1tbr29mAtjpOZ20m6mx16vfP6TMArInw6zPAZDTF4YxZC liHu7Y1OLk74zojFzeLXJA+2DvHERphXRGL82s+6psxj/wVzJe6FM18Odn+rxJ1sWBpG To/BvJ2WPPOL4E8tZ5o6VHIH9Ox0p7P95vtqa7DW+2CmVN37htqatG2qPHF/lZ3l1kkp SJbzem12jmiROdTum8LGxl9gPjfNdausS4mn1Xah88zBAAks6tdHNe/ylldneGjvi6Hd qGZHc7tAEAjtBdzaQRG7jwEC/f8LlrvLqqNMYzxZLNTdQvCMSf+PaFvtANIDFmOtX7A6 9LbA== 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=z324Q5+1YzReCKnbHatpLZh0WV9wLdXVJwMrqe4At7c=; b=Y/XECXReJvPTynI+OTK5XxfxqXQCKGxzwCAqlfmguOke2Bn9Ca1J4dzVvWSGogZJ/L V74LzK20m4bIxj7SfG1u56OGhzxm/7quYQmtOipJyZRsaTpgFtNQCZztjT5dczgf5Tbv h6klMQ08NDt6NW+Nr9LoEKAndAAJlQNUgtRDpcI8svfxWD03EoSW9LvGmcJV145rUvlY C4/d2Ve6U6DByEsZkNMhfryVT/tRug9bTevYbOeazKWc7Lki9lI62jj5LuzhRMUGbnyA VRBGZE3DC+h8No0MITX3MjTjteNnTKhQb4TS40S72z7/OP41ICY3HIQ/boh2eXgspu11 p/Lw== X-Gm-Message-State: AHQUAubu2iq/phB6jdnA55IZWoGcrlkaGC1xaV63kFJwlZNqgQYJ+hrD 8CQlxC7kY0TiC5tcWzN0CyVMxJr/kYs= X-Google-Smtp-Source: AHgI3IaLIo3KNnJ33pAxd9/2aQJJz6WIFbPcl/x7Om6e3ceMtYRXx2/acyWf1N3En44NICiyklBbvw== X-Received: by 2002:a2e:9e46:: with SMTP id g6-v6mr16255259ljk.52.1550556715256; Mon, 18 Feb 2019 22:11:55 -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.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Feb 2019 22:11:54 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Mon, 18 Feb 2019 22:10:49 -0800 Message-Id: <20190219061111.10231-2-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::242 Subject: [Qemu-devel] [PATCH 01/23] target/xtensa: implement PREFCTL SR 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 Cache prefetch option adds an unprivileged SR PREFCTL. Add trivial implementation for this SR. Signed-off-by: Max Filippov --- target/xtensa/cpu.h | 1 + target/xtensa/translate.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/target/xtensa/cpu.h b/target/xtensa/cpu.h index a01a94e2a683..4d8152682fe1 100644 --- a/target/xtensa/cpu.h +++ b/target/xtensa/cpu.h @@ -131,6 +131,7 @@ enum { ACCLO = 16, ACCHI = 17, MR = 32, + PREFCTL = 40, WINDOW_BASE = 72, WINDOW_START = 73, PTEVADDR = 83, diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 2fd64f8d995d..cbc52ecd8fa4 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -134,6 +134,7 @@ static const XtensaReg sregnames[256] = { [MR + 1] = XTENSA_REG("MR1", XTENSA_OPTION_MAC16), [MR + 2] = XTENSA_REG("MR2", XTENSA_OPTION_MAC16), [MR + 3] = XTENSA_REG("MR3", XTENSA_OPTION_MAC16), + [PREFCTL] = XTENSA_REG_BITS("PREFCTL", XTENSA_OPTION_ALL), [WINDOW_BASE] = XTENSA_REG("WINDOW_BASE", XTENSA_OPTION_WINDOWED_REGISTER), [WINDOW_START] = XTENSA_REG("WINDOW_START", XTENSA_OPTION_WINDOWED_REGISTER), @@ -4152,6 +4153,11 @@ static const XtensaOpcodeOps core_ops[] = { .par = (const uint32_t[]){MISC + 3}, .op_flags = XTENSA_OP_PRIVILEGED, }, { + .name = "rsr.prefctl", + .translate = translate_rsr, + .test_ill = test_ill_rsr, + .par = (const uint32_t[]){PREFCTL}, + }, { .name = "rsr.prid", .translate = translate_rsr, .test_ill = test_ill_rsr, @@ -4777,6 +4783,11 @@ static const XtensaOpcodeOps core_ops[] = { .par = (const uint32_t[]){MMID}, .op_flags = XTENSA_OP_PRIVILEGED, }, { + .name = "wsr.prefctl", + .translate = translate_wsr, + .test_ill = test_ill_wsr, + .par = (const uint32_t[]){PREFCTL}, + }, { .name = "wsr.prid", .translate = translate_wsr, .test_ill = test_ill_wsr, @@ -5265,6 +5276,11 @@ static const XtensaOpcodeOps core_ops[] = { .par = (const uint32_t[]){MISC + 3}, .op_flags = XTENSA_OP_PRIVILEGED, }, { + .name = "xsr.prefctl", + .translate = translate_xsr, + .test_ill = test_ill_xsr, + .par = (const uint32_t[]){PREFCTL}, + }, { .name = "xsr.prid", .translate = translate_xsr, .test_ill = test_ill_xsr,