From patchwork Wed Sep 5 01:43:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 10588155 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 BB92A13BB for ; Wed, 5 Sep 2018 01:46:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADB1F29CE6 for ; Wed, 5 Sep 2018 01:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A20BF29D92; Wed, 5 Sep 2018 01:46:05 +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=-7.3 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 5ADE729CE6 for ; Wed, 5 Sep 2018 01:46:05 +0000 (UTC) Received: from localhost ([::1]:53383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxMtQ-00074Z-KC for patchwork-qemu-devel@patchwork.kernel.org; Tue, 04 Sep 2018 21:46:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fxMrv-0005t6-TW for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxMru-0006ib-RX for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:31 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:38939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fxMrr-0006e9-VI for qemu-devel@nongnu.org; Tue, 04 Sep 2018 21:44:29 -0400 Received: by mail-lj1-x233.google.com with SMTP id l15-v6so4804104lji.6 for ; Tue, 04 Sep 2018 18:44:26 -0700 (PDT) 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=wY229Uq9Klsh5BvcIvkO5hQDk1cEjYww5T7I5nckfXQ=; b=p4SwKudL1uUrIAU/eysqw+tQ78XVx3DFlOt0zKMLBAi58ZkTZBC8hQqGV9L8GCYeQO vS8E7i8kg5qPrzJ2Yd7CcPRJ8mZZ38h9+4SIVAtGQZPUJjH3jDavXKiYfNm6eqdwcwHr 6m9zReFTQE50nEhv1TlnW6Z9lUkE6g0UVGYyn545k99k0ajZzlzZN9p9kL8NJy1/hRaV nNu73qYXwAJaOvKI73HZGmcbyzexjVdTgsjtXbFecslqzHKXBKVzWa5+7AuB1rEPXSuv Ds+0XkyXutw80UrD8xq4wmSHbvhEjLE4JNZVIYXa0UMGBaL9sx6tw3mbYw0xQsgxTD9i bypw== 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=wY229Uq9Klsh5BvcIvkO5hQDk1cEjYww5T7I5nckfXQ=; b=NWUeuNiSvpBy1CSSqWHgsfTtmm/uztLglSuFYY4nd4dVw8rslzxoPabZJRRU+Xfast iTdlAca9nqfo3bg13xetpX7acNhPy/tu3FMp+itrG7Mi7kzAxGhzELHjeIe+fW1MYmjH zznGoHFOoxJtqgYEldvp1YoY1WSm3rlYd2P7Q3UFL92fQ6/qDtnIUm6tnzwUjwgS+Y5f 4Ouk58ZiJ0RitDmHWWDWDhITn3lECF5IzCEKsJtCndxLbUWBGcwrz20++wCxoM5/utMr 1QtcIFKGFJQpxrlIUXEnV0AwjE79ZJWbGnKdbx/firCe4Ekuzzr9d2LTG7CuPM0pZ4ZN cbEg== X-Gm-Message-State: APzg51ANBO1v/fA1yK2lBlctWk3cANpwN2j3k16+5mXkU6ES7v1yudpy ogyfb3jV45q8mURziUHkLYFksa+GNqQ= X-Google-Smtp-Source: ANB0VdbNQVqXwXfQbtChlo6YdRLQjEf0YsD73yaoNctOt0/HctZlDj4bqXhjrIpMAdMNgkf+ygspcQ== X-Received: by 2002:a2e:3e0d:: with SMTP id l13-v6mr19612088lja.151.1536111865568; Tue, 04 Sep 2018 18:44:25 -0700 (PDT) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id g10-v6sm59337lfl.11.2018.09.04.18.44.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 18:44:25 -0700 (PDT) From: Max Filippov To: qemu-devel@nongnu.org Date: Tue, 4 Sep 2018 18:43:40 -0700 Message-Id: <20180905014352.970-4-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180905014352.970-1-jcmvbkbc@gmail.com> References: <20180905014352.970-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::233 Subject: [Qemu-devel] [PATCH 03/15] target/xtensa: extract test for syscall instruction 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 - mark syscall instruction; - put syscall exception check right after privileged exception check; Signed-off-by: Max Filippov --- target/xtensa/translate.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index ebee7bd65e48..450e30d316a8 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1047,6 +1047,11 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc) return; } + if (op_flags & XTENSA_OP_SYSCALL) { + gen_exception_cause(dc, SYSCALL_CAUSE); + return; + } + for (slot = 0; slot < slots; ++slot) { XtensaOpcodeOps *ops = slot_prop[slot].ops; @@ -2557,12 +2562,6 @@ static void translate_subx(DisasContext *dc, const uint32_t arg[], } } -static void translate_syscall(DisasContext *dc, const uint32_t arg[], - const uint32_t par[]) -{ - gen_exception_cause(dc, SYSCALL_CAUSE); -} - static void translate_waiti(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { @@ -4094,7 +4093,7 @@ static const XtensaOpcodeOps core_ops[] = { .par = (const uint32_t[]){3}, }, { .name = "syscall", - .translate = translate_syscall, + .op_flags = XTENSA_OP_SYSCALL, }, { .name = "umul.aa.hh", .translate = translate_mac16,