From nobody Wed Feb 11 00:52:38 2026 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=1707477139; cv=none; d=zohomail.com; s=zohoarc; b=R9XtbttQjBaSa27GEMEhdJ9EhRusiEWjBPmvctJtaPMyA9aVWKn6IB/JkOYjWPYOqdZTNpwVEVGAJ2Ze0cL5zxx9l6yTI2h9hJsWpEbQ0OWegbK1c5IwQuNdUZ49XWC5sxbl6y6036nXnW0Fr5GyV57fQedUqqwj3/W5DzDpfC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707477139; 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=MuMOQMPstt+t/BCplSjk2Zw5tvEo5gDeByiMj5qhz2A=; b=JBqTBuhxydIkr9E8JoGn6/yXs5ZHb3AReJNQ//5WxPHFzby2wbsPTjFr6Q8VWFx9utXjTApOBECTqYDTbID0SOQC9w/8MdwEajt5lRC3IsdQbN7wxJIlnbYRIvkqUpJa3tyegseTAUZ+l0H2G8aI9t8h4CFgClhz7mGfClT3pvw= 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 170747713942643.28536190944624; Fri, 9 Feb 2024 03:12:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYOgX-0003Bh-D7; Fri, 09 Feb 2024 06:04:45 -0500 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 1rYOdU-0007Yp-VJ for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:01:42 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYOdK-0000se-Uf for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:01:35 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5dbf7b74402so534354a12.0 for ; Fri, 09 Feb 2024 03:01:26 -0800 (PST) Received: from toolbox.alistair23.me (2403-580b-97e8-0-321-6fb2-58f1-a1b1.ip6.aussiebb.net. [2403:580b:97e8:0:321:6fb2:58f1:a1b1]) by smtp.gmail.com with ESMTPSA id d20-20020a637354000000b005d3bae243bbsm1473623pgn.4.2024.02.09.03.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 03:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707476485; x=1708081285; 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=MuMOQMPstt+t/BCplSjk2Zw5tvEo5gDeByiMj5qhz2A=; b=mxapqQatxETrN4aVT9UJ2IAcrR/4YwmDybmTq+W4YuFta1/8W9TpA+ltVyxlKpXx9F 11qhLimcYwqFjOr9UN+Hq5x5ebB8AEJP7sc1G0kEGQHg0wecSrahCX2ofPLUzZJBEpZu HeCn3heSrkypfXh1UpVGvfNohA01o21POPvOF8MEzeft+76ZXB0Ni/FEFcYq0iyvK0H9 P3MTdUf15mWbuKteqdpAcHrdkzaPjZAlcZ1whJqdZUHmXYhLfdc0x81s8sBX2VPTCr3l cJV4FEUizVDl/r/NYmniaiY8fUq8Ra8YDWpjl4vdiEL3sToqjQfOZsNViGOo35NCcsFh BAzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707476485; x=1708081285; 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=MuMOQMPstt+t/BCplSjk2Zw5tvEo5gDeByiMj5qhz2A=; b=YORaEBKg2IpCb5LlLY0Uvgx76kjuZrqJ7sfjyz109KjElBN03nY3laps7ALaCYdLTD ueMXjbaI77jhSIFpezlq0nPf5c3SEz6kGNOUD/aikC4jf6MIeJkS5E9PBPT1TiOXFjnv 0ObUv93rh3ZOqq5KOIG+KEhvm9HniZ6wEmqPwh4N1d/vZbT4HNskwckb+0KPaWYDe+9c /aBS5LP5Gik3OZTC5uOTr/Tl829b21jZAKt1MA2Kfz75hWGPFTIYGzBgg3ogFoVSESUC D2y/2XR4gRE+dMxQMZej5cRMcObZtC8nH0SIQQtMseUgCnwQdxBl5AYiDPJONMGzpRC/ cCpg== X-Gm-Message-State: AOJu0Yy7F7uA55CvgOjRLJ1wN+Ry/b9iqqnWvSKA8KSNLhBsCCt0BWnq fHyOT1iEGV8j6Vh1kSXWBcFD1Ya/bduGhg0hp4uc1MmsYrVu4fDQLHY3z8OEJIRwKw== X-Google-Smtp-Source: AGHT+IF4qUSWNK3wS++oOkl/YWF9QcuPAXSpYIIK4FNx8ojstNzkSxTJmbam2m9jkXBuwJV57eduWA== X-Received: by 2002:a17:90a:3187:b0:296:1ddc:d46a with SMTP id j7-20020a17090a318700b002961ddcd46amr1079262pjb.39.1707476485238; Fri, 09 Feb 2024 03:01:25 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXRseWg8oBdDML+mvL0p9VoERjqc2ctTffucg6ahlXvrRYxwJ9x6RBVCJDI6WmC6qCVZdPrC7NyPuTMlitOjcscQZuKJowKWp2yUJMqD9bxf4h8JFRm83RBEZJnfLhy87VLLgKlcLaBAPcogJcNfMBXrZr1rk67n4+jDsivs9HXBTc4HH8= From: Alistair Francis X-Google-Original-From: Alistair Francis To: qemu-devel@nongnu.org Cc: alistair23@gmail.com, Heinrich Schuchardt , Alistair Francis , Andrew Jones Subject: [PULL 55/61] smbios: add processor-family option Date: Fri, 9 Feb 2024 20:58:07 +1000 Message-ID: <20240209105813.3590056-56-alistair.francis@wdc.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209105813.3590056-1-alistair.francis@wdc.com> References: <20240209105813.3590056-1-alistair.francis@wdc.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::532; envelope-from=alistair23@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1707477141070100010 Content-Type: text/plain; charset="utf-8" From: Heinrich Schuchardt For RISC-V the SMBIOS standard requires specific values of the processor family value depending on the bitness of the CPU. Add a processor-family option for SMBIOS table 4. The value of processor-family may exceed 255 and therefore must be provided in the Processor Family 2 field. Set the Processor Family field to 0xFE which signals that the Processor Family 2 is used. Signed-off-by: Heinrich Schuchardt Reviewed-by: Alistair Francis Reviewed-by: Andrew Jones Message-ID: <20240123184229.10415-2-heinrich.schuchardt@canonical.com> Signed-off-by: Alistair Francis --- hw/smbios/smbios.c | 13 +++++++++++-- qemu-options.hx | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index 2a90601ac5..647bc6d603 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -102,6 +102,7 @@ static struct { #define DEFAULT_CPU_SPEED 2000 =20 static struct { + uint16_t processor_family; const char *sock_pfx, *manufacturer, *version, *serial, *asset, *part; uint64_t max_speed; uint64_t current_speed; @@ -110,6 +111,7 @@ static struct { .max_speed =3D DEFAULT_CPU_SPEED, .current_speed =3D DEFAULT_CPU_SPEED, .processor_id =3D 0, + .processor_family =3D 0x01, /* Other */ }; =20 struct type8_instance { @@ -337,6 +339,10 @@ static const QemuOptDesc qemu_smbios_type4_opts[] =3D { .name =3D "part", .type =3D QEMU_OPT_STRING, .help =3D "part number", + }, { + .name =3D "processor-family", + .type =3D QEMU_OPT_NUMBER, + .help =3D "processor family", }, { .name =3D "processor-id", .type =3D QEMU_OPT_NUMBER, @@ -726,7 +732,7 @@ static void smbios_build_type_4_table(MachineState *ms,= unsigned instance) snprintf(sock_str, sizeof(sock_str), "%s%2x", type4.sock_pfx, instance= ); SMBIOS_TABLE_SET_STR(4, socket_designation_str, sock_str); t->processor_type =3D 0x03; /* CPU */ - t->processor_family =3D 0x01; /* Other */ + t->processor_family =3D 0xfe; /* use Processor Family 2 field */ SMBIOS_TABLE_SET_STR(4, processor_manufacturer_str, type4.manufacturer= ); if (type4.processor_id =3D=3D 0) { t->processor_id[0] =3D cpu_to_le32(smbios_cpuid_version); @@ -758,7 +764,7 @@ static void smbios_build_type_4_table(MachineState *ms,= unsigned instance) t->thread_count =3D (threads_per_socket > 255) ? 0xFF : threads_per_so= cket; =20 t->processor_characteristics =3D cpu_to_le16(0x02); /* Unknown */ - t->processor_family2 =3D cpu_to_le16(0x01); /* Other */ + t->processor_family2 =3D cpu_to_le16(type4.processor_family); =20 if (tbl_len =3D=3D SMBIOS_TYPE_4_LEN_V30) { t->core_count2 =3D t->core_enabled2 =3D cpu_to_le16(cores_per_sock= et); @@ -1402,6 +1408,9 @@ void smbios_entry_add(QemuOpts *opts, Error **errp) return; } save_opt(&type4.sock_pfx, opts, "sock_pfx"); + type4.processor_family =3D qemu_opt_get_number(opts, + "processor-family= ", + 0x01 /* Other */); save_opt(&type4.manufacturer, opts, "manufacturer"); save_opt(&type4.version, opts, "version"); save_opt(&type4.serial, opts, "serial"); diff --git a/qemu-options.hx b/qemu-options.hx index 5adbed1101..78fceae4c1 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2686,7 +2686,7 @@ DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, " specify SMBIOS type 3 fields\n" "-smbios type=3D4[,sock_pfx=3Dstr][,manufacturer=3Dstr][,version=3Dstr= ][,serial=3Dstr]\n" " [,asset=3Dstr][,part=3Dstr][,max-speed=3D%d][,current-s= peed=3D%d]\n" - " [,processor-id=3D%d]\n" + " [,processor-family=3D%d,processor-id=3D%d]\n" " specify SMBIOS type 4 fields\n" "-smbios type=3D8[,external_reference=3Dstr][,internal_reference=3Dstr= ][,connector_type=3D%d][,port_type=3D%d]\n" " specify SMBIOS type 8 fields\n" @@ -2714,7 +2714,7 @@ SRST ``-smbios type=3D3[,manufacturer=3Dstr][,version=3Dstr][,serial=3Dstr][,as= set=3Dstr][,sku=3Dstr]`` Specify SMBIOS type 3 fields =20 -``-smbios type=3D4[,sock_pfx=3Dstr][,manufacturer=3Dstr][,version=3Dstr][,= serial=3Dstr][,asset=3Dstr][,part=3Dstr][,processor-id=3D%d]`` +``-smbios type=3D4[,sock_pfx=3Dstr][,manufacturer=3Dstr][,version=3Dstr][,= serial=3Dstr][,asset=3Dstr][,part=3Dstr][,processor-family=3D%d][,processor= -id=3D%d]`` Specify SMBIOS type 4 fields =20 ``-smbios type=3D11[,value=3Dstr][,path=3Dfilename]`` --=20 2.43.0