Bug 212782 - [bhyve] Increasing VM_MAXCPU to >= 26 will result in ACPI MADT table corruption
Summary: [bhyve] Increasing VM_MAXCPU to >= 26 will result in ACPI MADT table corruption
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: Rodney W. Grimes
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-18 03:37 UTC by Peter Grehan
Modified: 2019-05-04 13:49 UTC (History)
6 users (show)

See Also:
rgrimes: mfc-stable11+
rgrimes: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Grehan freebsd_committer 2016-09-18 03:37:29 UTC
From the email sent to the freebsd-virtualization list, subject "High vCPU Counts in bhyve"

 https://lists.freebsd.org/pipermail/freebsd-virtualization/2016-September/004721.html

The cause and fix was described in a follow-on post:
 https://lists.freebsd.org/pipermail/freebsd-virtualization/2016-September/004724.html

This PR will track the fix.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2018-06-21 07:08:40 UTC
Return to the mailing list.
Comment 2 Marcelo Araujo freebsd_committer 2018-06-21 07:27:23 UTC
I will take it.
Comment 3 Marcelo Araujo freebsd_committer 2019-01-08 16:59:31 UTC
For reference, this ticket is being discussed on this review: https://reviews.freebsd.org/D18755
Comment 4 Rodney W. Grimes freebsd_committer 2019-01-11 01:12:00 UTC
(In reply to Marcelo Araujo from comment #3)
A proposed fix is now available in https://reviews.freebsd.org/D18815
Comment 5 commit-hook freebsd_committer 2019-04-25 22:53:45 UTC
A commit references this bug:

Author: rgrimes
Date: Thu Apr 25 22:52:44 UTC 2019
New revision: 346715
URL: https://svnweb.freebsd.org/changeset/base/346715

Log:
  Acpi MADT table correction for VM_MAXCPU > 21

  The bhyve acpi MADT table was given a static space of 256 (0x100) bytes,
  this is enough space to allow VM_MAXCPU to be 21, this patch changes that
  so VM_MAXCPU can be of arbitrary value and not overflow the space by
  actually calculating the space needed for the table.

  PR:			212782
  Reviewed by:		Patrick Mooney <patrick.mooney@joyent.com>
  Approved by:		bde (mentor), jhb (maintainer)
  MFC after:		3 days
  Differential Revision:	https://reviews.freebsd.org/D18815

Changes:
  head/usr.sbin/bhyve/acpi.c
Comment 6 commit-hook freebsd_committer 2019-05-04 13:44:23 UTC
A commit references this bug:

Author: rgrimes
Date: Sat May  4 13:43:49 UTC 2019
New revision: 347124
URL: https://svnweb.freebsd.org/changeset/base/347124

Log:
  MFC: r346715: Acpi MADT table correction for VM_MAXCPU > 21

  The bhyve acpi MADT table was given a static space of 256 (0x100) bytes,
  this is enough space to allow VM_MAXCPU to be 21, this patch changes that
  so VM_MAXCPU can be of arbitrary value and not overflow the space by
  actually calculating the space needed for the table.

  PR:			212782
  Reviewed by:		Patrick Mooney <patrick.mooney@joyent.com>
  Approved by:		bde (mentor, implicit), jhb (maintainer)
  Differential Revision:	https://reviews.freebsd.org/D18815

Changes:
_U  stable/11/
  stable/11/usr.sbin/bhyve/acpi.c
_U  stable/12/
  stable/12/usr.sbin/bhyve/acpi.c