History log of /fuchsia/zircon/kernel/platform/pc/platform.cpp
Revision Date Author Comments
# afb4c092 25-Sep-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] convert pmm_alloc_range() to returning a status instead of count

Tested: runtests on x86 and arm

Change-Id: Id3b550ee9affa742707b2c98ec4c543f1cca7c85


# a42c1b60 11-Sep-2018 Roland McGrath <mcgrathr@google.com>

[kernel] WITH_DEV_PCIE -> WITH_KERNEL_PCIE

Hard-code this in KERNEL_DEFINES rather than relying on the
magic predefine based on the presence of the dev/pcie module.

Test: CQ & manual verification that kernel text size didn't change
Change-Id: Id827a8a93bc61ac8b1d7727f51a18f53277a7a16


# a06521fe 16-Jul-2018 Mohan Srinivasan <srmohan@google.com>

[kernel][debuglog] Kernel param to print to serial

Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
former to true (or enabling the latter) forces prints to go straight to
the serial console (unbuffered, bypassing debuglog). The reason for
retaining the compile time switch is to control the behavior of prints
that might happen very early in boot, before cmdline is parsed. The
compile time switch overrides the kernel cmdline parameter, and
secondly, both of these settings have the side effect of disabling irq
driver uart tx. Later, we can investigate turning this into a switch
that we can enable/disable at run time (via devmgr perhaps), so we can
control buffering for kernel printfs after boot, if necessary.

Test: Added internal state in the uart drivers, examine that for various
scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
should override the kernel cmdline parameter. Also tested using the uart
bulk print tests.

ZX-2301.

Change-Id: I075836313a13ff33077180bd01ebdf40d11e46fc


# 987b4ea0 16-Aug-2018 Christopher Anderson <cja@google.com>

[kernel] Add feature flag to disable kernel PCI

When ENABLE_USER_PCI=1 is passed to the build zircon
will build with pci syscalls stubbed out and initialize
a new, mostly-empty userspace pci process.

Test: core-tests

Change-Id: I9f35715a7c4374072491c91592966815c6d0c667


# 3e16f410 20-Aug-2018 Mohan Srinivasan <srmohan@google.com>

Revert "[kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console."

This reverts commit 5427fd8bea3a465778a91bf84d0515a83e40616f.

Reason for revert: Debug and fix a crash.

Original change's description:
> [kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console.
>
> Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
> true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
> former to true (or enabling the latter) forces prints to go straight to
> the serial console (unbuffered, bypassing debuglog). The reason for
> retaining the compile time switch is to control the behavior of prints
> that might happen very early in boot, before cmdline is parsed. The
> compile time switch overrides the kernel cmdline parameter, and
> secondly, both of these settings have the side effect of disabling irq
> driver uart tx. Later, we can investigate turning this into a switch
> that we can enable/disable at run time (via devmgr perhaps), so we can
> control buffering for kernel printfs after boot, if necessary.
>
> Test: Added internal state in the uart drivers, examine that for various
> scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
> should override the kernel cmdline parameter.
>
> ZX-2301.
>
> Change-Id: If14620511575d7dd6c3ed0347efbc412ec13a6d6

TBR=voydanoff@google.com,cpu@google.com,travisg@google.com,swetland@google.com,srmohan@google.com

Change-Id: Ie3883cba76347ab195ae3525696d35827ba08adf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true


# 5427fd8b 16-Jul-2018 Mohan Srinivasan <srmohan@google.com>

[kernel][debuglog] Add a kernel cmdline parameter to force prints to serial console.

Add a kernel cmdline parameter (kernel.bypass-debuglog) which if set to
true, behaves exactly as enabling ENABLE_KERNEL_LL_DEBUG. setting the
former to true (or enabling the latter) forces prints to go straight to
the serial console (unbuffered, bypassing debuglog). The reason for
retaining the compile time switch is to control the behavior of prints
that might happen very early in boot, before cmdline is parsed. The
compile time switch overrides the kernel cmdline parameter, and
secondly, both of these settings have the side effect of disabling irq
driver uart tx. Later, we can investigate turning this into a switch
that we can enable/disable at run time (via devmgr perhaps), so we can
control buffering for kernel printfs after boot, if necessary.

Test: Added internal state in the uart drivers, examine that for various
scenarios (bypass-debuglog on and off), ENABLE_KERNEL_LL_DEBUG on, which
should override the kernel cmdline parameter.

ZX-2301.

Change-Id: If14620511575d7dd6c3ed0347efbc412ec13a6d6


# 55c2bb42 06-Jul-2018 Todd Eisenberger <teisenbe@google.com>

[kernel][mexec] Fix hangs during mexec

We were seeing hangs in mexec due to
1) Forcefully stopping the other cores which may have been holding
locks, and
2) Acquiring mutexes after we've disabled interrupts, potentially
leading to unexpected behavior

