From patchwork Thu Jan 4 01:28:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 855323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 3zBr200vQlz9s1h for ; Thu, 4 Jan 2018 12:34:32 +1100 (AEDT) Received: from localhost ([::1]:44714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWuQQ-0003zO-6o for incoming@patchwork.ozlabs.org; Wed, 03 Jan 2018 20:34:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWuLR-0000p6-IA for qemu-devel@nongnu.org; Wed, 03 Jan 2018 20:29:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWuLO-00072x-AQ for qemu-devel@nongnu.org; Wed, 03 Jan 2018 20:29:21 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:55118) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWuLN-0006zj-VZ for qemu-devel@nongnu.org; Wed, 03 Jan 2018 20:29:18 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MFban-1eimq60kAH-00EcV5; Thu, 04 Jan 2018 02:29:15 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 4 Jan 2018 02:28:56 +0100 Message-Id: <20180104012913.30763-1-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Provags-ID: V03:K0:+LsSBGDiruqdPrjJJxzYYh8KWPYb5lZvcgzxL9eAf9StFKKZtMh GV2d0xofwaVf6rBGIHZb9ZMKJNJYfgUVzjcyNaTBUm+JSZFZrlNTdvH16qA67A7qXq76p0j DaMtmGSe1kURHBIoZqkDdJak+Qh0GalW/ztXEdz+Y5+lGqKnY1H21+s04Vtgtu7xYCi/Mo0 02dK3vS4ETST+Cmss9i+A== X-UI-Out-Filterresults: notjunk:1; V01:K0:tYlftZczUsY=:RPirbsBAt2gvSTDSwZHlnM p3gyzMx2ZGZrLNHgOKWQGuwfasQmdXrguyX3abdR7aokXgtr0ulHbTg8IXmyKdm6hLGDOr9Lr aIiSeDEFhcOm56c8Dn85pm7n+pbcXoBonRgxzDIvKiFkboWacYOrBeCxvub4MPIr7a+5/bKpi xRgnfjlVtuRIxsn689ikhVdYnP0xq2w8ziPJYBMAqKQSUuxnXrNl45BXlAgB8NjxmxKcHBUH/ GXM9Uyk6jNfKXJM9i8u2MnCu+zpWZApcH+/UTmzBdH1rhYBBtRuiz/h87f8Zd6St4gdqgFnhk 4Bs49Oqli5ToYiAFUuRjJnDx0SLtDJ6lgyYXwMM5Fcrdm2NGUeuKs/6F3Oo6CymwF+67uiqf1 avvj5ysUd0BVP9ie9Z4gCizzDWweoC2u1y3t/eK1+e9dJjkjXbTxgvU1JmhhR3Chqg8housX3 Q4G34742YHF1fTJ6ASDXeYqc5deXbaBGg6LwSprZIBEVA0bcS7yMw+kgDHZITTL1PGGsH/CIK hTa276mk9jC2DZtgu7D3Gn61hAlKvj9gxol/n823Wn33rHFODyNbjKpHz2js6uD0bggItMRDT qIS17ugjYaERLdiG5i9SwOrM7+5aCRv8rERgdc8TANURHg+UNOCPmCxZqQUWLKbplKlk8aJpj O8YRMh2tltQt9/zEvmR4mVYOScDeppAfWcCdTqWhZDbWdANIYkS7Ou2rZ6YxOSz8tRzggjybp bgJ/oOBgndFt1MlI1LtxEX9l8HVJ7LSm40WbHGy6F5/foNeDy3SmwFpODdc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PATCH v7 00/17] target/m68k: supervisor mode (part 1) 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: Thomas Huth , Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This series is the first series that will allow to introduce supervisor mode and execute privileged instructions. Some of these patches are only cleanup: sync CC_OP before gen_jmp_tb() fix gen_get_ccr() softmmu cleanup add CPU_LOG_INT trace use insn_pc to generate instruction fault address move CCR/SR functions fix m68k_cpu_dump_state() We also fix a problem with linux-user mode, where the State Register is not updated with the CCR value (found while testing "chk/chk2" using signal()): correctly manage SR in context We introduce some new non privileged instructions: add chk and chk2 add move16 move16 is used by the kernel when it is compiled only for 68040 (it's a 68040 only instruction). We add some trivial privileged instructions (most are empty): add cpush/cinv add reset implement fsave/frestore And finally, we add the privileged instructions to modify the state register, the Interrupt Stack Pointer and the 680x0 stack frame formats: add 680x0 "move to SR" instruction add andi/ori/eori to SR/CCR add the Interrupt Stack Pointer manage 680x0 stack frames The next series will introduce the MC68040 MMU. v7: chk: always update C and N flags chk,chk2: add some comments chk,chk2: move flush_flags() from the helper to the code generator, because otherwise we need to do an update_cc_op() before calling the helper to be sure env->cc_op and s->cc_op are synchronized v6: introduce cpu_m68k_set_sr() to set SR instead of calling helper_set_sr(). update SR with the content of CCR in the logs use helpers as suggested by Richard for chk/chk2 split move16 in two functions use cpu_m68k_set_sr() to set SR in GDB stub and in m68k_cpu_reset() v5: it is in fact v1, there is no previous version. I've messed up with git-publish on an older branch without checking the subject prefix. Sorry... Laurent Vivier (17): target-m68k: sync CC_OP before gen_jmp_tb() target/m68k: fix gen_get_ccr() linux-user,m68k: correctly manage SR in context target/m68k: use insn_pc to generate instruction fault address target/m68k: add CPU_LOG_INT trace target/m68k: manage 680x0 stack frames target/m68k: add chk and chk2 target/m68k: add move16 target/m68k: softmmu cleanup target/m68k: add cpush/cinv target/m68k: add reset target/m68k: implement fsave/frestore target/m68k: move CCR/SR functions target/m68k: add 680x0 "move to SR" instruction target/m68k: add andi/ori/eori to SR/CCR target/m68k: add the Interrupt Stack Pointer target/m68k: fix m68k_cpu_dump_state() linux-user/main.c | 7 + linux-user/signal.c | 7 +- target/m68k/cpu.c | 20 +- target/m68k/cpu.h | 84 +++++++- target/m68k/gdbstub.c | 2 +- target/m68k/helper.c | 99 +++++++++- target/m68k/helper.h | 11 +- target/m68k/monitor.c | 1 + target/m68k/op_helper.c | 338 +++++++++++++++++++++++++++++++- target/m68k/translate.c | 497 ++++++++++++++++++++++++++++++++++++++---------- 10 files changed, 937 insertions(+), 129 deletions(-)