{"id":816431,"url":"http://patchwork.ozlabs.org/api/patches/816431/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170920194934.23071-5-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-5-f4bug@amsat.org>","list_archive_url":null,"date":"2017-09-20T19:49:32","name":"[v4,4/6] mips: call cpu_mips_realize_env() from mips_cpu_realizefn()","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"173a3805a639cff3cc5778c25ccc431df20f76af","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-5-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/816431/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816431/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=\"MOSzoF63\"; 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 3xy9QK5TVwz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 05:52:57 +1000 (AEST)","from localhost ([::1]:50396 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 1dul3H-0006Bk-M3\n\tfor incoming@patchwork.ozlabs.org; Wed, 20 Sep 2017 15:52:55 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37799)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <philippe.mathieu.daude@gmail.com>)\n\tid 1dul0R-0004GF-QE\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 1dul0P-00080s-VZ\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]:37841)\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 1dul0P-00080K-RK\n\tfor qemu-devel@nongnu.org; Wed, 20 Sep 2017 15:49:57 -0400","by mail-qk0-x243.google.com with SMTP id r66so2330044qke.4\n\tfor <qemu-devel@nongnu.org>; Wed, 20 Sep 2017 12:49:57 -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.54\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 12:49:56 -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=NH8TvAzvRl3fTHfE/31Bx3YX3regwTO6EcNX9WiRiOQ=;\n\tb=MOSzoF63mI1+Re9z4jz3qVekHL6IlLFzlVjZVNlGqTQ37IqHODt7tM9wOnBuDBwAh3\n\tnh9mRkfJIW5Y2SmW8FBGGIYYpqhCQScam/8OFlleJMLY4a6P6y+AzY+lNtgQSHHqibRG\n\th+guxeTnJs9G0j5yR1eRSmQnEWZ3Osl4KmCzoNngItFsaDm7C14w/OglG1/hZI0JRW0y\n\tueXGtZmcXVi0HU9jCIedPLGr54I9dzj43xxS7tlxnIxjRzvdLX82qHspCWH/8M2FWutd\n\tHM01ffd5rkI2LhV2VkYeG23d9BS1PcviqJYE4EaU/PAYm5H81pc3bZXEjZOHxYfY23Ob\n\teOVA==","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=NH8TvAzvRl3fTHfE/31Bx3YX3regwTO6EcNX9WiRiOQ=;\n\tb=kB16iotOEkL0YXqbkZfnIpFFJLWIhs6vxS+XLFUmV7q+GYBMj2+gqL3F46TB0LdSiC\n\tIU5+GyiEXOrZO8375+ZVpQKdxp9XyKfIHaLYjvmRPu+iDMgYeKZnMGW0dJHustK+kHzq\n\tFagT/VxASnXWO2QAPeHfTem6yPjN2NK+8kAcYW48ZVl2oxZRAWe3c4kdWKNWtZiOrj+Q\n\tdmoakS81lWzXHDwxQ4an1phiIQ+YogtIDH2EERZGNESXk/nUuTYEE9vSz9+Nh3PcHWvv\n\te9FQP2WIgr6SBN0aekYfUhEWv6Ug3ibUarSnIZ11eKlDUJmba8HtX+Kg2bh2tUuOnh+Z\n\tBFQQ==","X-Gm-Message-State":"AHPjjUh73qdZP0mPbmGaQ8vkEoPk7ZPzXiL71uk4S4zbzb/6iaScfSGp\n\tg/F9qs3rJR0TsgJmkIUsJuU=","X-Google-Smtp-Source":"AOwi7QBgHWKy6V5Ta59+1DLEcCf8s2Dbq/1IXAO7QduAU61CoKG6B3uRijIDdIq6shWIooybG4X3Yg==","X-Received":"by 10.55.154.2 with SMTP id c2mr8925622qke.4.1505936997346;\n\tWed, 20 Sep 2017 12:49:57 -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:32 -0300","Message-Id":"<20170920194934.23071-5-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 4/6] mips: call cpu_mips_realize_env() from\n\tmips_cpu_realizefn()","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":"This changes the order between cpu_mips_realize_env() and\ncpu_exec_initfn(), but cpu_exec_initfn() don't have anything that\ndepends on cpu_mips_realize_env() being called first.\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/cpu.c       | 3 +++\n target/mips/translate.c | 1 -\n 2 files changed, 3 insertions(+), 1 deletion(-)","diff":"diff --git a/target/mips/cpu.c b/target/mips/cpu.c\nindex 68bf423e9d..e3ef835599 100644\n--- a/target/mips/cpu.c\n+++ b/target/mips/cpu.c\n@@ -123,6 +123,7 @@ static void mips_cpu_disas_set_info(CPUState *s, disassemble_info *info) {\n static void mips_cpu_realizefn(DeviceState *dev, Error **errp)\n {\n     CPUState *cs = CPU(dev);\n+    MIPSCPU *cpu = MIPS_CPU(dev);\n     MIPSCPUClass *mcc = MIPS_CPU_GET_CLASS(dev);\n     Error *local_err = NULL;\n \n@@ -132,6 +133,8 @@ static void mips_cpu_realizefn(DeviceState *dev, Error **errp)\n         return;\n     }\n \n+    cpu_mips_realize_env(&cpu->env);\n+\n     cpu_reset(cs);\n     qemu_init_vcpu(cs);\n \ndiff --git a/target/mips/translate.c b/target/mips/translate.c\nindex 5fc7979ac5..94c38e8755 100644\n--- a/target/mips/translate.c\n+++ b/target/mips/translate.c\n@@ -20535,7 +20535,6 @@ 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-    cpu_mips_realize_env(env);\n \n     object_property_set_bool(OBJECT(cpu), true, \"realized\", NULL);\n \n","prefixes":["v4","4/6"]}