ZX-2339 #done
ZX-2344 #done

Test: Ran a lot of mexec cycles, didn't see anymore hangs

Change-Id: I5b7cf565cebe2a95a34b1a5694880f56528f7a97


# a1484311 25-Jul-2018 Roland McGrath <mcgrathr@google.com>

[netboot][zbi] Support complete ZBI booting

When netboot receives only a "kernel.bin" and no "ramdisk.bin",
it expects the single file to be a complete ZBI. It splits the
kernel from the data ZBI and passes both to mexec.

The BOOTLOADER_VERSION is bumped to 0.7.9 for this change, to
indicate a netboot that's capable of booting a complete ZBI.
This means that with this change, new and old zedboot images and
host-side bootserver tools will be incompatible. (That is,
bootserver will refuse to serve a differently-versioned zedboot
even though in this case it would work as long as either the old
method with separate ramdisk image was being used, or the zedboot
was a new one.)

Test: CQ + manual netboot with both old and new methods
Change-Id: I63ff688e491e5f956ffc46f7284f613bad2d3633


# 896f6d8a 08-Jun-2018 Nick Maniscalco <maniscalco@google.com>

[kernel] Gracefully stop secondary CPUs when shutting down

Prior to this change...

... on x64, ZX_SYSTEM_POWERCTL_SHUTDOWN would aggressively shutdown
secondary CPUs without giving them a chance to complete critical
sections and release spinlocks. This led to hangs during shutdown (see
INTK-390).

... on arm64, the shutdown of secondary CPUs was more controlled as
they were first parked by having each CPU halt itself. However,
runqueues, DPCs, and timers were not properly handled. For example, a
DPC could fire after its CPU has been offlined, resulting in an
assertion failure (ZX-2232).

This change:

- Updates x64 and arm64 to more gracefully shutdown secondary CPUs
- Unifies the graceful shutdown paths for arm64 and x64.
- Implements arch_mp_cpu_unplug, arch_mp_prep_cpu_unplug, and
arch_flush_state_and_halt on arm64
- Changes arm64 to use mp_unplug_cpu_mask_single_locked
- Removes a workaround from userboot/start.c (INTK-390)
- Renames platform_halt_helper to platform_graceful_halt
- Removes unused enum values from platform_halt_reason
- Updates comments for platform_halt and platform_halt_secondary_cpus

Tested: Manually, observed no hangs, no panics. Details below...

- Boot looped 300,000 times ('userboot=bin/ps userboot.shutdown=true')
- qemu/arm64/gicv2
- qemu/arm64/gicv3
- qemu/x64
- Flashed vim2, netbooted, ran 'dm reboot' a few times
- Flashed eve, netbooted, ran 'dm reboot' a few times

ZX-2232 #done

ZX-2228 #comment progress

Change-Id: Ib667b272f516dc2e663aa393c1ec78837535041f


# 5fa68ebf 12-Jul-2018 Abdulla Kamar <abdulla@google.com>

[zircon][boot] Rename memory.h to e820.h

This is so that it can be used by higher layers, specifically by Machina
on x86 platforms.

