All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [v4 PATCH 00/12] SMBIOS: build full tables in QEMU
@ 2014-03-18 23:23 Gabriel L. Somlo
  2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 01/12] SMBIOS: Rename smbios_set_type1_defaults() for more general use Gabriel L. Somlo
                   ` (12 more replies)
  0 siblings, 13 replies; 50+ messages in thread
From: Gabriel L. Somlo @ 2014-03-18 23:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: alex.williamson, agraf, armbru, gsomlo, kevin, kraxel, imammedo, lersek

Here's version 4 of moving smbios table construction into QEMU.

New in this version:

   - 9/12 builds all memory tables (16, 17, 19, 20) and IMHO has much
     cleaner and easier to understand code, as well as extensive comments
     re. how tables fit together, and how they're generated.

   - after 10/12, we're 100% bug-for-bug SeaBIOS compatible

   - 11/12 updates tables (most importantly type 17) to v2.4 compatibility
     by adding the v2.3 fields missing in SeaBIOS

   - 12/12 removes bug-for-bug compatibility, cleans up a few of
     the arbitrarily hard coded fields, and counts CPUs starting from 0
     to match the rest of the table types with multiple instances.

Re. e820: I believe it's premature to build smbios tables from e820.

Both e820 and smbios are currently built from three "primitives":
ram_size, and [below|above]_4g_mem_size, and it is uncertain (at least
to me, at least right now) what e820 will end up looking like in the
future. I would humbly suggest we switch smbios generation over to using
e820 as a source once that becomes clearer.

See below for more e820 related thoughts and questions.


By adding support for the inclusion of a type 2 (baseboard) table, and
by generating v2.4 compliant type 17 (dimm) tables, this patch series
allows QEMU to more or less officially support OS X guests (v10.8 and
later, using Chameleon as a bootloader, but without further out of tree
patches).



On Fri, Mar 14, 2014 at 06:51:05PM +0100, Igor Mammedov wrote:
> They might overlap, grep for e820_add_entry(). If you interested in
> what kernel does with such table look for sanitize_e820_map() there.

I looked, and it appears sanitize_e820_map() will turn whatever is
collected from the hardware into a set of non-overlapping entries.
I am now wondering if QEMU isn't capable of directly generating a
sanitized e820 map from start.
 
> Does SMBIOS/t17 actually care about shadowing parts of it by something
> else in unrelated e820?

AFAICT, we only care about E820_RAM entries, so that we can map them
to DIMMs representing the total memory (ram_size) configured on the system.

> Once we have DIMMDevices, I'm planning to convert below-4g and above-4g to
> a set of DIMMDevices, there will be at least 1 device per node but there could
> be more of them to satisfy different backend requirements like hugepage
> size, alignment, e.t.c.
> 
> BTW why do we care how smbios tables are build in relation to NUMA mapping,
> they seem to be totally independent.

Right now, both the e820 table and smbios tables are populated from the same
set of "primitives", i.e. ram_size, below_4g_mem_size, and above_4g_mem_size.

If, in the future, we decide to build smbios memory tables indirectly, i.e.
from e820 (based on the fact that e820 will contain more complete information
supplied from more than just pc_q35_init() or pc_init1(), if using piix) it
will be good to have an idea of how to programatically deal with whatever
combinations of nodes, DIMMs, etc. will be present. Mainly, how can I tell
if a bunch of E820_RAM entries from the e820 table all belong to the same
or different nodes ?

At this point, can anyone with access to a real, physical, NUMA system dump
the smbios tables with dmidecode and post them here ? I think that would
be very informative.

Thanks again,
--Gabriel


Gabriel L. Somlo (12):
  SMBIOS: Rename smbios_set_type1_defaults() for more general use
  SMBIOS: Use macro to set smbios defaults
  SMBIOS: Use bitmaps to check for smbios table collisions
  SMBIOS: Add code to build full smbios tables; build type 2 table
  SMBIOS: Build full tables for types 0 and 1
  SMBIOS: Remove unused code for passing individual fields to bios
  SMBIOS: Build full type 3 table
  SMBIOS: Build full type 4 tables
  SMBIOS: Build full smbios memory tables (type 16, 17, 19, and 20)
  SMBIOS: Build full tables for type 32 and 127
  SMBIOS: Update all table definitions to smbios spec v2.3
  SMBIOS: Remove SeaBIOS compatibility quirks

 hw/i386/pc.c             |   3 +
 hw/i386/pc_piix.c        |  15 +-
 hw/i386/pc_q35.c         |  11 +-
 hw/i386/smbios.c         | 758 +++++++++++++++++++++++++++++++++++++++++------
 include/hw/i386/smbios.h |  47 ++-
 5 files changed, 717 insertions(+), 117 deletions(-)

-- 
1.8.5.3

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2014-04-08 13:51 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-18 23:23 [Qemu-devel] [v4 PATCH 00/12] SMBIOS: build full tables in QEMU Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 01/12] SMBIOS: Rename smbios_set_type1_defaults() for more general use Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 02/12] SMBIOS: Use macro to set smbios defaults Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 03/12] SMBIOS: Use bitmaps to check for smbios table collisions Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 04/12] SMBIOS: Add code to build full smbios tables; build type 2 table Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 05/12] SMBIOS: Build full tables for types 0 and 1 Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 06/12] SMBIOS: Remove unused code for passing individual fields to bios Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 07/12] SMBIOS: Build full type 3 table Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 08/12] SMBIOS: Build full type 4 tables Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 09/12] SMBIOS: Build full smbios memory tables (type 16, 17, 19, and 20) Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 10/12] SMBIOS: Build full tables for type 32 and 127 Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 11/12] SMBIOS: Update all table definitions to smbios spec v2.3 Gabriel L. Somlo
2014-03-18 23:23 ` [Qemu-devel] [v4 PATCH 12/12] SMBIOS: Remove SeaBIOS compatibility quirks Gabriel L. Somlo
2014-03-26 19:58 ` [Qemu-devel] E820 (Re: [v4 PATCH 00/12] SMBIOS: build full tables in QEMU) Gabriel L. Somlo
2014-03-26 22:36   ` Kevin O'Connor
2014-03-31 20:18     ` Gabriel L. Somlo
2014-04-01  8:40       ` Laszlo Ersek
2014-04-01 14:39         ` Kevin O'Connor
2014-04-01 15:47           ` Laszlo Ersek
2014-04-01 18:47             ` Gabriel L. Somlo
2014-04-01 20:28               ` Kevin O'Connor
2014-04-01 21:28                 ` Gabriel L. Somlo
2014-04-01 21:44                   ` Laszlo Ersek
2014-04-01 22:00                     ` Kevin O'Connor
2014-04-01 22:35                       ` Laszlo Ersek
2014-04-02 12:38                         ` Gabriel L. Somlo
2014-04-02 13:39                           ` Laszlo Ersek
2014-04-05  2:48                         ` Kevin O'Connor
2014-04-02 15:07                     ` Gerd Hoffmann
2014-04-02 17:01                       ` Gabriel L. Somlo
2014-04-03  1:57                         ` Gabriel L. Somlo
2014-04-03  9:42                           ` Laszlo Ersek
2014-04-03 13:32                             ` Gabriel L. Somlo
2014-04-03 13:56                               ` Laszlo Ersek
2014-04-07  6:50                               ` Gerd Hoffmann
2014-04-07  6:47                             ` Gerd Hoffmann
2014-04-01 21:48                   ` Kevin O'Connor
2014-04-02 15:04                 ` Gerd Hoffmann
2014-04-05  0:34                   ` Kevin O'Connor
2014-04-05  1:15                     ` Gabriel L. Somlo
2014-04-05  2:26                       ` Kevin O'Connor
2014-04-07  7:09                         ` Gerd Hoffmann
2014-04-07 14:14                           ` Kevin O'Connor
2014-04-07 14:33                             ` Laszlo Ersek
2014-04-07 14:49                             ` Gabriel L. Somlo
2014-04-07 15:23                               ` Kevin O'Connor
2014-04-07 18:05                                 ` Gabriel L. Somlo
2014-04-07 18:57                                   ` Kevin O'Connor
2014-04-08 13:51                                     ` Gabriel L. Somlo
2014-03-27  2:45   ` Gabriel L. Somlo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.