From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889466; cv=none; d=zohomail.com; s=zohoarc; b=MrJYnC6umc41zomsQc0uMYzcPfJ71FYsrYwKx5vHZa4DaDeocGIcVM2Wg+lb0siRcB10hiYgsHehuYK6XZpecq/BIkCDQlIe7UBlHi0AEFhpn1lF0wWAmPlIwR0YmvwGbyd1DANDvnkHSDssWBglx6R8j69O2TgfRq0lAuXl7Hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OcWR3f/h4y2t1Ea2bxS5D9PQTfG2VaD+IbmhIiBv4+c=; b=QrS4M3cBsfty9Kujwx8y9CgmRQLV8G5fSiVj7fHugm+ItaZP1qEZqMYYvJVoPuAiPiX/MQB37hDvpEzQJ1wZQGyy6XK/NRCbeZZSkkv8KMlJS+cst0A8bMrEJVKlmCU/4/ZfwnDrnlICbHwlc3mGUWw0J+kU6Dqdbj5948+eOBs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889466367922.2148893946992; Fri, 24 Jan 2020 10:11:06 -0800 (PST) Received: from localhost ([::1]:46098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3Q9-0005br-05 for importer@patchew.org; Fri, 24 Jan 2020 13:11:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35283) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NB-0000uA-Nb for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3N9-0004un-Lq for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46479 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3N9-0004rK-EH for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:07:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 950F01A20F6; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 7D6FE1A20EF; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine Date: Fri, 24 Jan 2020 19:07:43 +0100 Message-Id: <1579889269-8122-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Change the documented (in file qemu-deprecated.texi) release since r4k machine is deprecated from 4.2 to 5.0. Fixes: d32dc61421b Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Aleksandar Markovic Message-Id: <1579883929-1517-2-git-send-email-aleksandar.markovic@rt-rk.com> --- qemu-deprecated.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 0968d37..3d2a8ff 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -260,7 +260,7 @@ The 'scsi-disk' device is deprecated. Users should use = 'scsi-hd' or =20 @section System emulator machines =20 -@subsection mips r4k platform (since 4.2) +@subsection mips r4k platform (since 5.0) =20 This machine type is very old and unmaintained. Users should use the 'malt= a' machine type instead. --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889359; cv=none; d=zohomail.com; s=zohoarc; b=Tp5mvgbWGAI2chZVQSr8J35Zrh8rdRCPDMbT0wIxNpa2iq6+eDm4ytOZJiuW8Xik600Twz+xKvk5dKp1tJwjoJzrKfdcGjOURlM+0nMTYtQuhbN6p+dFUiSzZlwFlenWTpITjvb243do53ALzMSnkDexF8Ro5Q+dDuDct/zgqmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889359; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=6lpq5xe+njZjK4vo9cWtnwh0z01MjksFIbLN8UfQNmc=; b=V/1qAgfjStc77UckpVxhOmicW9mw3H/e/PbeH5NfjYEgjr0Dga2pG3OovMp1ttFXauDxOfJcc1zayTmFEdETeAVyocpGckmg8leaCOfHM4ginZwh43I6zyjkHgBj5HLFq2wmDzNeArhQk7sAiV4XJXxLJnJCg04TOHB02IH8M7U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889359640450.20084779457363; Fri, 24 Jan 2020 10:09:19 -0800 (PST) Received: from localhost ([::1]:46060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3OP-0002Uf-Ku for importer@patchew.org; Fri, 24 Jan 2020 13:09:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35282) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NB-0000u9-N5 for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3N9-0004v3-PU for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46487 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3N9-0004rP-JP for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:07:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 9F2A01A20EF; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 8590E1A20F0; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 2/7] disas: Add a field for target-dependant data Date: Fri, 24 Jan 2020 19:07:44 +0100 Message-Id: <1579889269-8122-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic This patch adds a field "target_info" to the structure disassemble_info. The purpose of this field is to enable targets to pass to disassembler code any additional data thet deem suitable. Reviewed-by: Aleksandar Rikalo Signed-off-by: Aleksandar Markovic Message-Id: <1579883929-1517-6-git-send-email-aleksandar.markovic@rt-rk.com> --- include/disas/dis-asm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h index e9c7dd8..f87f468 100644 --- a/include/disas/dis-asm.h +++ b/include/disas/dis-asm.h @@ -372,6 +372,9 @@ typedef struct disassemble_info { /* Command line options specific to the target disassembler. */ char * disassembler_options; =20 + /* Field intended to be used by targets in any way they deem suitable. = */ + int64_t target_info; + /* Options for Capstone disassembly. */ int cap_arch; int cap_mode; --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889549; cv=none; d=zohomail.com; s=zohoarc; b=dMuEWamtPJB/L+RtxAiqQfG6lKpTXK3B3l9yRjgvUoQ9k/URtJRS6+27ObGuZB/qprgD/mn2r2ICvLL8j8O1qRhAxqpQOgMQc+H7MwuOi0Rx57twxhwZRWIiq0yaUY0zInqPjb29Cki8drBNtWHgdNEKvIkLy5mH0fMTE4UAr9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889549; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=9QtlUMXNRPUrLyn1mpHpRuAcaaUEWOIOjadjjQGAjc8=; b=QpUwgui2w4SCSMQmteYs9e4Ib3MAC/BpipQ+UlwTwDMGYoFlG7LCt/ApJxrUXIW4ETUwxNW8h4GhlhkB8ohjxTmXGjilRcwlYuJ99CQth38Rl9pJ/EUMhRYCl+V/X4FikpBUVaUy6jg4gYjlxBm0ZfQ64Ml5EOxDfdxlmjyq5YI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889549936519.2739575767831; Fri, 24 Jan 2020 10:12:29 -0800 (PST) Received: from localhost ([::1]:46130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3RU-0008A6-3I for importer@patchew.org; Fri, 24 Jan 2020 13:12:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35305) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NC-0000uH-8M for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3N9-0004uu-Md for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46492 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3N9-0004rS-9X for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:07:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id B65991A2134; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 8C9BD1A20F1; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Date: Fri, 24 Jan 2020 19:07:45 +0100 Message-Id: <1579889269-8122-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Daniel Henrique Barboza The label 'uhi_done' is a simple 'return' call and can be removed for a bit more clarity in the code. CC: Aurelien Jarno CC: Aleksandar Markovic CC: Aleksandar Rikalo Reviewed-by: Aleksandar Markovic Signed-off-by: Aleksandar Markovic Signed-off-by: Daniel Henrique Barboza Message-Id: <20200106182425.20312-7-danielhb413@gmail.com> --- target/mips/mips-semi.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index 35bdfd7..10a710c 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -218,7 +218,7 @@ static int copy_argn_to_target(CPUMIPSState *env, int a= rg_num, if (!p) { \ gpr[2] =3D -1; \ gpr[3] =3D EFAULT; \ - goto uhi_done; \ + return; \ } \ } while (0) =20 @@ -228,14 +228,14 @@ static int copy_argn_to_target(CPUMIPSState *env, int= arg_num, if (!p) { \ gpr[2] =3D -1; \ gpr[3] =3D EFAULT; \ - goto uhi_done; \ + return; \ } \ p2 =3D lock_user_string(addr2); \ if (!p2) { \ unlock_user(p, addr, 0); \ gpr[2] =3D -1; \ gpr[3] =3D EFAULT; \ - goto uhi_done; \ + return; \ } \ } while (0) =20 @@ -272,7 +272,7 @@ void helper_do_semihosting(CPUMIPSState *env) if (gpr[4] < 3) { /* ignore closing stdin/stdout/stderr */ gpr[2] =3D 0; - goto uhi_done; + return; } gpr[2] =3D close(gpr[4]); gpr[3] =3D errno_mips(errno); @@ -302,7 +302,7 @@ void helper_do_semihosting(CPUMIPSState *env) gpr[2] =3D fstat(gpr[4], &sbuf); gpr[3] =3D errno_mips(errno); if (gpr[2]) { - goto uhi_done; + return; } gpr[2] =3D copy_stat_to_target(env, &sbuf, gpr[5]); gpr[3] =3D errno_mips(errno); @@ -314,14 +314,14 @@ void helper_do_semihosting(CPUMIPSState *env) case UHI_argnlen: if (gpr[4] >=3D semihosting_get_argc()) { gpr[2] =3D -1; - goto uhi_done; + return; } gpr[2] =3D strlen(semihosting_get_arg(gpr[4])); break; case UHI_argn: if (gpr[4] >=3D semihosting_get_argc()) { gpr[2] =3D -1; - goto uhi_done; + return; } gpr[2] =3D copy_argn_to_target(env, gpr[4], gpr[5]); break; @@ -369,6 +369,5 @@ void helper_do_semihosting(CPUMIPSState *env) fprintf(stderr, "Unknown UHI operation %d\n", op); abort(); } -uhi_done: return; } --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889359; cv=none; d=zohomail.com; s=zohoarc; b=cedaW0vdcGltmhPUIQDEpE245ZFiCAmOBgEoB3bQSyefEYPaCVt2gE9/3ZJOHu+vtl3d9Lm6AEJbhPAtVHR9YIqi2b8Cm+BQ8H3P9t/llGMq7qbpeL9mfPvtcLqfH7xHj+4HfcM58m1Tx5AOf/A2ScMhZmHjy8vxJI8P/woDJ9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889359; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+WWe4/IDkSwRVcpGAYHzv3QNQSnz/PFKmCDaEjACpBc=; b=WKjoAz4nyd8b2k0FVG3BmL3GI3GDWcTmXUxgSRJdslWb5Iq/clbZ8cgGhLduVa4zusuq6/lvXrRQOkT6qbKSlxD0bhwddZyLK4j7r55V6ocydGAllFWEPFdPF2CyX275YiSK3TDuvuXNGH5XwatYa3aWJ0d+2X3fLB2SUszXF0U= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157988935957276.36073695426114; Fri, 24 Jan 2020 10:09:19 -0800 (PST) Received: from localhost ([::1]:46058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3OQ-0002UX-1e for importer@patchew.org; Fri, 24 Jan 2020 13:09:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35260) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NB-0000u2-3i for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3N9-0004uf-Kp for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:00 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46490 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3N9-0004rQ-EF for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:07:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id BBA4C1A2147; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id 9ED7A1A1E2C; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 4/7] mips/mips_jazz: use memdev for RAM Date: Fri, 24 Jan 2020 19:07:46 +0100 Message-Id: <1579889269-8122-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Igor Mammedov memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializing RAM memory region. Signed-off-by: Aleksandar Markovic Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1579779525-20065-54-git-send-email-imammedo@redhat.com> --- hw/mips/mips_jazz.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 66fd4d8..85d49cf 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -159,7 +159,6 @@ static void mips_jazz_init(MachineState *machine, ISABus *isa_bus; ISADevice *pit; DriveInfo *fds[MAX_FD]; - MemoryRegion *ram =3D g_new(MemoryRegion, 1); MemoryRegion *bios =3D g_new(MemoryRegion, 1); MemoryRegion *bios2 =3D g_new(MemoryRegion, 1); SysBusESPState *sysbus_esp; @@ -191,9 +190,7 @@ static void mips_jazz_init(MachineState *machine, cc->do_transaction_failed =3D mips_jazz_do_transaction_failed; =20 /* allocate RAM */ - memory_region_allocate_system_memory(ram, NULL, "mips_jazz.ram", - machine->ram_size); - memory_region_add_subregion(address_space, 0, ram); + memory_region_add_subregion(address_space, 0, machine->ram); =20 memory_region_init_ram(bios, NULL, "mips_jazz.bios", MAGNUM_BIOS_SIZE, &error_fatal); @@ -393,6 +390,7 @@ static void mips_magnum_class_init(ObjectClass *oc, voi= d *data) mc->init =3D mips_magnum_init; mc->block_default_type =3D IF_SCSI; mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("R4000"); + mc->default_ram_id =3D "mips_jazz.ram"; } =20 static const TypeInfo mips_magnum_type =3D { @@ -409,6 +407,7 @@ static void mips_pica61_class_init(ObjectClass *oc, voi= d *data) mc->init =3D mips_pica61_init; mc->block_default_type =3D IF_SCSI; mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("R4000"); + mc->default_ram_id =3D "mips_jazz.ram"; } =20 static const TypeInfo mips_pica61_type =3D { --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889465; cv=none; d=zohomail.com; s=zohoarc; b=Q1ZFzq3oug0nFKwtzr4Tt3UsobBdynIVko6/HqiUhGnqp8ElAB5u9V34NIG3HAL8xXRAL7ROLCmND4oml1t6UZHhRKIcSqHypgWXQJwAtdVVTaD5S/B5+rAJepNJY2Mr/65qdEp7uwDlqG70aKMyfkmQqePkAQ9cgeLVlICqLXE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889465; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mPKkUO59KIT/DBGgR6quf1mY5sd6WF1eFXiKRQiP0i8=; b=SOnYFtkPB53Fd3tzSyUkeiyzlogF7FsNeuMckVEO7KEcORZlzV89Fb0o5AKhjQpx6fc8/Jdsy18AN/vYUKXWs7HMMt/mtNP1JIrIX96uWASkgqOp16+zwhtiMjh/B+vrfR69WRGO5xycUt1r50kMfU1KSkWmuzLzp7zdJ1Acav4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889465315991.88744635975; Fri, 24 Jan 2020 10:11:05 -0800 (PST) Received: from localhost ([::1]:46096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3Q7-0005bG-7K for importer@patchew.org; Fri, 24 Jan 2020 13:11:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35302) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NC-0000uG-7e for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3NA-0004wj-Vb for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46502 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3NA-0004vB-P4 for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id CB6271A1E2C; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id A60FF1A20F0; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 5/7] mips/mips_malta: use memdev for RAM Date: Fri, 24 Jan 2020 19:07:47 +0100 Message-Id: <1579889269-8122-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Igor Mammedov memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializing RAM memory region. Signed-off-by: Aleksandar Markovic Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1579779525-20065-55-git-send-email-imammedo@redhat.com> --- hw/mips/mips_malta.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 5aaeaa8..77995a5 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1223,7 +1223,6 @@ void mips_malta_init(MachineState *machine) char *filename; PFlashCFI01 *fl; MemoryRegion *system_memory =3D get_system_memory(); - MemoryRegion *ram_high =3D g_new(MemoryRegion, 1); MemoryRegion *ram_low_preio =3D g_new(MemoryRegion, 1); MemoryRegion *ram_low_postio; MemoryRegion *bios, *bios_copy =3D g_new(MemoryRegion, 1); @@ -1261,13 +1260,11 @@ void mips_malta_init(MachineState *machine) } =20 /* register RAM at high address where it is undisturbed by IO */ - memory_region_allocate_system_memory(ram_high, NULL, "mips_malta.ram", - ram_size); - memory_region_add_subregion(system_memory, 0x80000000, ram_high); + memory_region_add_subregion(system_memory, 0x80000000, machine->ram); =20 /* alias for pre IO hole access */ memory_region_init_alias(ram_low_preio, NULL, "mips_malta_low_preio.ra= m", - ram_high, 0, MIN(ram_size, 256 * MiB)); + machine->ram, 0, MIN(ram_size, 256 * MiB)); memory_region_add_subregion(system_memory, 0, ram_low_preio); =20 /* alias for post IO hole access, if there is enough RAM */ @@ -1275,7 +1272,7 @@ void mips_malta_init(MachineState *machine) ram_low_postio =3D g_new(MemoryRegion, 1); memory_region_init_alias(ram_low_postio, NULL, "mips_malta_low_postio.ram", - ram_high, 512 * MiB, + machine->ram, 512 * MiB, ram_size - 512 * MiB); memory_region_add_subregion(system_memory, 512 * MiB, ram_low_postio); @@ -1447,6 +1444,7 @@ static void mips_malta_machine_init(MachineClass *mc) #else mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("24Kf"); #endif + mc->default_ram_id =3D "mips_malta.ram"; } =20 DEFINE_MACHINE("malta", mips_malta_machine_init) --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889360; cv=none; d=zohomail.com; s=zohoarc; b=Owb1nb547TqP94H44f0uUz82CW3NyJdgX8wanj805PwEUB4CLDG3YtAqoa2cBMKXVuFXFYgWfoLK5FhmWBA1Q8ofKNqiGLrAclfBKa+ROPuS8RaeVPY9dsp/KTItn3m0FhbXahYmSFU90h9jGKAkxGm+pt/JrdFF8B0oESvcjdI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889360; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VR516OQWd5ratCef9gLSL4pC0Txdr+cKDjtx2RLvE4c=; b=lPuAe707/5VJzTT2eNOLnFnR/raAq2sxpTLiv68afJyYaeUUCQTJc+eAvohpf551rkvWCzqwfHq5T0xRpYJOsIfdHnkxkSphZVXsYS6E2zEYQi38K2d5y7Cq6yqdbU/jB5HFa7S4W2VRQfHCLWRON39pD5NXssj2Rc4x3YlVRsI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889360157465.93849841958445; Fri, 24 Jan 2020 10:09:20 -0800 (PST) Received: from localhost ([::1]:46064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3OQ-0002Yq-SO for importer@patchew.org; Fri, 24 Jan 2020 13:09:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35295) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NC-0000uD-0m for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3NA-0004wQ-TQ for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46503 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3NA-0004v9-ND for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id D39351A20F0; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id AF8A51A20F3; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 6/7] mips/mips_mipssim: use memdev for RAM Date: Fri, 24 Jan 2020 19:07:48 +0100 Message-Id: <1579889269-8122-7-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Igor Mammedov memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializing RAM memory region. Signed-off-by: Aleksandar Markovic Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1579779525-20065-56-git-send-email-imammedo@redhat.com> --- hw/mips/mips_mipssim.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index 84c03dd..8df16d8 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -143,14 +143,12 @@ static void mipsnet_init(int base, qemu_irq irq, NICI= nfo *nd) static void mips_mipssim_init(MachineState *machine) { - ram_addr_t ram_size =3D machine->ram_size; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; char *filename; MemoryRegion *address_space_mem =3D get_system_memory(); MemoryRegion *isa =3D g_new(MemoryRegion, 1); - MemoryRegion *ram =3D g_new(MemoryRegion, 1); MemoryRegion *bios =3D g_new(MemoryRegion, 1); MIPSCPU *cpu; CPUMIPSState *env; @@ -167,13 +165,11 @@ mips_mipssim_init(MachineState *machine) qemu_register_reset(main_cpu_reset, reset_info); =20 /* Allocate RAM. */ - memory_region_allocate_system_memory(ram, NULL, "mips_mipssim.ram", - ram_size); memory_region_init_ram(bios, NULL, "mips_mipssim.bios", BIOS_SIZE, &error_fatal); memory_region_set_readonly(bios, true); =20 - memory_region_add_subregion(address_space_mem, 0, ram); + memory_region_add_subregion(address_space_mem, 0, machine->ram); =20 /* Map the BIOS / boot exception handler. */ memory_region_add_subregion(address_space_mem, 0x1fc00000LL, bios); @@ -200,7 +196,7 @@ mips_mipssim_init(MachineState *machine) } =20 if (kernel_filename) { - loaderparams.ram_size =3D ram_size; + loaderparams.ram_size =3D machine->ram_size; loaderparams.kernel_filename =3D kernel_filename; loaderparams.kernel_cmdline =3D kernel_cmdline; loaderparams.initrd_filename =3D initrd_filename; @@ -245,6 +241,7 @@ static void mips_mipssim_machine_init(MachineClass *mc) #else mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("24Kf"); #endif + mc->default_ram_id =3D "mips_mipssim.ram"; } =20 DEFINE_MACHINE("mipssim", mips_mipssim_machine_init) --=20 2.7.4 From nobody Mon Feb 9 09:42:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1579889602; cv=none; d=zohomail.com; s=zohoarc; b=aEFQdO8EI64iLeXsnrJjTWHvQFk3dAOj8fFfv4f0pATXVAIyTX6rLs3pZD2llDXVyv7srETJltQdPxkGmSe9t9StxCYxlhBqZeLSVkMrFN3hTlPTL8PH8nFkENul4JasXHeQ5XdCfCKxJQARPt/LE4TlC0tf6N1dgz667nKwkJY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579889602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KQStTLlkCaEMtlzgV4XGnyR+hsKRTRpS96AJvUK8Hy4=; b=GY6UZXBXnr4maS/D3SwrYA02fOqgnJ/IwPPkQ+hqD1ML2KE0all5gvirk+ZxY9al5bRts2nu2mdPPTP33rTCePKxHY/jbdcaOHd43AhwS5rqaWkj+TjTfw3cqQg3pkb4bYYTKXKcyudDuawZ6OMR/0VAh4GmgkDpx71scwABXqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1579889602638594.0331478729121; Fri, 24 Jan 2020 10:13:22 -0800 (PST) Received: from localhost ([::1]:46150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3SL-0001BM-KR for importer@patchew.org; Fri, 24 Jan 2020 13:13:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35315) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv3NC-0000uT-Kx for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv3NB-0004xD-4A for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:02 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:46504 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv3NA-0004vF-U6 for qemu-devel@nongnu.org; Fri, 24 Jan 2020 13:08:01 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id D73321A2123; Fri, 24 Jan 2020 19:07:55 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.14.106]) by mail.rt-rk.com (Postfix) with ESMTPSA id B73661A2140; Fri, 24 Jan 2020 19:07:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL v2 7/7] mips/mips_r4k: use memdev for RAM Date: Fri, 24 Jan 2020 19:07:49 +0100 Message-Id: <1579889269-8122-8-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579889269-8122-1-git-send-email-aleksandar.markovic@rt-rk.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Igor Mammedov memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializing RAM memory region. Signed-off-by: Aleksandar Markovic Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1579779525-20065-57-git-send-email-imammedo@redhat.com> --- hw/mips/mips_r4k.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index fd926a3..69b6549 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -171,13 +171,11 @@ static const int sector_len =3D 32 * KiB; static void mips_r4k_init(MachineState *machine) { - ram_addr_t ram_size =3D machine->ram_size; const char *kernel_filename =3D machine->kernel_filename; const char *kernel_cmdline =3D machine->kernel_cmdline; const char *initrd_filename =3D machine->initrd_filename; char *filename; MemoryRegion *address_space_mem =3D get_system_memory(); - MemoryRegion *ram =3D g_new(MemoryRegion, 1); MemoryRegion *bios; MemoryRegion *iomem =3D g_new(MemoryRegion, 1); MemoryRegion *isa_io =3D g_new(MemoryRegion, 1); @@ -203,14 +201,12 @@ void mips_r4k_init(MachineState *machine) qemu_register_reset(main_cpu_reset, reset_info); =20 /* allocate RAM */ - if (ram_size > 256 * MiB) { + if (machine->ram_size > 256 * MiB) { error_report("Too much memory for this machine: %" PRId64 "MB," " maximum 256MB", ram_size / MiB); exit(1); } - memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_si= ze); - - memory_region_add_subregion(address_space_mem, 0, ram); + memory_region_add_subregion(address_space_mem, 0, machine->ram); =20 memory_region_init_io(iomem, NULL, &mips_qemu_ops, NULL, "mips-qemu", 0x10000); @@ -261,7 +257,7 @@ void mips_r4k_init(MachineState *machine) g_free(filename); =20 if (kernel_filename) { - loaderparams.ram_size =3D ram_size; + loaderparams.ram_size =3D machine->ram_size; loaderparams.kernel_filename =3D kernel_filename; loaderparams.kernel_cmdline =3D kernel_cmdline; loaderparams.initrd_filename =3D initrd_filename; @@ -316,7 +312,7 @@ static void mips_machine_init(MachineClass *mc) #else mc->default_cpu_type =3D MIPS_CPU_TYPE_NAME("24Kf"); #endif - + mc->default_ram_id =3D "mips_r4k.ram"; } =20 DEFINE_MACHINE("mips", mips_machine_init) --=20 2.7.4