Test: Built Zircon and Garnet and ran "fx run -k".
Change-Id: Ia5039ba8d06751ce2fd72e3573f825a9188d3a77


# dac02256 11-Jul-2018 Abdulla Kamar <abdulla@google.com>

[ulib][zbi] Rename zbi to libzbi

This is to avoid the naming collision with the zbi tool, so that the
ulib can be exported for use by upper layers.

Test: Built Zircon and Garnet, then ran using "fx run -k".
Change-Id: Ib3f495f908791f6808fa4a399d087f24ec501a88


# 8b532381 05-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Addresses some additional CR comments

+ Change zbi_result_t to an enum
+ Remove const from a number of function arguments

Change-Id: I226423b0ce523546779848abb853a02082a8d653


# 732196ca 05-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Reapply libzbi append bootdata change

This change was previously reverted due to a bug which
has since been fixed.

Change-Id: I9237fe9ae999b03c394120bbab29537e72da9108


# da7b0d57 05-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Revert zbi append section change

Unbreaks paver boot loop that some folks are experiencing

This reverts commit da1e998d28d776b3706589af28c6a900081f7f7d.

Change-Id: Ibcc856dc0feba31aae5811ce4ee03f035081912d


# da1e998d 01-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] migrate bootdata_append_section to libzbi

libzbi implements Zbi::CreateSection and Zbi::AppendSection
which duplicate the functionality of bootdata_append_section.

bootdata_append_section had several problems:
+ It was implemented in syscalls/system.cpp which isn't
really an appropriate place for that utility function.
+ It was only available in the kernel so there was no
way to share that code in userspace, libzbi is shared
with userspace.
+ Tests for bootdata_append_section lived in the
syscalls/... folder which isn't really an appropriate
place for those tests.

Change-Id: I4c9c9481919b8c57b74e5d944520687ca4a03733


# e0eb15db 01-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Implement zbi_create_section.

Divides zbi_append_section into two seperate
methods:

zbi_create_section creates an empty section at
the end of the ZBI and passes a pointer to the
payload back to the client.

zbi_append_section maintains its current
functionality.

Change-Id: I14a887eb874c3d9dce45cf68e24c8ecf2f21c79a


# ca30e3c0 01-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[pc][zbi] Migrate PC bootdata processing to libzbi

This helps us share ZBI parsing code between our
two supported platforms and factors the common
elements into a shared library.

I've also temporarily removed the CRC validation
code and I feel that it also belongs in libzbi
where both platforms can take advantage of it.

Change-Id: If82aeb356e73ad8dbaf8a08f7536ea212076fe5b


# a8a6d268 31-May-2018 Gurjant Kalsi <gkalsi@google.com>

[zbi][kernel] Remove all references to bootdata

Convert the kernel from bootdata to zbi with a few
notable exceptions:
+ Process bootdata on x86/PC was not converted
because we intend to migrate that to using
libzbi in a future patch.
+ syscalls_system.cpp/mexec weren't migrated for
the same reason as above.

bootdata_unittest.cpp was also removed because it
tests the bootdata append functionality which is
redundant with libzbi functionality and slated
to be removed.

Tested by booting on the following platforms:
+ QEMU ARM
+ QEMU x86 (KVM)
+ Vim2
+ UEFI based x86 system

Change-Id: Ifcf803b16a20a70ecd2f4aae930b0304e9cb3437


# 7d18a4e0 30-May-2018 David Stevens <stevensd@google.com>

[debuglog] Enable debuglog with the early gfx console

Change-Id: I05f713cf4ec9d21ecd252e9271e9f6dc9ee14fd2


# cdea48c8 18-Jul-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] first pass overhaul of the PMM

-Add a new PmmNode class that represents a pmm for a single NUMA node.
-Move main free queues into PmmNode.
-Make PmmArena be a child of PmmNode.
-Refactor the vm_page structure a bit to change how queues work. Make
the main queue node be intrinsic to the page, instead of per state.
-Move some per page helper routines into the page struct.
-Remove the KMAP flags, since they're not used on 64bit machines.

