Output Configuration

The extension always recognizes any existing hardware configuration it finds on the target. There are several alternatives for an output configuration:

  • BIOS / UEFI firmware: with firmware that is Intel® PT-aware, you can set up an Intel® PT-specific memory allocation. In this case, the firmware allocates a dedicated memory area and reserves it in a memory map for further use. Operating systems recognize this reserved memory range and do not use it. When the firmware reserves a memory region for Intel® PT, it also configures the Intel® PT output MSRs accordingly and indicates that Intel® PT output configuration is ready to be used. The extension recognizes this setup. No further configuration (from the user’s side) is required.

  • Windows* /burnmemory or /maxmem boot parameter, or the truncatememory or removememory boot configuration data (BCD) option: with these boot parameters or BCD options, it is possible to reserve memory above a certain specified address, so that it is not used by the kernel. For more information on how to use this configuration, refer to the MSDN article Boot Parameters to Manipulate Memory. When this memory reservation technique is used, the Intel® PT hardware needs to be configured accordingly through the !setoutputconfig command (see below).

  • Windows* (BCD) with a {badmemory} object and its badmemorylist value: the BCD can hold a special {badmemory} object that describes a defective RAM. The object’s badmemorylist value contains a list of page frame numbers (PFNs) not used when Windows* allocates physical memory. Because the kernel treats all entries on that list the same, this mechanism can be used to reserve arbitrary page frames that are not defective. The kernel does not use those frames. When this memory reservation technique is used, the Intel® PT hardware needs to be configured accordingly through the !setoutputconfig command (see below).

    To use this feature, run the command-line interface (CLI) with the administrator rights and issue the following commands:

    bcdedit /set badmemoryaccess no
    bcdedit /set badmemorylist <list of PFNs, space-delimited>

    PFN is the number of the page frame, not its (base) address. For example, the PFNs for addresses 0x1000 and 0x1234abc are 0x1 and 0x1234.

The !setoutputconfig command creates a simple output configuration fitting into a specified memory range and programs the Intel® PT hardware accordingly. You can specify the memory range by giving a start address and a size. It is assumed that this memory can be exclusively used by the Intel® PT hardware, and no other entity (for example, the operating system or any other software) reserves and uses it.

!setoutputconfig [/here] /start <expr> /size <expr>
/start <expr> - Start address of available buffer
/size <expr> - Size of available buffer
/here - Create and set output configuration on the currently selected processor only

When the /here option is not set (default), the extension creates an overall output configuration in which all the processors have the same buffer size and the provided memory range is used to its maximum. Also, the extension correctly aligns the output buffers. When the /here option is set, the extension searches for the largest supported buffer size under correct alignment that fits into the specified memory range and programs the current processor’s Intel® PT hardware to use it.

For more complete information about compiler optimizations, see our Optimization Notice.