From nobody Sun Nov 24 20:25:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1720707592; cv=none; d=zohomail.com; s=zohoarc; b=hkGlvUMVStiPYeCdtCsHejBjLOYjhd4F0L9TX+gDV6of2FMfjspYTUhDHAyEF9mg2VY2LLn1ycr34ThRb3YxsHild2E2RUrq730bep/WDodHLifQKDx71KOlIKBl/IhqW1gDNdCY0DOG/d4zh7to61DmGQi0LlUyEjryi+8WhiE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720707592; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=E8FfYVZLhfQmqykNToV7464fETgc8v1WopuhnlmN23k=; b=DOZmZdF4bJVekVMBXtwK+yT2fmFeKvhFwz3/l3tHMuVwPaifd6LD3dNKlIWnrZoWmVK3MSLiIw5WOvO9yXN5WIgWakx6k/4eFh+XeB/OeNsg18SmLy00EleG5y7ABh7ykJpANKm05lvN+clCUpGiiPw8bD2kZAbKnfK5VveozKs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720707592341283.00833442345913; Thu, 11 Jul 2024 07:19:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRudv-0003pB-5L; Thu, 11 Jul 2024 10:19:31 -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 1sRuds-0003hs-PT; Thu, 11 Jul 2024 10:19:28 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sRudr-0005UD-1X; Thu, 11 Jul 2024 10:19:28 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-70af0684c2bso743685b3a.0; Thu, 11 Jul 2024 07:19:26 -0700 (PDT) Received: from wheely.local0.net ([203.220.44.216]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b54ec730fsm3308904b3a.173.2024.07.11.07.19.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jul 2024 07:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720707565; x=1721312365; 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=E8FfYVZLhfQmqykNToV7464fETgc8v1WopuhnlmN23k=; b=gzNOIcNZD0Go/3ejyaBzMrwe1/vnoH1imM/TER8RxMlerDqQzSH0ksfZeTsLFijlge epV14ZGFRdekCHAHPdrmOJlA/P/cSRsTBg8kMp6z2164I2vRzgSXzv7QPcXxCkg902FQ 9RUSHm1hOfEJNpwkOoe0ZrySkd9pUJ1AA/TzWuO7d1ZCc3sjGy/y8gsJdXT9+vSUpIyT 4p07hSSFHl+nhgUwTVZTyx/elBREeoFbI27zuE2vq0fxMU8jOX690cWtNodQyfR6svzR H4+ivlNqkznMWsGSvf5I94+Yf3VdgmX20cir18prMb/HqKej3XhV1qatvLBMXBBVwrW1 oeXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720707565; x=1721312365; 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=E8FfYVZLhfQmqykNToV7464fETgc8v1WopuhnlmN23k=; b=G48fwlePKN14g37CxfEMXKXsI3q4cexgb2vwoBTvNXlWSaoPY1fbYOkpowSBLZCjvU Mx1IlnjGlazpVvS0SlR5fhmWzFsDkF6TeANvJxzk87vAOeZC6nHQmNN9LF9Imo+AWHEg nab5shjj8dGXTq++8b617ZpXvPsaIGl8+zoAn86wkhmR0glrSy9n0F/lkMmaktxjmFGN UXMb8SOWKdxY+fzyegF8I01xmmVedhYQucKKNS/r31O6Ow9IK/3TW9ED2vTqnVOWaoZJ 4YbH+JIe9XgoCLumr5o6AOp7bl9qwZoS6XoeCyE/j2U3hI99ttZ16nmwNy3c/NRn3ccY NE5g== X-Forwarded-Encrypted: i=1; AJvYcCWPSCNUGcGRaaWZmCeAGXkyssU1hEkS2rx9xNNZ3uIKPbAwvpV1myKyHd8XX42M2HJFBfokx3sgvbix/vYRDxAGj+JK6FM= X-Gm-Message-State: AOJu0Yz4MjITyCbW5+Ho2r/T6USkC5nbNIH90fvHFT1uNMVJwCBRiWg2 MDIOT0x27rhE6AkNGHll2YRnk/ASBDhuSAimsMXQ6SUOhyuDw+Mh7DkkP0ft X-Google-Smtp-Source: AGHT+IEmhuqmMLysUrr4i8UMZ8S/BOJHlLE1G5ubnC9v6rwXi6K4QXnamm6hLHOMQy5ctPrhqO2qJg== X-Received: by 2002:a05:6a21:680d:b0:1c2:8fd1:a47d with SMTP id adf61e73a8af0-1c29820396amr9982671637.6.1720707564671; Thu, 11 Jul 2024 07:19:24 -0700 (PDT) From: Nicholas Piggin To: qemu-ppc@nongnu.org Cc: Nicholas Piggin , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Harsh Prateek Bora , qemu-devel@nongnu.org Subject: [PATCH 06/18] ppc/pnv: specialise init for powernv8/9/10 machines Date: Fri, 12 Jul 2024 00:18:38 +1000 Message-ID: <20240711141851.406677-7-npiggin@gmail.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240711141851.406677-1-npiggin@gmail.com> References: <20240711141851.406677-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=npiggin@gmail.com; helo=mail-pf1-x432.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1720707594308116600 Content-Type: text/plain; charset="utf-8" This will allow different settings and checks for different machine types with later changes. Reviewed-by: Harsh Prateek Bora Signed-off-by: Nicholas Piggin Reviewed-by: C=C3=A9dric Le Goater --- include/hw/ppc/pnv.h | 1 + hw/ppc/pnv.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 476b136146..1993dededf 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -76,6 +76,7 @@ struct PnvMachineClass { /*< public >*/ const char *compat; int compat_size; + int max_smt_threads; =20 void (*dt_power_mgt)(PnvMachineState *pnv, void *fdt); void (*i2c_init)(PnvMachineState *pnv); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 3bcf11984c..4252bcd28d 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -899,6 +899,7 @@ static void pnv_init(MachineState *machine) PnvMachineState *pnv =3D PNV_MACHINE(machine); MachineClass *mc =3D MACHINE_GET_CLASS(machine); PnvMachineClass *pmc =3D PNV_MACHINE_GET_CLASS(machine); + int max_smt_threads =3D pmc->max_smt_threads; char *fw_filename; long fw_size; uint64_t chip_ram_start =3D 0; @@ -997,17 +998,19 @@ static void pnv_init(MachineState *machine) pnv->num_chips =3D machine->smp.max_cpus / (machine->smp.cores * machine->smp.threads= ); =20 - if (machine->smp.threads > 8) { - error_report("Cannot support more than 8 threads/core " - "on a powernv machine"); + if (machine->smp.threads > max_smt_threads) { + error_report("Cannot support more than %d threads/core " + "on %s machine", max_smt_threads, mc->desc); exit(1); } + if (!is_power_of_2(machine->smp.threads)) { error_report("Cannot support %d threads/core on a powernv" "machine because it must be a power of 2", machine->smp.threads); exit(1); } + /* * TODO: should we decide on how many chips we can create based * on #cores and Venice vs. Murano vs. Naples chip type etc..., @@ -2491,6 +2494,7 @@ static void pnv_machine_power8_class_init(ObjectClass= *oc, void *data) =20 pmc->compat =3D compat; pmc->compat_size =3D sizeof(compat); + pmc->max_smt_threads =3D 8; =20 machine_class_allow_dynamic_sysbus_dev(mc, TYPE_PNV_PHB); } @@ -2515,6 +2519,7 @@ static void pnv_machine_power9_class_init(ObjectClass= *oc, void *data) =20 pmc->compat =3D compat; pmc->compat_size =3D sizeof(compat); + pmc->max_smt_threads =3D 4; pmc->dt_power_mgt =3D pnv_dt_power_mgt; =20 machine_class_allow_dynamic_sysbus_dev(mc, TYPE_PNV_PHB); @@ -2539,6 +2544,7 @@ static void pnv_machine_p10_common_class_init(ObjectC= lass *oc, void *data) =20 pmc->compat =3D compat; pmc->compat_size =3D sizeof(compat); + pmc->max_smt_threads =3D 4; pmc->dt_power_mgt =3D pnv_dt_power_mgt; =20 xfc->match_nvt =3D pnv10_xive_match_nvt; --=20 2.45.1