TODO:
-Make use of the LO_MEM flag for <4GB allocations
-Make use of the new active/inactive/wired queues in PmmNode
-Add support for multiple nodes in a NUMA system
-Keep page state count in PmmNode class to make page state counting less
expensive

Change-Id: I0ca5e55aad0bb2f393d2dc590b02f160e4740398


# 67015a24 16-Apr-2018 Todd Eisenberger <teisenbe@google.com>

[kernel][pc] Switch to using smbios library

ZX-2003 #comment Make kernel use library

Change-Id: I5b27d8dbd0f11d29a28efbc636985c9324b5d18c


# 2096a3b7 28-Mar-2018 Todd Eisenberger <teisenbe@google.com>

[kernel][uart] Add a cmdline for overriding bootdata settings

Passing kernel.serial=none will turn serial off.
Passing kernel.serial=legacy on x64 will use the legacy COM1 port.
Not passing kernel.serial will fallback to the bootdata settings.
If no bootdata serial setting is provided, the system on x64
currently defaults to the legacy port.

This also updates the run-zircon script to take a --no-serial
argument for disabling serial. If this option is not provided,
run-zircon will pass kernel.serial=legacy to the kernel.

ZX-1901 #comment Add the cmdline argument

Change-Id: Ied0b159ce0c6ba0542f2a5087c63013f8324e9bc


# 0cc4f515 13-Mar-2018 Todd Eisenberger <teisenbe@google.com>

[pc][smbios] Enumerate the struct type values

Change-Id: Ia1ef472aad298d643ef46008d1109f2a48c36ace


# aab0e916 12-Mar-2018 David Stevens <stevensd@google.com>

[kernel][pc] On QEMU, shutdown with debug exit device

ZX-1567 #comment

Change-Id: I6fd8aab6b71ded97f641e1a50e0f93c3ec1103ba


# dedb86db 06-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[pc][smbios] Implement a subset of SMBIOS support

This will let us retrieve system information such as product names,
SKUs, and firmware revisions that may be useful for logging in bug
reports.

Change-Id: Ia42d1ec715a5f8898165070e243ec163bfe89a98


# a23e5a2a 04-Mar-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][x86][topology] add node level to topology decode, add logic for multi-node AMD cpus

This threadripper is actually a numa multinode machine on a single
socket. Add the appropriate logic to decode this from the AMD specific
topology leaf.

Add a node level, which is currently only used for informational
purposes and never filled in on intel machines.

Change-Id: I2f928f75bdc536c0c0a5298c779690143d0d90be


# 08314dff 12-Jan-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][platform] switch PC and ARM platform over to using the boot memory reservation system

Instead of tracking reserved memory in this layer, add reserved ranges
to the boot reserve system prior to adding arenas to the PMM. This
should allow the pmm to allocate memory out of itself without stepping
on reserved memory.

Change-Id: I98921ccbec90bf89decd597c90b219f164aefd07


# bdb23a71 05-Jan-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][platform] run clang-fmt on all of kernel/platform

Change-Id: I8dcc6ca434f0c77e4fa7c23c202772abf03e1f1d


# 84cbf6d3 12-Dec-2017 Todd Eisenberger <teisenbe@google.com>

[platform][pc] Report LAST_CRASHLOG the same way as an NVRAM log

This unifies the reporting mechanisms on PC which should let us keep the
forwarding-across-mexec behavior simple.

ZX-1485 #comment unifying reporting mechanisms

Change-Id: I437609c4e817a0d79413d0c348ac0584031f65f9


# d539039f 12-Dec-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][pc] Propagate NVRAM panic log location across mexec

We were failing to copy the bootdata info over.

ZX-1485 #comment Fix part of /boot/log/last-panic.txt issue.

Change-Id: I8d18c7fd3a6cc0867145563af12ca3e8880917bf


# 736680ee 12-Dec-2017 Todd Eisenberger <teisenbe@google.com>

[platform][pc] Give better names to pc internal functions

