From patchwork Thu Nov 2 01:30:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 740401 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp596386wrv; Wed, 1 Nov 2023 18:42:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH21xFSamHrFhbaYhEmFVCNPD4zCAxZAwaGwGxJu+VMnPzeGimgXOJDnDCDD63XHGul8v59 X-Received: by 2002:ad4:5747:0:b0:63d:3bea:f663 with SMTP id q7-20020ad45747000000b0063d3beaf663mr23302349qvx.47.1698889361378; Wed, 01 Nov 2023 18:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698889361; cv=none; d=google.com; s=arc-20160816; b=0/jG8c3HV//po9GKPDUSiVry1aEXZmvhCgpDud1zuPuwDbxEN7uc5Rp2pE/A5G2eah 5uDFlk3/Mqo+EWqAluMfGY4E9I1XufT+0dWs8xkflFysFS4jEVhmOB3TeyFPqHPxy2sF JOcBTRSwA1RKLzgb0ReO+LZLCt3djbhM3+PAXOyH2sSRsC8ZhAyo/vqhD1g4lmH89JWL 8XoeNB6QxgipPCOnH5W5VQPJHv4+Cne54xLvMDpXkVMIUElSLkjTLyyZwJaw/KeNDiii mHKDf3ECUEMTs6uwqUEKW34lmFmC5BKXwrZ7CzHpufNTgFNsZIjGnRqyeCNTFUaoDM/a uZIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; fh=f2WZoDMBYjCKWIIOoPI+rQtxlv4fmOm4u+dLdQLqpOk=; b=oCRw80aALpkB7f9niQdMj71g6OB9f+xgluY0mFwOv3T2lon41aqTcrft7f14C24PJQ 7QulVuIucTlpFVxUQIe0+E9T+qJP31kVaj3k13H5I1FPJAuo8nPylbnUOwd8N+FBykH8 uU8D3wHz2+oGrhOpNakhrHJswEbK6zVTgwkETfAVXalMANoQl2Fu6DtQmkADZpvkKCPP 6SJErdCpGyilEeJC1qQ9o5DcFQFTdhukf4N9g4lp1oUhv9uVsNYUXKSB/RRKBeu842Yl TxXxocZZjP0ktcwzH1W1K8T5nGxuFe7v5hA4XCdnNnwl59cnzLBshsqytX/j6wtwh7TA G06A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2mceh4a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u12-20020a0562140b0c00b0066d1ca1cb7asi3423236qvj.405.2023.11.01.18.42.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2023 18:42:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n2mceh4a; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyMeU-00076f-Fc; Wed, 01 Nov 2023 21:37:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyMeO-0006U5-D8 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyMeM-0004MV-67 for qemu-devel@nongnu.org; Wed, 01 Nov 2023 21:37:36 -0400 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3b2f28caab9so262958b6e.1 for ; Wed, 01 Nov 2023 18:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698889051; x=1699493851; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; b=n2mceh4asuF27q/XfGBMLcAaZTPockRpNdCAXXKJR+S5GnF8DFiPUBorrYzTgspWI3 igH0OI/xqE0dzNNw9o2Bnd5r2MsPCgYy0z/2NhzmYJP1jRQhUdHg1oUP+mzu+fWrMhU8 kcjl48Qtq1/q4+7kRXTngJJPKjZoZuQsJayMPEQQR87r0T9mN6JUiQDJTyHC5E4XBaS1 U70YONDs2qo0+J3RK/JHv9kODodHhT8sJFesRs9ujPMR1EIIjeHzEelWfd1qSC7rhmUN cwj2IZgaUJDeyOfcafvDds8O4h1eKAklI29TZfoYI0zoV1iPp7lWXgy+YyqBOoUtRQiG JiJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698889051; x=1699493851; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LIgodu9H6MNqcm2FpnHbkFw215Q/P+nlqcEfUhnn984=; b=Nv6m3TUIJsbSWn3LCex/5HGVcKsArdnqAJiKgInsedQMWDgW2F/SGZaA0rYtCW+4ZE aEzlstNi6MvYYeX/Ys2P2+PqQ/PJjQuIPYKIH99gXaNjMGP8rZ6kdHYdD3adqadZ7/ey VjBgLlWgHqa1dqcTEkg4W+UKH+Pd7AmjTayG4s7ZTgPTBFAbSyUTHL6POpKghY8QHOw0 2KD+L+Eyia5q5jHXGfjS0SBVCIjjIDdSvznx2hF4MppiSEl7ooMEkPDAfsebB7MA6Ql4 nlpP6FpKIeOf5jpuWn+L/qE6ic4FP29p6+0pI2edNTrmihTtxzopWM0alduv3i3CdY1Q LKBQ== X-Gm-Message-State: AOJu0YzWlF4Wr/rdiy+HDO6ClPGIXEHVtZjkBt1h9S0Ui/87i4/lXGLj UwnbMtlcSCdRz8GiZ07s+9CAI+RoZNvayvlMSz0= X-Received: by 2002:a05:6808:10c8:b0:3ae:251b:5552 with SMTP id s8-20020a05680810c800b003ae251b5552mr23179902ois.12.1698889051341; Wed, 01 Nov 2023 18:37:31 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id v20-20020aa78514000000b006934e7ceb79sm1800230pfn.32.2023.11.01.18.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 18:37:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v3 87/88] hw/hppa: Allow C3700 with 64-bit and B160L with 32-bit CPU only Date: Wed, 1 Nov 2023 18:30:15 -0700 Message-Id: <20231102013016.369010-88-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102013016.369010-1-richard.henderson@linaro.org> References: <20231102013016.369010-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Helge Deller Prevent that users try to boot a 64-bit only C3700 machine with a 32-bit CPU, and to boot a 32-bit only B160L machine with a 64-bit CPU. Signed-off-by: Helge Deller --- hw/hppa/machine.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index da9ca85806..a3222d3a96 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -528,6 +528,12 @@ static void machine_HP_B160L_init(MachineState *machine) /* Create CPUs and RAM. */ translate = machine_HP_common_init_cpus(machine); + if (hppa_is_pa20(&cpu[0]->env)) { + error_report("The HP B160L workstation requires a 32-bit " + "CPU. Use '-machine C3700' instead."); + exit(1); + } + /* Init Lasi chip */ lasi_dev = DEVICE(lasi_init()); memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA), @@ -602,6 +608,12 @@ static void machine_HP_C3700_init(MachineState *machine) /* Create CPUs and RAM. */ translate = machine_HP_common_init_cpus(machine); + if (!hppa_is_pa20(&cpu[0]->env)) { + error_report("The HP C3000 workstation requires a 64-bit CPU. " + "Use '-machine B160L' instead."); + exit(1); + } + /* Init Astro and the Elroys (PCI host bus chips). */ astro = astro_init(); astro_dev = DEVICE(astro); @@ -659,6 +671,11 @@ static void hppa_nmi(NMIState *n, int cpu_index, Error **errp) } } +static const char *HP_B160L_machine_valid_cpu_types[] = { + TYPE_HPPA_CPU, + NULL +}; + static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -666,6 +683,7 @@ static void HP_B160L_machine_init_class_init(ObjectClass *oc, void *data) mc->desc = "HP B160L workstation"; mc->default_cpu_type = TYPE_HPPA_CPU; + mc->valid_cpu_types = HP_B160L_machine_valid_cpu_types; mc->init = machine_HP_B160L_init; mc->reset = hppa_machine_reset; mc->block_default_type = IF_SCSI; @@ -690,6 +708,11 @@ static const TypeInfo HP_B160L_machine_init_typeinfo = { }, }; +static const char *HP_C3700_machine_valid_cpu_types[] = { + TYPE_HPPA64_CPU, + NULL +}; + static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -697,6 +720,7 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, void *data) mc->desc = "HP C3700 workstation"; mc->default_cpu_type = TYPE_HPPA64_CPU; + mc->valid_cpu_types = HP_C3700_machine_valid_cpu_types; mc->init = machine_HP_C3700_init; mc->reset = hppa_machine_reset; mc->block_default_type = IF_SCSI;