From nobody Thu Nov 13 22:13:36 2025 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1582841063; cv=none; d=zohomail.com; s=zohoarc; b=P3YjjI1Sw88HAvkoWRVYi7oJZWxrWsM4CSDYdUhPPsbPRpaGFbmyXKQDo2Hmp31WYEljWotuebyDDw/Nc0WnHnsSzX3bdV2JKhI2iufxEOWWvrn6MvND91PUaxfFEqsWPH8oH/c+asb+THzyiv5u7entF5dZelaiXzpQarxAZKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582841063; 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=X9+GBaHNQ0BV0SNlMsqulSGS5MEkF+1c8Vya4T3i8EM=; b=R48+sHdmWAUIch2fTinsWzzqAqmHaCSpMDh/PKmbqjF1If8dgVQIy+tfxMWtjNRpwpxJWIEPvSZfUrTyEQyI4kyoa7yQ5452JNlAOmp4FN2bqkyhi0kLR7sKWHUeFDPR8Dz4SArr+IuBcCujyploC3dfEXa0GfJlx+IJfg/hnw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582841063872769.0838244454735; Thu, 27 Feb 2020 14:04:23 -0800 (PST) Received: from localhost ([::1]:39062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7RGY-0003pq-Hl for importer@patchew.org; Thu, 27 Feb 2020 17:04:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44977) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7REL-00019M-Bx for qemu-devel@nongnu.org; Thu, 27 Feb 2020 17:02:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7REK-0003lo-CF for qemu-devel@nongnu.org; Thu, 27 Feb 2020 17:02:05 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:33450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7REI-0003l2-Qa; Thu, 27 Feb 2020 17:02:04 -0500 Received: by mail-wm1-x341.google.com with SMTP id m10so7951060wmc.0; Thu, 27 Feb 2020 14:02:01 -0800 (PST) Received: from pavilion.home ([2a02:a456:6be8:1:8edc:d4ff:fe8b:18b7]) by smtp.gmail.com with ESMTPSA id z14sm6447040wrg.76.2020.02.27.14.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 14:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X9+GBaHNQ0BV0SNlMsqulSGS5MEkF+1c8Vya4T3i8EM=; b=Od/fXhruoZ+KNDek1dEp3DgjiZ7Jc8Rdwy868UZK4/3W9C7KW4Z0vVChI66+z8xEzv inwgiKQ8GNpwa1xhdTdI+kti2gFArlhqkymHnGoZ2xfKKTkYpv9YmYtQ8NEUkZ/rz9JG 9lUHgkhhuMFmNqq/C0rvzWiQsMYFLIdIFNbin9bbzdy/15o7R4dLP3PV6/2td21KkC6z Pg5z9p9Zb78iQpMNvTWyKlFVUEJ7u0GVriIUgD1z9OK5yVhHSS7jF+LAUyaAI7NGfcM8 f9d2mXgsOx/66upnquK0AADEMZQFcHxriKvs7jsWQZTXlNYtU0Im0O5aDBt3+iVI/mwQ A8hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=X9+GBaHNQ0BV0SNlMsqulSGS5MEkF+1c8Vya4T3i8EM=; b=djHcLIDLHqu2zfjykHB/9YgwpvCm8/AvmtjPcEwa2Ef0CUmXFDSp5wiWUVS2cDyvZ+ hFPZujWi+s7jcWmFqVq+q+i7o+Rrtik1/swX9Sddzwbv2GIuc/TeBtebu812peoUDWZA 36IE2C/LEZ3SlzfPQYma2qQAUsS7iQjDS7sPmvPoMlSDkYlmhiyp6nfTunsIuXjQE37F I1wV10+AU8bWo+IQLJkGXLQNCm4IX27u5PQWVqyN1bEz4US3DJztNs839bJTqJcKkOpJ lg+8PjC+B/Pcw2RsEviXdMHOai8WybJmKMKQiE2m4hf4B77cLY+KpuGU9fCDqztfw11s s38A== X-Gm-Message-State: APjAAAWg5lAJJFupRRAfHiqo6tL7l2IxX+KzK90do5QqEzyMGQ5WAcg1 01WobWH0fahTh/nhf12n2IxWpgl9 X-Google-Smtp-Source: APXvYqwe42sb+ZKZGLY26XotBL8q4ddr8tW04GigjZILwequ+7KfPdW0F3YJHoEw8qMLIlSpkl70Jg== X-Received: by 2002:a1c:8197:: with SMTP id c145mr833224wmd.176.1582840918868; Thu, 27 Feb 2020 14:01:58 -0800 (PST) From: Niek Linnenbank To: qemu-devel@nongnu.org Subject: [PATCH v1 3/4] hw/arm/cubieboard: restrict allowed RAM size to 512MiB and 1GiB Date: Thu, 27 Feb 2020 23:01:48 +0100 Message-Id: <20200227220149.6845-4-nieklinnenbank@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227220149.6845-1-nieklinnenbank@gmail.com> References: <20200227220149.6845-1-nieklinnenbank@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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: b.galvani@gmail.com, peter.maydell@linaro.org, Niek Linnenbank , qemu-arm@nongnu.org, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The Cubieboard contains either 512MiB or 1GiB of onboard RAM [1]. Prevent changing RAM to a different size which could break user programs. [1] http://linux-sunxi.org/Cubieboard Signed-off-by: Niek Linnenbank Reviewed-by: Peter Maydell --- hw/arm/cubieboard.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index 010375f0a8..6c55d9056f 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -33,6 +33,13 @@ static void cubieboard_init(MachineState *machine) AwA10State *a10; Error *err =3D NULL; =20 + /* This board has fixed size RAM (512MiB or 1GiB) */ + if (machine->ram_size !=3D 512 * MiB && + machine->ram_size !=3D 1 * GiB) { + error_report("This machine can only be used with 512MiB or 1GiB RA= M"); + exit(1); + } + /* Only allow Cortex-A8 for this board */ if (strcmp(machine->cpu_type, ARM_CPU_TYPE_NAME("cortex-a8")) !=3D 0) { error_report("This board can only be used with cortex-a8 CPU"); @@ -78,6 +85,7 @@ static void cubieboard_machine_init(MachineClass *mc) { mc->desc =3D "cubietech cubieboard (Cortex-A8)"; mc->default_cpu_type =3D ARM_CPU_TYPE_NAME("cortex-a8"); + mc->default_ram_size =3D 1 * GiB; mc->init =3D cubieboard_init; mc->block_default_type =3D IF_IDE; mc->units_per_default_bus =3D 1; --=20 2.17.1