Change-Id: Ifd2def5a5b5f97f924eefe3dbbc0ff5c4d1934d4


# 7177a347 13-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm] use the peripheral memory map from the mdi, remove the use of mmu_initial_map

Multiple smaller changes here that were too hard to split:
-Switch arm code to mapping the peripheral map based on the mdi
-Construct a peripheral map reserve region after the fact when the vm comes up
-Remove the mmu_initial_map for both arm and x86
-Construct the physmap reserve region from the physmap #defines instead of the table
-Change arm start.S to map the first 512GB of physical space for the physmap

Change-Id: I345c521f38fde88cfabffbdaae6331e6b8ebd323


# d33a306e 17-Nov-2017 Brian Swetland <swetland@google.com>

[api] start normalizing ZX_PIXEL_FORMAT_*

- encode byte-size of pixels in the format for easy extraction
(replace a bunch of redundant switch statements with the new
ZX_PIXEL_FORMAT_BYTES(pf) macro)
- define legacy kernel GFX and DISPLAY pixel formats in terms
of the ZX_PIXEL_FORMAT constants
- Convert legacy values to new values when reading bootdata
to maintain bootloader backward compatibility.

Change-Id: I4f9cc579ef08fcd86701ae8b8e082030091435ca


# 1bff2eb8 13-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[pc][suspend] Mark UART as stopped during suspend

Otherwise if a print occurs before the UART comes up, the system may
hang.

Change-Id: I0af64289c476f43b029a57dd47e0d77c73aca33f


# 918d6da5 03-Nov-2017 Brian Swetland <swetland@google.com>

[bootdata] remove all support for v1 bootdata

- combine bootdata and bootextra headers into a common header
- FLAG_EXTRA becomes FLAG_V2 and required everywhere
- all backward compatibility processing is removed
- all backward compatible generation is removed

Change-Id: Iaca0e7cdc8297f981f9594df0528b87765032050


# b9527766 02-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[pc][suspend] Implement platform_{suspend, resume}

This allows us to restore timers after resume from suspend-to-RAM.

ZX-1184

Change-Id: Ia63d1403c8011fa7b6d7ba8b5b75f3791b621051


# f0903f89 07-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[pc][bootdata] Store SMBIOS entry point given by bootloader

Change-Id: Iac5cc487075379fe8a7038cbe0da5316e35ff14e


# e80fb0e4 03-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][memory] refactor some physical<->virtual routines, formally naming the BKM physmap

This mostly just rearranges the names of things, but add an actual name
for the big kernel map and add some bounds checking to usage.

This should let us be a bit more dynamic about the physmap in the
future, including placing it at a random location and/or giving it a
more complex mapping.

Change-Id: I062d3f0483f27436252b9607174e10b852f0f832


# f24bf65f 03-Nov-2017 Brian Swetland <swetland@google.com>

[mexec] support "new" bootdata extra data records

Change-Id: I8382b97fff9ce31bfef778f6c08e95b5c704ca65


# 40c048f6 25-Oct-2017 George Kulakowski <kulakowski@google.com>

[pc] Use a unique_ptr to hold apic_ids

Change-Id: I3c1fe1ca8013e8e13f91c353431daed6ce1cd91d


# 63364cd5 19-Oct-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arch] remove KERNEL_LOAD_OFFSET from the kernel link address

-ARM64 kernels are now linked to run precisely at -4GB with no load
offset baked into the address.
-bake KERNEL_LOAD_OFFSET into KERNEL_BASE for x86 so that the initial
mmu table setup still works.
-remove PHYS_HEADER_LOAD_OFFSET which is no longer used

Change-Id: I33b293653346afbfc9aeaae5d2a433ef3a4be0b1


# 0f3c1d59 11-Oct-2017 Gurjant Kalsi <gkalsi@google.com>

[zedboot] Reinstate hack to disable PCI before Zedboot

Leaving PCI (specifically DMA) devices running during Mexec was causing
memory corruption.

Disabling PCI devices caused graphics to not start up
on some devices.

