VirtualBox

Changeset 60404 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Apr 9, 2016 11:45:55 PM (9 years ago)
Author:
vboxsync
Message:

VMM,Devices,Main: Implemented soft/warm reset for shutdown status codes 05h, 09h and 0Ah.

This is a shot at adjusting our VM reset handling to handle the ancient way of
getting a 286 out of protected mode and back to real mode. Our exiting reset
code (XXXR3Reset, PDMDEVREG::pfnReset, and so on) is doing a cold reset of the
system and then some additional device & memory initialization that the firmware
is usually responsible for doing. When the guest triggers a reset via the
keyboard controller, system control port A, CPU triple fault, and possibly ACPI,
only the CPU is supposed to be reset. The BIOS would then decide whether memory
and devices needed resetting as well, or if the resetter justed wanted to get out
protected mode and resume executing some real mode code pointed to by 467h.

  • New states SOFT_RESETTING and SOFT_RESETTING_LS. The latter returns to RUNNING_LS, not SUSPENDED_LS like for hard reset.
  • Added a firmware interface so the VMM/PDM can ask it whether we're supposed to do a hard reset or a soft(/warm) one.
  • Implemented firmware interface for the PC BIOS (but not EFI). It indicates soft(/warm) reset when CMOS[0xf] is 5, 9 or 10.
  • Moved the CMOS[0xf] resetting from the RTC device to the PC BIOS since it's firmware thing, not RTC.
  • Added a flag parameter to PDMDevHlpVMReset for specifying the source of the reset operation. One class of sources (GIM) will always trigger hard resets, whereas the others will check with the firmware first.
  • Added PDMR3GetResetInfo for query the flags passed to PDMDevHlpVMReset and for asking the firmware whether it's a hard or soft reset. The latter, however, is only done if only CPU 0 is active. Systems with more than one CPU in a state other than EMSTATE_WAIT_SIPI status will always be hard reset.
  • Added internal VMR3ResetFF and VMR3ResetTripleFault APIs for handling the VM_FF_RESET and VINF_EM_TRIPLE_FAULT conditions.
  • Added PMDR3ResetSoft and had it call pfnSoftReset (which is now defined).

Warning! Major PDM_DEVHLPR3_VERSION change, minor PDM_DEVREG_VERSION change.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/PDMInternal.h

    r60399 r60404  
    676676/** Maximum number of PCI busses for a VM. */
    677677#define PDM_PCI_BUSSES_MAX 8
     678
     679
     680#ifdef IN_RING3
     681/**
     682 * PDM registered firmware device.
     683 */
     684typedef struct PDMFW
     685{
     686    /** Pointer to the firmware device instance. */
     687    PPDMDEVINSR3                    pDevIns;
     688    /** Copy of the registration structure. */
     689    PDMFWREG                        Reg;
     690} PDMFW;
     691/** Pointer to a firmware instance. */
     692typedef PDMFW *PPDMFW;
     693#endif
     694
    678695
    679696/**
     
    10851102    /** List of registered drivers. (FIFO) */
    10861103    R3PTRTYPE(PPDMDRV)              pDrvs;
    1087 #if HC_ARCH_BITS == 32
    1088     RTR3PTR                         uPadding0; /**< Alignment padding. */
    1089 #endif
     1104    /** The registered firmware device (can be NULL). */
     1105    R3PTRTYPE(PPDMFW)               pFirmware;
    10901106    /** PCI Buses. */
    10911107    PDMPCIBUS                       aPciBuses[PDM_PCI_BUSSES_MAX];
     
    11221138    uint32_t volatile               uIrqTag;
    11231139
     1140    /** Pending reset flags (PDMVMRESET_F_XXX). */
     1141    uint32_t volatile               fResetFlags;
     1142    /** Alignment padding. */
     1143    uint32_t volatile               u32Padding;
     1144
    11241145    /** The tracing ID of the next device instance.
    11251146     *
     
    12171238extern const PDMAPICHLPR3   g_pdmR3DevApicHlp;
    12181239extern const PDMIOAPICHLPR3 g_pdmR3DevIoApicHlp;
     1240extern const PDMFWHLPR3     g_pdmR3DevFirmwareHlp;
    12191241extern const PDMPCIHLPR3    g_pdmR3DevPciHlp;
    12201242extern const PDMDMACHLP     g_pdmR3DevDmacHlp;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette