{"id":816432,"url":"http://patchwork.ozlabs.org/api/patches/816432/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920194934.23071-4-f4bug@amsat.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920194934.23071-4-f4bug@amsat.org>","list_archive_url":null,"date":"2017-09-20T19:49:31","name":"[v4,3/6] mips: split cpu_mips_realize_env() out of cpu_mips_init()","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"ae7871fdb732e22eb69691cba2103a5448d225d3","submitter":{"id":70924,"url":"http://patchwork.ozlabs.org/api/people/70924/?format=json","name":"Philippe Mathieu-Daudé","email":"f4bug@amsat.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920194934.23071-4-f4bug@amsat.org/mbox/","series":[{"id":4216,"url":"http://patchwork.ozlabs.org/api/series/4216/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4216","date":"2017-09-20T19:49:28","name":"QOMify MIPS cpu","version":4,"mbox":"http://patchwork.ozlabs.org/series/4216/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816432/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816432/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"mHGOB92d\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xy9QM4JB3z9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 05:52:59 +1000 (AEST)","from localhost ([::1]:50397 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dul3J-0006Fg-Lr\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 15:52:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37797)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dul0R-0004GB-NE\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 15:50:00 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dul0M-0007xO-RA\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 15:49:59 -0400","from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:33867)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dul0M-0007xA-Mq\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 15:49:54 -0400","by mail-qk0-x243.google.com with SMTP id d70so2332488qkc.1\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 12:49:54 -0700 (PDT)","from yoga.offpageads.com ([181.93.89.178])\n\tby smtp.gmail.com with ESMTPSA id\n\ti84sm1952792qkh.17.2017.09.20.12.49.50\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 12:49:53 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=V5zYwjOYS3GwmxVgiUFkyCaFtX8CwutxNcwyTMjmhro=;\n\tb=mHGOB92dYM0jAqu/vnyZr/+BCNa1BbN4n7FXwbTwSiflIwHi81lCSuvNv9236I2plk\n\txBOnIqBGeEB7A5ziYcdj+ONSvQYg+26FA8pkz80TIFTT3VqE4qk9jgbNbjNrBzafscUz\n\t5OFc3p/OGr3BiLYYDR04T4FfMRW+Jor9jP+RuwidVSzirIuBPKSKOxSWNzX+L8Ir7+Mz\n\tkMC+UQdf4fb83x2QWGjvr/hdJVN424mcVb+SMhw2BZI+XM9MUmlQSq76SX78enXTE7h2\n\t56IWtBBm14Nnm0ueMklXva/hyKQSOhaJPaLTy8yfonoH54iWqLC/ON/Wk9Lf1oD3wX/a\n\tO/fA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=V5zYwjOYS3GwmxVgiUFkyCaFtX8CwutxNcwyTMjmhro=;\n\tb=IECrai2YYlKxsJSTViD8qhcsVtebXXmomCGfBkBRcc14HDXQgriwjStGK2n83IBIFp\n\tnfqmth8CQdA2zE9s37mSH4ClAGPw2nbQagroZT9bSSyYYOGKMq5pu93tkfS1cfMz4xY8\n\tiFZ1Vm2hb1QHbBaIV3Jk4IGf9thgVXam6JaC3CYr1XokuMuMXRqBJav6M57QG054XLqc\n\tG+FBHkPKPrVNbce/vxzIXm92P0giroNTynqlkr17iDolWuhwJzb6uPOoCHROJXA1yBYi\n\tGt6NWP2cVBEyA7z5eH0M9+ShIqSxLkcf7puhtny06qzZtxX9ur9QLsECgKnto/6mmJnU\n\tktCw==","X-Gm-Message-State":"AHPjjUinTv7WgnHMCYQwUfLzixJ1tM8iyavCoDFZAtfRvxkSm0Dtvgwb\n\t/8vTR2Q4vBJW7Tt8y6ubnaI=","X-Google-Smtp-Source":"AOwi7QC3rG3aP5b+VyWrTqoNq8HZgC6KKiu8BjtMrGX0rNgS51oq2SXVxsIwNzV1nHAONoUKSoQHXg==","X-Received":"by 10.55.179.196 with SMTP id c187mr2896859qkf.9.1505936994143; \n\tWed, 20 Sep 2017 12:49:54 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>","To":"Igor Mammedov <imammedo@redhat.com>,\n\tEduardo Habkost <ehabkost@redhat.com>, \n\tAurelien Jarno <aurelien@aurel32.net>,\n\tYongbok Kim <yongbok.kim@imgtec.com>,\n\tMarcel Apfelbaum <marcel@redhat.com>","Date":"Wed, 20 Sep 2017 16:49:31 -0300","Message-Id":"<20170920194934.23071-4-f4bug@amsat.org>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170920194934.23071-1-f4bug@amsat.org>","References":"<20170920194934.23071-1-f4bug@amsat.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400d:c09::243","Subject":"[Qemu-devel] [PATCH v4 3/6] mips: split cpu_mips_realize_env() out\n\tof cpu_mips_init()","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Thomas Huth <thuth@redhat.com>, James Hogan <james.hogan@imgtec.com>,\n\t=?utf-8?q?Herv=C3=A9_Poussineau?= <hpoussin@reactos.org>,\n\t=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tqemu-devel@nongnu.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"so it can be used in mips_cpu_realizefn() in the next commit\n\nSigned-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\nTested-by: Igor Mammedov <imammedo@redhat.com>\nTested-by: James Hogan <james.hogan@imgtec.com>\nReviewed-by: Eduardo Habkost <ehabkost@redhat.com>\n---\n target/mips/internal.h  |  1 +\n target/mips/translate.c | 19 ++++++++++++-------\n 2 files changed, 13 insertions(+), 7 deletions(-)","diff":"diff --git a/target/mips/internal.h b/target/mips/internal.h\nindex 91c2df4537..cf4c9db427 100644\n--- a/target/mips/internal.h\n+++ b/target/mips/internal.h\n@@ -132,6 +132,7 @@ void mips_tcg_init(void);\n \n /* TODO QOM'ify CPU reset and remove */\n void cpu_state_reset(CPUMIPSState *s);\n+void cpu_mips_realize_env(CPUMIPSState *env);\n \n /* cp0_timer.c */\n uint32_t cpu_mips_get_random(CPUMIPSState *env);\ndiff --git a/target/mips/translate.c b/target/mips/translate.c\nindex f0febaf1b2..5fc7979ac5 100644\n--- a/target/mips/translate.c\n+++ b/target/mips/translate.c\n@@ -20512,6 +20512,17 @@ void mips_tcg_init(void)\n \n #include \"translate_init.c\"\n \n+void cpu_mips_realize_env(CPUMIPSState *env)\n+{\n+    env->exception_base = (int32_t)0xBFC00000;\n+\n+#ifndef CONFIG_USER_ONLY\n+    mmu_init(env, env->cpu_model);\n+#endif\n+    fpu_init(env, env->cpu_model);\n+    mvp_init(env, env->cpu_model);\n+}\n+\n MIPSCPU *cpu_mips_init(const char *cpu_model)\n {\n     MIPSCPU *cpu;\n@@ -20524,13 +20535,7 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)\n     cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU));\n     env = &cpu->env;\n     env->cpu_model = def;\n-    env->exception_base = (int32_t)0xBFC00000;\n-\n-#ifndef CONFIG_USER_ONLY\n-    mmu_init(env, def);\n-#endif\n-    fpu_init(env, def);\n-    mvp_init(env, def);\n+    cpu_mips_realize_env(env);\n \n     object_property_set_bool(OBJECT(cpu), true, \"realized\", NULL);\n \n","prefixes":["v4","3/6"]}