While we work on a longer term fix I'm going to re-enable this hack to see
what the impact is on the Acer. I'll also investigate why graphics fails to
start on other devices.

This reverts commit 8250a9e1cf3f383d94a950f0182d6c71a9cd082a.

Change-Id: I50af57fbc1d367db18815eb495e28fd54475716e


# 0932bec7 11-Oct-2017 Roland McGrath <mcgrathr@google.com>

[kernel] Make mmu_initial_mappings const

Everything that can be const should be const.

Change-Id: If4ee54756a4ba932e242aea844477b8e35187310


# 89b804a8 03-Oct-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][x86] Stash the BSP APIC ID

We can later use this to assign all IOAPIC IRQs and MSIs to the
same core (until we have a more sophisticated assignment mechanism).

Change-Id: Idb4f5b8913e62c19418b071171ce03d76cfacb77


# 5bc3d2f1 03-Oct-2017 Gurjant Kalsi <gkalsi@google.com>

[zedboot][mexec] Add more logging to cmdline patch failures

Also increases auxiliary data size for passing structs to the next kernel by 2x
since we're now passing more data along.

Change-Id: I70fee3ae4f1a793a2fd5dea22fde991fa86285a0


# b53468af 30-Aug-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][sched] thread's cpu affinity is now a bitmask instead of a number

-Can specify the mask of which cpus a thread is allowed to run on
-thread_set_cpu_affinity() will now do what is needed to migrate a
thread between cores, even if the thread is currently running on another
cpu.

Change-Id: I5dfc9f8e1c23d63ed749c84bc3dfa4118470b8e6


# 8250a9e1 27-Sep-2017 Gurjant Kalsi <gkalsi@google.com>

[zedboot] Remove hack to disable PCI before Zedboot

This hack seems to be causing some trouble recently:

+ UART fails to initialize with this hack present after a zedboot.
+ This hack was causing Zedboot to hang reliably for me.

Furthermore, I haven't seen any instances of devices failing to initialize
after a zedboot so I think it's better that we remove this hack for now.

Change-Id: I6ddba184dbf64ce21d06f2183f679e7ab9aa702f


# 13043f1d 26-Sep-2017 Gurjant Kalsi <gkalsi@google.com>

[pc][mexec][uart] Pass UART parameters via bootdata during mexec

Patch the bootdata with the BOOTDATA_DEBUG_UART section to inform the next
kernel about the UART config.

Change-Id: Iaa31647c78a11a1a196c2d3d071cbe274d51b1e0


# 7569b41e 20-Sep-2017 George Kulakowski <kulakowski@google.com>

[kernel][platform] Convert kernel/platform to use zx_status_t

Change-Id: If07f3ab0f67f7c3408fc520d48d9cde1b7d735be


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 59e644b1 07-Sep-2017 George Kulakowski <kulakowski@google.com>

[zircon][mxtl->fbl] Rename mxtl to fbl

Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be


# e1490736 01-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move kernel/kernel/vm to just kernel/vm

Change-Id: I8f724a9f8a61415712661d1fdd3dc4e1c70cf620


# 71b934bd 29-Aug-2017 Brian Swetland <swetland@google.com>

[bootdata] further movement toward new bootdata headers

- bootloader, kernel, userboot, and devmgr now support FLAG_EXTRA
for container headers as well as item headers
- bootloader generates new style headers for prepended bootdata
items when it detects a new style container header
- mkbootfs generates large container headers when generating
bootdata images with crc32 enabled
- bootloader version bumped to 0.6.0 to mark the point of
compatibility needed for kernels once we throw the switch
to use new headers exclusively

Change-Id: Ifcb78d62f882ddd869da8d73ffe774a0f7937bc0


# ada494d9 23-Aug-2017 Brian Swetland <swetland@google.com>

[kernel][options] tidy up some kernel cmdline options

- Renamed kernel.halt_on_panic to .halt-on-panic
- Renamed smp.cpus to kernel.smp.cpus
- Renamed smp.ht to kernel.smp.ht
- Renamed timer.wallclock to kernel.wallclock
- Removed docs for nonexistent option superceded by virtcon.*

