From nobody Mon Feb 9 10:01:18 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=1579887719; cv=none; d=zohomail.com; s=zohoarc; b=NC7Z5K4hlsL8ExvkhOAM39e0AgFzWQp3Q5SiTFEUhPQB8Td//FT83vpaGh5gzkEDZNLCvey9n2mFXEoV7qEUCAMc0VRbGUfLxo6LGetT+M45yvgF07U/bKtXPc1mulqPZjdrI/zwx5Q+pbLMsd51d5itZeYhletTXJsBXPwRdA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887719; 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=cpMU+sMTuRf9CBiBtIDBlMa+iRaJNJHCLPIyteuRrad76D8X1Qqpj6Hv41T0pxML6r4xAhj3mp1TtTLEt4jW790c5vdhQH6gB1+VB7y+rC56+my+Qe5hu46Q0/McHzN2G7ghWR/Ta+rjBIrt9Bdt5NVKE3nm+ktSfaZk5zLZhRE= 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 1579887719798918.7094145452772; Fri, 24 Jan 2020 09:41:59 -0800 (PST) Received: from localhost ([::1]:45842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2xy-0005MN-Mb for importer@patchew.org; Fri, 24 Jan 2020 12:41:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57107) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x2-0003fK-TS for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x1-0001gy-J8 for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:00 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38456 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 1iv2x1-0001ei-Bc for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:40:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 76D561A2134; Fri, 24 Jan 2020 18:40: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 5052B1A212D; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 1/7] target/mips: Rectify documentation on deprecating r4k machine Date: Fri, 24 Jan 2020 18:40:40 +0100 Message-Id: <1579887646-5949-2-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 10:01:18 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=1579887792; cv=none; d=zohomail.com; s=zohoarc; b=k1Wfx7lJl2y7wQNYqZq7RQBm9xqdViFZpZZQyrG2bfwkQeg53g4nIVzMqmS0yj2eANfswnlXNNRu7TZi8zAF0PpzlTj9mfZVC6W4FSdS2Sx/KS46JgKxU/YqjgB38QyjDbPYkvSOcfTDn9Eb64lEJ92pkccKEjVXgnmtM1qjpEw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887792; 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=cCWepJAM0LnI5PGybF/GdizWkvN/QILt/rhA0m4pYhacoDCxboUVaZPKFirs7wXuNo6OrScXSNKEMo8yYZFwH9/GptJXdae/aBPqU5aEmBAt5YjZdXPtvFXStbKiDPMMORB3ofs6zDcj8DqLyxU/T4gU/1KqTUExroTqBzoq4Gc= 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 1579887792604773.2080860660352; Fri, 24 Jan 2020 09:43:12 -0800 (PST) Received: from localhost ([::1]:45858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2z9-00081a-7Z for importer@patchew.org; Fri, 24 Jan 2020 12:43:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57128) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x3-0003fO-En for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x1-0001gu-Iv for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38461 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 1iv2x1-0001el-Bb for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:40:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 79E411A214F; Fri, 24 Jan 2020 18:40: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 58A931A212E; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 2/7] disas: Add a field for target-dependant data Date: Fri, 24 Jan 2020 18:40:41 +0100 Message-Id: <1579887646-5949-3-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 10:01:18 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=1579887717; cv=none; d=zohomail.com; s=zohoarc; b=UqLqC9nqR9GdaAV7uFtzn+qPkPDB4P8sqGSK8k+aJlpb1A6Ijelsap5h4bwE7c3VRxbHnpIWkr/ZDZe1x8GCycljeNBh7SRoJLeuDHlaqQ5NcVZDjjgAYqQstYiSTtcPnjIW68WhR+K5N7YKdZN96tmp2fHwVNFvvsTzuunqca4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887717; 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=fJTeWySs7jls7yPHoxfJEk49N6R7xVYTPt6M795bLiE=; b=N/j7dbtFWDoglvg4f4jtTEjWkjGGoZkrQqcweb1t+qql0TrNP9oD0MGFg9WlothwUq2H3aZhe8ggRxYZQLvVtwEBZZzad7HUy5nwM2JWIYHJWDd8mtrHTYG98UzR6jnSQBpcQY69tmUmPLnG5wGMiTyITlSfMZl/jooqEd09HOE= 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 1579887717090303.6231472734901; Fri, 24 Jan 2020 09:41:57 -0800 (PST) Received: from localhost ([::1]:45836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2xv-0005CY-7R for importer@patchew.org; Fri, 24 Jan 2020 12:41:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57118) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x3-0003fM-89 for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x1-0001hD-Mm for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38458 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 1iv2x1-0001ek-Ba for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:40:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 92B961A212D; Fri, 24 Jan 2020 18:40: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 5F58A1A2131; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Date: Fri, 24 Jan 2020 18:40:42 +0100 Message-Id: <1579887646-5949-4-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 Signed-off-by: Daniel Henrique Barboza Reviewed-by: Aleksandar Markovic 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 10:01:18 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=1579887719; cv=none; d=zohomail.com; s=zohoarc; b=LmO7JFoHamYfKpOhGklSDJwbXBtSlG9wkoM9zbh3TPHJTrDaBUdpRQAlK8eZ2FP88sNadyeiwM7VZlsW800y+kWF6ljgIHcGEaFzTvedgkYV02a73PTW8hhWK2l7FKG/8/8ekd2YmPhy2Xgyu3pbz3WeW5EzZsu1jeXWVo3j254= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887719; 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=nAoDOY8dyZScfx/VKxkv/jXDIXe/skkRtsMalAI4nt0EtzMvnuWdFqwtn+JGwacDj7vQwwZ3ZXlD2C1Uqj7jw01a9yKJQBKufuK5W0HgqdEoTegOIIrkW2uDxH/VlRo9G3RQyk3gjnyI6GlUc4rOTi1HW6S1iOCDhJFjmzLiBdM= 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 1579887719367981.2962018251434; Fri, 24 Jan 2020 09:41:59 -0800 (PST) Received: from localhost ([::1]:45840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2xy-0005KS-38 for importer@patchew.org; Fri, 24 Jan 2020 12:41:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x3-0003fP-SJ for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x2-0001ho-Qd for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:01 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38470 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 1iv2x2-0001hH-JD for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id A45811A2158; Fri, 24 Jan 2020 18:40: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 680641A2140; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 4/7] mips/mips_jazz: use memdev for RAM Date: Fri, 24 Jan 2020 18:40:43 +0100 Message-Id: <1579887646-5949-5-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 10:01:18 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=1579887717; cv=none; d=zohomail.com; s=zohoarc; b=jIp6BjTV7+Gi899Q23WXFY3wfm7dIM/SLSpvpT0K20NBNFQIV/t3I0B+1oHHSsGmZJsZ6IMOyJqvHN69rpRW+BJVUmdRzubFcMCzlVmhvoTNjaX4W6mN6iJgqZ7aOmCCbenU9ky7MZ6KZOZIRmgIIbNXCh4UQ5UiXCZQZeR6qZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887717; 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=KviECjFokdvx8pmOaIT0S/POCWHX957i4Pf2k1cL60AOnQCEqf3MC0nMtE1CyChdEELNHtVd/FOOp3EOjDIJ/eQRKFbWK+oXwOUCSCgN7X3AAR1aKMGtLPZWKrxu28M/wV5V3NaAMDW42sIuwcfmZagd34x7cxJSQR6Yb3+to18= 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 1579887717005302.6872995193636; Fri, 24 Jan 2020 09:41:57 -0800 (PST) Received: from localhost ([::1]:45838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2xv-0005Dr-IK for importer@patchew.org; Fri, 24 Jan 2020 12:41:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57106) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x2-0003fJ-QI for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x1-0001gk-Gq for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:00 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38462 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 1iv2x1-0001em-9U for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:40:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id A31FA1A2131; Fri, 24 Jan 2020 18:40: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 729BA1A2126; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 5/7] mips/mips_malta: use memdev for RAM Date: Fri, 24 Jan 2020 18:40:44 +0100 Message-Id: <1579887646-5949-6-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 10:01:18 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=1579887867; cv=none; d=zohomail.com; s=zohoarc; b=OX3jhVR6quCyZ2+vGQIXk7E/Y1PG9aP7Otvzj/Igk3XK7IjATFeeEvRcbcrYEUe4otU2PXJqcg94tI65jEVoNhZI62SCfHTaWKclQdfTclzG7N7cBvNX9vPAqaUSCxPaRYpgu942/9S+7wqaYMVTRo9CTmFRi28Vd5EN6DXEym0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887867; 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=eiMzMsUV++JdEYzN3GffJZJybHSW24vm3Qa9x1TRFn0kBqoHHrE0mlVFrU8ecfdXkbBmtu+y4v417a35O/2I+dqRKGYOeTLbfLrAndw5Ju0wpAh8RFVJkfu5Hrm90LsRTPcYDYVzuhk8RWZR82nSfVJhrPDb30UySho163ozdck= 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 1579887867978795.8704613333084; Fri, 24 Jan 2020 09:44:27 -0800 (PST) Received: from localhost ([::1]:45872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv30M-0001OB-Sn for importer@patchew.org; Fri, 24 Jan 2020 12:44:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x4-0003fZ-2k for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x2-0001hz-Sh for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:02 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38469 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 1iv2x2-0001hI-Km for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id A9B8D1A2126; Fri, 24 Jan 2020 18:40: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 7AF311A2152; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 6/7] mips/mips_mipssim: use memdev for RAM Date: Fri, 24 Jan 2020 18:40:45 +0100 Message-Id: <1579887646-5949-7-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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 10:01:18 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=1579887866; cv=none; d=zohomail.com; s=zohoarc; b=BBJbsssGQJsRE06CgNJ7K1Dk/em0Wyx2q8tolB9vUueyLt43KjdRUdTUy8+rM+rCzDMD45uzhgo9RNfH6AYwL6fYcNv/2aknGcgYqj9PJ7PJI2zpLTfEkobRKJ8b5MZrOqk1vLiva6bPn0t5rMr7jxcAj4TT0Z2U2GPfnraIwH4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579887866; 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=SPg6QriCGtSU6+1Vbh5EqvDy8BkkkQeCDYY2l7Oi5vMQrELOo54PkRveejgekafWDZK6qDodE5YME5B4N4qDrS5usI48J//0uT8TzeX8Sjpr7EN4DTyhL2uu4omKVD2JQk7NuSIoe17zqOKKlXi6o3WHPPCH+fWoZYLtnWGjTjo= 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 1579887866749845.0630223926672; Fri, 24 Jan 2020 09:44:26 -0800 (PST) Received: from localhost ([::1]:45870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv30L-0001Mw-OL for importer@patchew.org; Fri, 24 Jan 2020 12:44:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57156) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv2x4-0003fg-6d for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv2x2-0001i5-TX for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:02 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:38471 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 1iv2x2-0001hL-Ma for qemu-devel@nongnu.org; Fri, 24 Jan 2020 12:41:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id B16541A2140; Fri, 24 Jan 2020 18:40: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 8D75C1A212E; Fri, 24 Jan 2020 18:40:55 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Subject: [PULL 7/7] mips/mips_r4k: use memdev for RAM Date: Fri, 24 Jan 2020 18:40:46 +0100 Message-Id: <1579887646-5949-8-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1579887646-5949-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1579887646-5949-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