Change-Id: I59245798805731cfeca07ba142da88cbb8fbd91d


# 47581823 21-Aug-2017 Brian Swetland <swetland@google.com>

[kernel][bootdata][pc] check crc32 on bootdata items that have it

Only when DEBUG_BOOT_DATA is set, since normally the output from
this stage is not usefully visible. This is intended to debug
data corruption during bootloader -> kernel handoff.

Change-Id: I2826da837f6eea89493288d0393ee79eec34236f


# 5abe87b7 18-Aug-2017 Christopher Anderson <cja@google.com>

[pc][pci] Tear down PCI devices before mexec()

As noted in comments, this is a workaround until we have a more mature
driver destruction handler.

Change-Id: I97b99beb144cdf6921f3a7210668f23cc5873176


# e369244b 06-Aug-2017 Gurjant Kalsi <gkalsi@google.com>

[mexec][cmdline] Pass cmdline to next kernel via mexec

Adds an argument to the mexec syscall for passing kernel
command line arguments to the next kernel.

Change-Id: I405bbe041865715a7de001d864c49bf20a42aa7c


# 6e77e9af 31-Jul-2017 Gurjant Kalsi <gkalsi@google.com>

[x86][pc] Implements mexec for Intel x86 PC

Change-Id: Id257568884e91056bbaab64d8d4650ddfd49ddda


# fac5630d 27-Jul-2017 Gurjant Kalsi <gkalsi@google.com>

[platform] Implements halt_secondaries and thread_migrate_cpu

Implements two new APIs in the kernel:

(1) platform_halt_secondary_cpus

Halt any CPU cores that are not designated as the boot cpu
as the platform sees fit.

This call is intended to bring the system back into the state
it was in when it booted in order to fascilitate mexec.
This patch implements this call for x86.

(2) thread_migrate_cpu

Pins the current thread on a target CPU and ensures that the
migration has succeded.

In addition, this patch refactors mexec to use the new APIs

Change-Id: Ic05b76dd117e50fdb08f98ce92ccec443c870004


# 7ec39093 02-Aug-2017 Brian Swetland <swetland@google.com>

[pc][crashlog] add platform_recover_crashlog() and nvram crashlog support

- platform_recover_crashlog() provides a way to obtain the crashlog
contents in situations where it will not be located and passed in
via the bootloader
- arm gets a do-nothing implementation
- pc gets an implementation that works with the nvram crashlog
bootdata item, and its platform_stow_crashlog() now favors the
nvram crashlog over the efi variable crashlog if both are
available
- pc: change chipset level reset to a hard reset from a full reset,
to avoid multi-second system-wide reset that could impact memory
integrity

Change-Id: I6b600249e6504f14269dc2fc0f87e6c765073854


# 4717ba19 22-Jul-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][x86][smp] clean up a little bit of boot spew regarding x86 boot

Also early terminate the x86_bringup_aps() routine if theres no work to
be done.

Change-Id: I9676d409b2dbaf0fd87c4c5891ec8505194d1d4e


# 36a47eb5 01-Aug-2017 Brian Swetland <swetland@google.com>

[pc][bootdata] wire up new bootdata items, tidy things

- simplify bootloader struct by sharing sub-structs with
bootinfo, which also simplifies processing bootinfo
- wire up bootdata item for debug uart
- allow specification of irq (otherwise use polling mode)
for debug uart bootdata
- remove no-longer-needed commandline paths for setting
up the sw fb and debug uart
- move bootdata extraction above uart init

Change-Id: Ieff479e5adf372e166e5d8a290ae58a6662fccb7


# 0bc2ac7d 29-Jul-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][multiboot] fix the multiboot flags table

Turns out the multiboot flags constants have been wrong since forever,
which has caused us to add some workaround code, blaming qemu for
not passing in the multiboot mmap info. It was our fault.

Change-Id: I6ae92c1ad1243d982f53700124e042a4b980c2c5


# ab7b9119 13-Jun-2017 George Kulakowski <kulakowski@google.com>

[magenta][kernel][platform] Use the new MX_ERR_* and MX_OK names

Change-Id: I66e96d82886d10bc497eca0999be9a7e56ba7b16


# d77d89b6 06-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] restructure kernel vm headers and remove more legacy routines

Mostly unpack vm.h into a few separate headers.

No functional change

Change-Id: Ifd85506f49596d82a3a0e970fc911a34f3064d70


# c4b00c8a 01-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel] remove the WITH_SMP flag

Always build the kernel with full SMP support.

Change-Id: I105f8e4127a93113c795ae80e1dc4d4b0d43abe8


# f19ee267 17-May-2017 Duncan Laurie <dlaurie@chromium.org>

platform: multiboot: Allow framebuffer configuration on command line

Multiboot bootloaders currently do not have a way to pass the framebuffer
configuration to the kernel. Allow it to be read from the command line
so it can be configured for the current panel.

Change-Id: Id5004e2f50d16d9e6750f04aedc6da851254b068
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>


# 8adaadff 24-May-2017 Gurjant Kalsi <gkalsi@google.com>

[cmdline][kernel] Implement appending to kernel cmdline

Calling cmdline_init more than once previously corrupted
the state of the kernel command line.

On ARM we have a scenario now where the kernel command line
can come from the native bootloader as well as through the
bootdata structure.

For now we want to be able to support unioning these two
command lines.

Change-Id: Idf6dc9beaf1bf68d408afbb9a8db408a2d2869af


# 464c525b 19-May-2017 Brian Swetland <swetland@google.com>

[kernel] fix some issues with platform_*_crashlog()

Change-Id: I36be328f26ee38bbf01efbb571e89efd6d4711a5


# 000197a5 18-May-2017 Brian Swetland <swetland@google.com>

[kernel][gigaboot][devmgr] reliable last crashlog mechanism

Introduce platform_stow_crashlog(), a simple API for the panic
path to pass a textual log to the platform in hopes that it will
find its way to the system after a reboot.

For the PC platform, if there is an EFI System Table, attempt to
use EFI Runtime Services to stash this data in an EFI variable.

Gigaboot will read this EFI variable and pass the crashlog to
the booting system as BOOTDATA_LAST_CRASHLOG, erasing the contents
of the variable afterwards.

Devmgr will unpack BOOTDATA_LAST_CRASHLOG into /boot/log/last-panic.txt

Change-Id: I6cc7602a2e85156f8d3353166f4cbc22413a5ae1


# fb1b2c1c 10-May-2017 Abdulla Kamar <abdulla@google.com>

[kernel][pc] Use e820entry_t consistently.

When calling process_bootitem, we should correctly use the size of the
e820entry_t structure.

Change-Id: I633516dcf4a6ee9690cabc29b512297ab1cf472b


# 22a3a155 07-May-2017 Abdulla Kamar <abdulla@google.com>

[kernel][pc] Remove x86-32 code from platform.

Remove some x86-32 code for the initial MMU mapping.

Change-Id: Ifaccd187af045a06018b7f0955ce50d0f3819c7e


# 633e58eb 26-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][vm] Remove defunct min_alloc_gap arguments

Change-Id: I931dd3a70fff34ca2acd157f8fcedd71ba9e44a3


# bd597128 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][vm] Convert most calls of vmm_alloc_physical to C++

Need to convert ACPICA's magenta code to C++ to get rid of the last one.

Change-Id: Ica2103302d5923807e03a30b1b284bb39b3e9d24


# 5d9c4f03 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][pc] Finish C++ conversion

Change-Id: Iea6ff5e497597c1b0cd3a914e1a3cdd5b641cf58


# 21a15d0d 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][pc] Rename all C files to CPP

This is a straight rename and breaks the build. The next patch in
this series makes everything build.

Change-Id: I067e3fe1e3a49d2ca217f48b72fd1e768c3332d7