WO2013003177A1 - Secure and virtualizable performance counters - Google Patents

Secure and virtualizable performance counters Download PDF

Info

Publication number
WO2013003177A1
WO2013003177A1 PCT/US2012/043450 US2012043450W WO2013003177A1 WO 2013003177 A1 WO2013003177 A1 WO 2013003177A1 US 2012043450 W US2012043450 W US 2012043450W WO 2013003177 A1 WO2013003177 A1 WO 2013003177A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage element
software module
contents
match
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/US2012/043450
Other languages
French (fr)
Inventor
Andrew G. Kegel
Stephen D. Glaser
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced Micro Devices Inc
Original Assignee
Advanced Micro Devices Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced Micro Devices Inc filed Critical Advanced Micro Devices Inc
Publication of WO2013003177A1 publication Critical patent/WO2013003177A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data

Definitions

  • the invention is related to computing systems and more particularly to performance counters of computing systems.
  • a computing system adjusts operational parameters (e.g., hardware and software parameters) to improve performance.
  • operational parameters e.g., hardware and software parameters
  • the hardware typically provides one or more performance counters to track the occurrence of corresponding events or indicators of hardware performance.
  • User-level processes are typically blocked from accessing those performance counters based on a corresponding privilege level.
  • a typical non-virtualized system Fig. 1
  • the operating system monitors the performance counters and adjusts the system accordingly.
  • a virtual machine monitor i.e., hypervisor
  • monitors the performance counters and adjusts the system accordingly Only the virtual machine monitor or the operating system can access the performance counters, not both.
  • a user-level process cannot access the performance counters to prevent a user-level process from having access to system information that may be used to subvert system security measures.
  • user-level access to performance counters may be used as a backdoor to communicate information through an unauthorized channel
  • the counters may be used by less-privileged software to gain unauthorized information about more privileged software
  • the performance counters may be used to mount a denial-of-service attack against other software.
  • the requirement that only the most privileged software can access performance counters limits the performance information that is available to other, less-privileged software.
  • the less-privileged software may receive performance information from the more privileged software layers using, e.g., software emulation, system calls, or hypercalls, which are all operations that have significant performance costs that result in poorly resolved or late information, causing improper application of policies and thus reduced system
  • Performance information may not be available at all to the less-privileged software, leaving the less-privileged software unable to modify its operational parameters in response to dynamic system changes, resulting in degraded performance.
  • a method includes updating contents of a value storage element indicating a number of occurrences of an event. The updating is based on contents of a match storage element storing event qualification information.
  • the method includes providing the contents of the value storage element to a first software module executing on at least one processor. The providing is based on contents of a protect storage element indicating access information.
  • the method includes executing a first software module on the at least one processor in a first mode of operation.
  • the method includes executing a second software module on the at least one processor in a second mode of operation. In at least one embodiment, the second mode is more privileged than the first mode.
  • the second software module may be a virtual machine monitor or a guest executing under control of a virtual machine monitor.
  • the method may include configuring the protect storage element to allow access of the match storage element to the first software module in the second mode of operation.
  • the method may include configuring the protect storage element to allow read access of the value storage element to the first software module in the second mode of operation.
  • the method may include updating an operational parameter by the first software module based on contents of the value storage element, wherein the first software module has only user- level privileges.
  • the method may include configuring the protect storage element by a second software module executing on the at least one processor.
  • the method may include resetting the value storage element by the second software module.
  • the method may include configuring the match storage element and the attribute storage element by the first software module, the first software module being less privileged than the second software module.
  • the method may include configuring the match storage element and the attribute storage element by the second software module.
  • the method may include prohibiting access of the first software module to the match storage element.
  • the contents of the match storage element may indicate a device corresponding to the event and the updating is further based on contents of an attribute storage element containing an indication of a type of the event.
  • the event may be a translation lookaside buffer hit, an interrupt, a page fault, or a cache hit.
  • the event may be an input/output memory management unit (IOMMU) event.
  • an apparatus includes a match storage element configured to store event qualification information.
  • the apparatus includes a value storage element configured to accumulate occurrences of an event in response to an indicator indicating detection of the event based on contents of the match storage element.
  • the apparatus includes a protect storage element configured to store information indicating access to the value storage element by a software module executing on at least one processor.
  • the apparatus includes a control module configured to provide, to the software module, read access to contents of the value storage element based on contents of the protect storage element.
  • the apparatus may include a detection module configured to generate the indicator in response to detecting the event based on contents of the match storage element.
  • the control module may be further configured to provide, to the software module, write access to the match storage element based on the contents of the protect storage element.
  • the match storage element may be configured to indicate a device corresponding to the event being counted.
  • the apparatus may include an attribute storage element configured to store additional event qualification information.
  • the detection module may be configured to generate the indicator further based on contents of the attribute storage element.
  • the attribute storage element may be configured to indicate that the event is a translation lookaside buffer hit, an interrupt, a page fault, or a cache hit.
  • the apparatus may include at least one processor operable to execute a second software module in a first mode of a virtualized processing system and operable to execute the software module in a second mode of the virtualized processing system, the first mode being more privileged than the second mode.
  • the second software module may be executable to configure the protect storage element and the match storage element.
  • the apparatus may form a portion of an input/output memory management unit (IOMMU).
  • IOMMU input/output memory management unit
  • a tangible computer-readable medium encodes a representation of an integrated circuit that comprises a match storage element configured to store event qualification information.
  • the apparatus includes a value storage element configured to accumulate occurrences of an event in response to an indicator indicating detection of the event based on contents of the match storage element.
  • the apparatus includes a protect storage element configured to store information indicating access to the value storage element by a software module executing on at least one processor.
  • the apparatus includes a control module configured to provide, to the software module, read access to contents of the value storage element based on contents of the protect storage element.
  • the integrated circuit may include a detection module configured to generate the indicator in response to detecting the event based on contents of the match storage element.
  • the integrated circuit may include an attribute storage element configured to store additional event qualification information and the detection module may be configured to generate the indicator further based on contents of the attribute storage element.
  • a computer program product encoded in one or more tangible machine -readable media includes a first sequence of instructions executable with a first privilege level to configure a match storage element to store event qualification information.
  • the computer program product includes a second sequence of instructions executable with the first privilege level to update an operating parameter of a system executing the computer program product based on contents of a value storage element configured to accumulate occurrences of an event detected based on contents of the match storage element.
  • the computer program product may include a third sequence of instructions executable with a second privilege level, the second privilege level being higher than the user privilege level, the third sequence of instructions being executable to configure a protect storage element to store information indicating access to the value storage element by a sequence of instructions executable with the user privilege level.
  • the event may be associated with an input/output memory management unit (IOMMU) event.
  • IOMMU input/output memory management unit
  • a computer program product encoded in one or more tangible machine -readable media includes a first sequence of instructions executable with a privilege level higher than a user privilege level.
  • the first sequence of instructions is executable to configure a protect storage element to store information indicating access to a value storage element.
  • the first sequence of instructions is executable to configure a match storage element by a sequence of instructions executable with the user privilege level.
  • the event may be associated with an input/output memory management unit (IOMMU) event.
  • IOMMU input/output memory management unit
  • Fig. 1 illustrates a block diagram of software module access to performance counters in an exemplary non-virtualized processing system.
  • Fig. 2 illustrates a block diagram of software module access to performance counters in an exemplary virtualized processing system.
  • Fig. 3 illustrates a block diagram of an exemplary processing system consistent with at least one embodiment of the invention.
  • Fig. 4 illustrates a block diagram of an exemplary virtualized processing system consistent with at least one embodiment of the invention.
  • Fig. 5 illustrates a block diagram of an exemplary performance counter module and related modules consistent with at least one embodiment of the invention.
  • Fig. 6 illustrates a block diagram of an exemplary set of storage elements of the
  • a technique for providing secure and virtualizable performance counters facilitates access to the performance counters by software modules having different privilege levels.
  • a software module is a program, process, or procedure that includes a set of instructions for controlling one or more portions of a computing system.
  • Event count information is stored and managed by a performance counter module that includes value registers (i.e., storage elements) and associated control registers.
  • the technique provides user-level software modules, as well as higher-privileged software modules, efficient access to performance information, which allows those software modules to respond quickly and precisely to system operational changes.
  • an exemplary processing system includes at least one processor (i.e., central processing unit, digital signal processor, graphics processor, e.g., processors 102) that includes one or more processor cores (i.e., cores, e.g., processor cores 104).
  • processors 102 are coupled to other processors 102, memory 106, devices 108, and storage 110 directly or by one or more hub integrated circuits (e.g., memory controller hub and I/O controller hub), bus (e.g., PCI bus, ISA bus, and SMBus), other suitable communication interfaces, or combinations thereof.
  • processors 102 are coupled to other processors 102, memory 106, devices 108, and storage 110 directly or by one or more hub integrated circuits (e.g., memory controller hub and I/O controller hub), bus (e.g., PCI bus, ISA bus, and SMBus), other suitable communication interfaces, or combinations thereof.
  • hub integrated circuits e.g., memory controller hub and I/O controller hub
  • bus
  • processors 102 are coupled to main memory via a memory management unit (e.g., MMU 107).
  • the memory management unit coordinates memory accesses between processors 102 (e.g., a central processing unit, digital signal processor, and/or graphics processor) and memory 106.
  • Functions of the MMU include translation of virtual addresses to physical addresses, memory protection, cache control, and bus arbitration.
  • the MMU provides hardware performance information to software executing on a processor (e.g., a central processing unit, digital signal processor, or graphics processor) that manages the MMU.
  • the software uses that hardware performance information to adjust operational parameters of the hardware and the software to obtain improved performance.
  • the hardware performance information includes statistics regarding use of in-chip cache memory.
  • the software reports that information to the programmer, which uses the information to modify software code to utilize the cache more efficiently.
  • the hardware performance information includes a number of soft error correction code errors, which is used by software to determine when to recommend replacement of failing memory.
  • the hardware performance information includes thermal information that software uses to adjust a workload to maintain operating temperature within a particular temperature range.
  • An operating system e.g., Microsoft Windows, Linux, and UNIX
  • An operating system e.g., Microsoft Windows, Linux, and UNIX
  • provides an interface between the hardware and a user i.e., computing applications, e.g., application code 114 executing on one or more of processors 102).
  • Execution of system software may be distributed across a plurality of processors 102 and/or cores 104.
  • virtualization of a computing system hides physical characteristics of the computing system from a user or guest (i.e., software executing on the computing system) and instead, presents an abstract emulated computing system (i.e., a virtual machine (VM)) to the user or guest.
  • VM virtual machine
  • Physical hardware resources of processing system 100 are exposed to one or more users or guests (e.g., guests 206) as one or more corresponding isolated, apparently independent, virtual machines (e.g., VM 204).
  • a virtual machine may include one or more virtual resources (e.g., VCPU, VMEMORY, and VDEVICES) that are implemented by physical resources of processing system 100 that a virtual machine monitor (VMM) (i.e., hypervisor, e.g., VMM 202) allocates to the virtual machine.
  • VMM virtual machine monitor
  • hypervisor e.g., VMM 202
  • hypervisor e.g., VMM 202
  • a Type 1 (i.e., native) VMM is a standalone software program that executes on physical resources and provides the virtualization for one or more guests.
  • a guest operating system executes on a level above the VMM.
  • a Type 2 (i.e., hosted) VMM is integrated into or executes on an operating system, the operating system components execute directly on physical resources and are not virtualized by the VMM.
  • the VMM is considered a distinct software layer and a guest operating system may execute on a third software level above the hardware. Techniques described herein may be implemented using a Type 1 VMM, a Type 2 VMM or other suitable VMM.
  • VMM 202 retains control over the physical resources.
  • a guest system e.g., an instance of an operating system (e.g., Windows, Linux, and UNIX) executes on a corresponding virtual machine and shares physical resources with other guest systems executing on other virtual machines.
  • an operating system e.g., Windows, Linux, and UNIX
  • multiple operating systems can co- exist on the same computing system, but in isolation from each other.
  • VMM 202 is executed by some or all processor cores in the physical resources of processing system 200.
  • An individual guest 206 is executed by one or more of the processor cores included in the physical resources.
  • the processors switch between execution of VMM 202 and execution of one or more guests 206.
  • a "world switch” is a switch between execution of a guest (i.e., a software module executing in a guest mode of processing system 200) and execution of a host (i.e., a software module executing in a privileged or host mode of processing system 200, e.g., executing VMM 202) or vice versa.
  • a world switch may be initiated by a VMRUN instruction of an AMD Secure Virtual Machine, a VMLAUNCH or
  • VMRESUME virtual machine extension instruction of an Intel virtual machine interrupt mechanisms, exception mechanisms, predetermined instructions defined by a control block (e.g., VMMCALL), or by other suitable technique.
  • a current processor environment e.g., processor core(s) executing guest 206 in guest mode or executing VMM 202 in host mode
  • a target processor environment e.g., processor core(s) executing VMM 202 in host mode or executing guest 206 in guest mode
  • VMM 202 initiates a world switch when VMM 202 executes a guest 206 that was scheduled for execution.
  • a world switch from executing guest 206 to executing VMM 202 is made when VMM 202 exercises control over physical resources, e.g., when guest 206 attempts to access a peripheral device, when guest 206 attempts to access a performance counter, when a new page of memory is to be allocated to guest 206, or when it is time for VMM 202 to schedule another guest 206, etc.
  • a typical world switch can take thousands of cycles.
  • Virtualization techniques may be implemented using only software (which includes firmware) or by a combination of software and hardware (which includes microcode).
  • some processors include virtualization hardware, which allows simplification of VMM code and improves system performance for full virtualization (e.g., hardware extensions for virtualization provided by AMD-V and Intel VT-x).
  • AMD-V is an AMD64 extension that effectively provides a super-privileged operating mode in which a VMM can control a guest operating system.
  • IOMMU 105 is an MMU that couples a Direct Memory Access (DMA) capable input/output (I/O) bus to memory 106.
  • DMA Direct Memory Access
  • I/O input/output
  • MMU 107 translates processor-visible virtual addresses to physical addresses.
  • IOMMU 105 translates device-visible virtual addresses (i.e., device addresses or I/O addresses) to physical addresses.
  • DMA Direct Memory Access
  • IOMMU 105 translates device-visible virtual addresses (i.e., device addresses or I/O addresses) to physical addresses.
  • IOMMU 105 provides DMA address translation and permission checking for device reads and writes. IOMMU 105 allows an unmodified driver in a guest OS to directly access a target device, without the overhead of running through a VMM (i.e., without a world switch) and without device emulation. In at least one embodiment, IOMMU 105 translates addresses from device requests in system memory addresses and checks appropriate permissions on each access to provide memory protection from misbehaving devices. In at least one embodiment, IOMMU 105 is included as part of a HyperTransportTM or PCI bridge device. Embodiments of system 100 that include multiple HyperTransportTM links between processors and I/O hubs also include multiple IOMMUs.
  • IOMMU 105 assigns each of device(s) 108 a protection domain that defines I/O page translations used for each device in the domain.
  • the protection domain specifies access permissions for each I/O page.
  • VMM 202 assigns all devices assigned to a particular guest operating system 208 the same protection domain, which creates a consistent set of address translations and access restrictions used by all devices running under control of the particular guest operating system 208.
  • VMM 202 configures I/O page tables to map system physical addresses to guest physical addresses, configures a protection domain for guest operating system 208, and then allows guest operating system 208 to execute.
  • IOMMU 105 includes performance counter module 500, which facilitates secure and virtualizable performance counters.
  • performance counter module 500 is located in a separate module coupled between IOMMU and memory 106. Referring to Fig. 5, in at least one embodiment, performance counter module 500 includes multiple sets of registers (i.e., multiple sets of storage elements, e.g., register sets 530) and associated circuits (e.g., control module 502 and detection module 504) that are configured to be secure and virtualizable performance counters.
  • each set of registers is associated with special, known addresses.
  • each set of registers is associated with special, known offsets from a base address associated with IOMMU 105.
  • the register sets are memory-mapped I/O. Properties of the virtual memory management subsystem are used to set permissions to protect access to those registers. For example, the performance counters may be aligned at memory address boundaries that match the memory page granularity (e.g., 4 kilobyte (KB) page boundaries for an x86 architecture).
  • the memory address boundaries can have any values that align with page-protection granularity of the host system (e.g., 512 bytes, 8 KB, or 2 megabytes (MB)).
  • This allows privileged software to independently assign individual sets of performance counters to particular software components.
  • a set of performance counters e.g., SET 0
  • one or more other sets of performance counters e.g., SET 1
  • still other sets of performance counters e.g., SET 2...N
  • virtual machine monitor 202 allocates the sets of performance counters dynamically and arbitrarily, i.e., any particular set of performance counters can be assigned to any particular software module, and the allocation can be changed during system operation.
  • an individual register set 530 includes a count register (e.g., value register 506) and at least one corresponding control register (e.g., match register 508 and match register 510) that software uses to specify which event(s) to count using the particular performance counter.
  • value register 506 is configured to accumulate performance information based on the contents of at least one corresponding match register 508.
  • a module e.g., control module 502, which may include hardware and/or firmware
  • configures hardware e.g., register set 530 and detection module 504 to select events to be counted based on configuration information received from software.
  • an application 210, an operating system 208, or virtual machine monitor 202 executing on one or more of processors 102 may include instructions for at least partially configuring a register set 530 as part of a performance counter. Execution of those instructions communicates
  • control module 502 for configuration of register set 530 for a particular software module.
  • match register 508 is configured to select a particular device for events that are counted based on a device identifier (DevicelD).
  • match register 510 is configured to select a Process Address Space Identifier (PASID) that is used to identify an application address space within an x86-canonical guest virtual machine. It is used on a peripheral to isolate concurrent contexts residing in a shared local memory. Together, the PASID and DevicelD information uniquely identify an application address space. Note that use of the PASID and DevicelD for specifying an event to be counted is exemplary only and the match register(s) may be configured for events qualified based on additional or other criterion.
  • PASID Process Address Space Identifier
  • the match registers include a field that can be used to cause the hardware to ignore actual comparison results and always indicate no match. That field may be used to disable counting of events (e.g., temporarily).
  • the match registers include a field that can be used to cause the hardware to ignore actual comparison results and always indicate a match. That field is useful to match on all PASID values or match on all Device ID values.
  • the match registers include a filter field that causes the hardware to ignore certain bits of a field in a comparison. That field is useful to count events for select groups of values (e.g., count events for all PASID values from 0 through 6, inclusively, or count events for all DevicelDs from 0 to 127).
  • the match registers include a min and/or max field so that the comparison is for a range of values, as programmed by software. Note that combinations of multiple match registers may be configured in complex ways to at least partially determine an event to be counted.
  • each performance counter is associated with one or more attribute registers (e.g., attribute register 514) that is configured to select the type of event to be counted for the device specified by one or more corresponding match registers (e.g., match register 508 and match register 510).
  • attribute register may indicate that the event is a hit of a Translation Lookaside Buffer (TLB) of the IOMMU for a selected value of a DevicelD and a selected value of PASID.
  • TLB Translation Lookaside Buffer
  • Other events that may be counted include a number of interrupts, a number of page faults, a number of instructions executed, a number of I/O operations processed, and a number of times an attempt to read memory is satisfied by a cache.
  • those parameters e.g., one or more of the contents of the match registers and attribute registers
  • are locked e.g., a user-level process is not allowed to change the
  • protection above and beyond the protection provided by memory page access controls includes providing one or more protect registers (e.g., protect register 516 and protect register 518) that indicate to control module 502 whether or not a particular register of register set 530 can be changed or viewed by a particular software module.
  • at least one protect register is configured to determine whether or not value register 506, match register 508, match register 510, and/or attribute register 514 can be modified by a particular software module.
  • the protect registers allow more privileged software to decide which devices and registers may be viewed and/or changed by less privileged software modules. Access control can be provided on a register- by-register basis.
  • one or more protect registers controls whether or not the corresponding match register can be written by a particular software module.
  • a read of the match register by a particular software module may be obscured by control module 502 based on contents of the protect register(s).
  • virtual machine monitor 202 retains control over the protect register(s) and determines whether or not a particular software module (e.g., a guest operating system or a user-level process) may view or change the corresponding match register(s) of the register set for the performance counter.
  • a protect register is configured to prevent a user-level process from directly changing either the PASID or DevicelD programmed into the match registers unless the process makes the change request via the associated operating system.
  • a protect register is configured to prevent a guest operating system from changing the DevicelD programmed into a match register unless it makes the change request via the virtual machine monitor, but is configured to allow change to the PASID programmed into a corresponding match register.
  • one or more protect registers are configured to allow virtual machine monitor 202 to change the contents of any register in register set 530 and can do so by retaining control of the associated protect register(s).
  • detection module 504 compares the contents of an IOMMU instruction buffer to the contents of at least one control register (e.g., match register) in register set 503. If detection module 504 detects a match for those control registers associated with a particular value register for a current event consistent with any corresponding attribute register, then the event is detected and detection module 504 updates the value register accordingly (e.g., increments or decrements the value register according to the design of the value register).
  • the contents of the value register are made accessible to one or more software modules by the IOMMU and/or based on any corresponding protect register of performance module 500. The software module may then use the information in the value register to update system parameters.
  • performance counter module 500 allows different software modules to receive performance information that is of interest to the particular software module and/or according to the privilege level of that software module.
  • Those register sets 530 and associated modules e.g., control module 502 and detection module 504 provide fast access to the most current information to software modules having different levels of privilege, while reducing or preventing opportunities for less privileged processes to perturb this information.
  • the techniques described herein may be applied to additional levels of privilege and domains of isolation.
  • the techniques described herein allow less-privileged software to efficiently and quickly access IOMMU performance counter information with relatively low overhead (i.e., the cost of a hardware access rather than the cost of software-mediated access, which may require a world switch). Meanwhile, the virtual machine monitor and operating system retain control of changes to the information, thereby maintaining system isolation and protection properties. Instead of taking dozens, hundreds, or even thousands of instructions to read or change performance information, a read of performance information consistent with the techniques described herein only takes a few cycles.
  • performance counter module 500 allows those threads and user-level processes to efficiently access performance information and respond quickly and precisely to system operational changes. While circuits and physical structures have been generally presumed in describing embodiments of the invention, it is well recognized that in modern semiconductor design and fabrication, physical structures and circuits may be embodied in computer-readable descriptive form suitable for use in subsequent design, simulation, test or fabrication stages.
  • circuits, systems of circuits, related methods, and tangible computer-readable medium having encodings thereon e.g., VHSIC Hardware Description Language (VHDL), Verilog, GDSII data, Electronic Design Interchange Format (EDIF), and/or Gerber file
  • VHDL VHSIC Hardware Description Language
  • Verilog Verilog
  • GDSII data GDSII data
  • EDIF Electronic Design Interchange Format
  • Gerber file e.g., Gerber file
  • the computer-readable media may store instructions as well as data that can be used to implement the invention.
  • the instructions/data may be related to hardware, software, firmware or combinations thereof.
  • Structures described herein may be implemented using software executing on a processor (which includes firmware) or by a combination of software and hardware.
  • Software, as described herein, may be encoded in at least one tangible computer readable medium.
  • a tangible computer-readable medium includes at least a disk, tape, or other magnetic, optical, or electronic storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Debugging And Monitoring (AREA)

Abstract

A method includes updating contents of a value storage element indicating a number of occurrences of an event. The updating is based on contents of a match storage element storing event qualification information. The method includes providing the contents of the value storage element to a first software module executing on at least one processor. The providing is based on contents of a protect storage element indicating access information. In at least one embodiment, the method includes executing a first software module on the at least one processor in a first mode of operation. In at least one embodiment, the method includes executing a second software module on the at least one processor in a second mode of operation. In at least one embodiment, the second mode is more privileged than the first mode.

Description

SECURE AND VIRTU ALIZABLE PERFORMANCE COUNTERS
BACKGROUND
Technical Field
The invention is related to computing systems and more particularly to performance counters of computing systems.
Background Art
In general, a computing system adjusts operational parameters (e.g., hardware and software parameters) to improve performance. However, policies and computations may be so complex that software, rather than hardware, is used to adjust those operational parameters. The hardware typically provides one or more performance counters to track the occurrence of corresponding events or indicators of hardware performance. User-level processes are typically blocked from accessing those performance counters based on a corresponding privilege level. In a typical non-virtualized system (Fig. 1), the operating system monitors the performance counters and adjusts the system accordingly. In a typical virtualized system (Fig. 2), a virtual machine monitor (i.e., hypervisor) monitors the performance counters and adjusts the system accordingly. Only the virtual machine monitor or the operating system can access the performance counters, not both. In general, a user-level process cannot access the performance counters to prevent a user-level process from having access to system information that may be used to subvert system security measures.
Otherwise, user-level access to performance counters may be used as a backdoor to communicate information through an unauthorized channel, the counters may be used by less-privileged software to gain unauthorized information about more privileged software, and/or the performance counters may be used to mount a denial-of-service attack against other software. The requirement that only the most privileged software can access performance counters limits the performance information that is available to other, less-privileged software. The less-privileged software may receive performance information from the more privileged software layers using, e.g., software emulation, system calls, or hypercalls, which are all operations that have significant performance costs that result in poorly resolved or late information, causing improper application of policies and thus reduced system
performance. Performance information may not be available at all to the less-privileged software, leaving the less-privileged software unable to modify its operational parameters in response to dynamic system changes, resulting in degraded performance.
DISCLOSURE OF INVENTION
In at least one embodiment of the invention, a method includes updating contents of a value storage element indicating a number of occurrences of an event. The updating is based on contents of a match storage element storing event qualification information. The method includes providing the contents of the value storage element to a first software module executing on at least one processor. The providing is based on contents of a protect storage element indicating access information. In at least one embodiment, the method includes executing a first software module on the at least one processor in a first mode of operation. In at least one embodiment, the method includes executing a second software module on the at least one processor in a second mode of operation. In at least one embodiment, the second mode is more privileged than the first mode. The second software module may be a virtual machine monitor or a guest executing under control of a virtual machine monitor. The method may include configuring the protect storage element to allow access of the match storage element to the first software module in the second mode of operation. The method may include configuring the protect storage element to allow read access of the value storage element to the first software module in the second mode of operation. The method may include updating an operational parameter by the first software module based on contents of the value storage element, wherein the first software module has only user- level privileges. The method may include configuring the protect storage element by a second software module executing on the at least one processor. The method may include resetting the value storage element by the second software module. The method may include configuring the match storage element and the attribute storage element by the first software module, the first software module being less privileged than the second software module. The method may include configuring the match storage element and the attribute storage element by the second software module. The method may include prohibiting access of the first software module to the match storage element. The contents of the match storage element may indicate a device corresponding to the event and the updating is further based on contents of an attribute storage element containing an indication of a type of the event. The event may be a translation lookaside buffer hit, an interrupt, a page fault, or a cache hit. The event may be an input/output memory management unit (IOMMU) event. In at least one embodiment of the invention, an apparatus includes a match storage element configured to store event qualification information. The apparatus includes a value storage element configured to accumulate occurrences of an event in response to an indicator indicating detection of the event based on contents of the match storage element. The apparatus includes a protect storage element configured to store information indicating access to the value storage element by a software module executing on at least one processor. The apparatus includes a control module configured to provide, to the software module, read access to contents of the value storage element based on contents of the protect storage element. The apparatus may include a detection module configured to generate the indicator in response to detecting the event based on contents of the match storage element. The control module may be further configured to provide, to the software module, write access to the match storage element based on the contents of the protect storage element. The match storage element may be configured to indicate a device corresponding to the event being counted. The apparatus may include an attribute storage element configured to store additional event qualification information. The detection module may be configured to generate the indicator further based on contents of the attribute storage element. The attribute storage element may be configured to indicate that the event is a translation lookaside buffer hit, an interrupt, a page fault, or a cache hit. The apparatus may include at least one processor operable to execute a second software module in a first mode of a virtualized processing system and operable to execute the software module in a second mode of the virtualized processing system, the first mode being more privileged than the second mode. The second software module may be executable to configure the protect storage element and the match storage element. The apparatus may form a portion of an input/output memory management unit (IOMMU). In at least one embodiment of the invention, a tangible computer-readable medium encodes a representation of an integrated circuit that comprises a match storage element configured to store event qualification information. The apparatus includes a value storage element configured to accumulate occurrences of an event in response to an indicator indicating detection of the event based on contents of the match storage element. The apparatus includes a protect storage element configured to store information indicating access to the value storage element by a software module executing on at least one processor. The apparatus includes a control module configured to provide, to the software module, read access to contents of the value storage element based on contents of the protect storage element. The integrated circuit may include a detection module configured to generate the indicator in response to detecting the event based on contents of the match storage element. The integrated circuit may include an attribute storage element configured to store additional event qualification information and the detection module may be configured to generate the indicator further based on contents of the attribute storage element.
In at least one embodiment of the invention, a computer program product encoded in one or more tangible machine -readable media includes a first sequence of instructions executable with a first privilege level to configure a match storage element to store event qualification information. The computer program product includes a second sequence of instructions executable with the first privilege level to update an operating parameter of a system executing the computer program product based on contents of a value storage element configured to accumulate occurrences of an event detected based on contents of the match storage element. The computer program product may include a third sequence of instructions executable with a second privilege level, the second privilege level being higher than the user privilege level, the third sequence of instructions being executable to configure a protect storage element to store information indicating access to the value storage element by a sequence of instructions executable with the user privilege level. The event may be associated with an input/output memory management unit (IOMMU) event.
In at least one embodiment of the invention, a computer program product encoded in one or more tangible machine -readable media includes a first sequence of instructions executable with a privilege level higher than a user privilege level. The first sequence of instructions is executable to configure a protect storage element to store information indicating access to a value storage element. The first sequence of instructions is executable to configure a match storage element by a sequence of instructions executable with the user privilege level. The event may be associated with an input/output memory management unit (IOMMU) event.
BRIEF DESCRIPTION OF DRAWINGS
The present invention may be better understood, and its numerous objects, features, and advantages made apparent to those skilled in the art by referencing the accompanying drawings. Fig. 1 illustrates a block diagram of software module access to performance counters in an exemplary non-virtualized processing system. Fig. 2 illustrates a block diagram of software module access to performance counters in an exemplary virtualized processing system.
Fig. 3 illustrates a block diagram of an exemplary processing system consistent with at least one embodiment of the invention. Fig. 4 illustrates a block diagram of an exemplary virtualized processing system consistent with at least one embodiment of the invention.
Fig. 5 illustrates a block diagram of an exemplary performance counter module and related modules consistent with at least one embodiment of the invention.
Fig. 6 illustrates a block diagram of an exemplary set of storage elements of the
performance counter module of Fig. 5 consistent with at least one embodiment of the invention.
The use of the same reference symbols in different drawings indicates similar or identical items.
MODE(S) FOR CARRYING OUT THE INVENTION
A technique for providing secure and virtualizable performance counters facilitates access to the performance counters by software modules having different privilege levels. As referred to herein, a software module is a program, process, or procedure that includes a set of instructions for controlling one or more portions of a computing system. Event count information is stored and managed by a performance counter module that includes value registers (i.e., storage elements) and associated control registers. The technique provides user-level software modules, as well as higher-privileged software modules, efficient access to performance information, which allows those software modules to respond quickly and precisely to system operational changes.
Referring to Fig. 3, an exemplary processing system (e.g., processing system 100) includes at least one processor (i.e., central processing unit, digital signal processor, graphics processor, e.g., processors 102) that includes one or more processor cores (i.e., cores, e.g., processor cores 104). Processors 102 are coupled to other processors 102, memory 106, devices 108, and storage 110 directly or by one or more hub integrated circuits (e.g., memory controller hub and I/O controller hub), bus (e.g., PCI bus, ISA bus, and SMBus), other suitable communication interfaces, or combinations thereof. In at least one embodiment of processing system 100, processors 102 are coupled to main memory via a memory management unit (e.g., MMU 107). The memory management unit coordinates memory accesses between processors 102 (e.g., a central processing unit, digital signal processor, and/or graphics processor) and memory 106. Functions of the MMU include translation of virtual addresses to physical addresses, memory protection, cache control, and bus arbitration. In addition, the MMU provides hardware performance information to software executing on a processor (e.g., a central processing unit, digital signal processor, or graphics processor) that manages the MMU. The software uses that hardware performance information to adjust operational parameters of the hardware and the software to obtain improved performance. In at least one embodiment of processing system 100, the hardware performance information includes statistics regarding use of in-chip cache memory. The software reports that information to the programmer, which uses the information to modify software code to utilize the cache more efficiently. In at least one embodiment of processing system 100, the hardware performance information includes a number of soft error correction code errors, which is used by software to determine when to recommend replacement of failing memory. In at least one embodiment of processing system 100, the hardware performance information includes thermal information that software uses to adjust a workload to maintain operating temperature within a particular temperature range. An operating system (e.g., Microsoft Windows, Linux, and UNIX) provides an interface between the hardware and a user (i.e., computing applications, e.g., application code 114 executing on one or more of processors 102). Execution of system software (e.g., operating system 112 or VMM code 116) may be distributed across a plurality of processors 102 and/or cores 104. Referring to Fig. 4, virtualization of a computing system hides physical characteristics of the computing system from a user or guest (i.e., software executing on the computing system) and instead, presents an abstract emulated computing system (i.e., a virtual machine (VM)) to the user or guest. Physical hardware resources of processing system 100 are exposed to one or more users or guests (e.g., guests 206) as one or more corresponding isolated, apparently independent, virtual machines (e.g., VM 204). For example, a virtual machine may include one or more virtual resources (e.g., VCPU, VMEMORY, and VDEVICES) that are implemented by physical resources of processing system 100 that a virtual machine monitor (VMM) (i.e., hypervisor, e.g., VMM 202) allocates to the virtual machine. As referred to herein, a "virtual machine monitor" (VMM, e.g., VMM 202) or "hypervisor" is software that provides the virtualization capability. The VMM provides an interface between the user or guest and the physical resources. Typically, the VMM provides each guest the appearance of full control over a complete computer system (i.e., memory, central processing unit (CPU) and all peripheral devices). A Type 1 (i.e., native) VMM is a standalone software program that executes on physical resources and provides the virtualization for one or more guests. A guest operating system executes on a level above the VMM. A Type 2 (i.e., hosted) VMM is integrated into or executes on an operating system, the operating system components execute directly on physical resources and are not virtualized by the VMM. The VMM is considered a distinct software layer and a guest operating system may execute on a third software level above the hardware. Techniques described herein may be implemented using a Type 1 VMM, a Type 2 VMM or other suitable VMM.
Still referring to Fig. 4, while guest 206 has full control over the virtual resources of virtual machine 204, VMM 202 retains control over the physical resources. A guest system, e.g., an instance of an operating system (e.g., Windows, Linux, and UNIX) executes on a corresponding virtual machine and shares physical resources with other guest systems executing on other virtual machines. Thus, multiple operating systems (e.g., multiple instances of the same operating system or instances of different operating systems) can co- exist on the same computing system, but in isolation from each other.
In at least one embodiment of processing system 200, VMM 202 is executed by some or all processor cores in the physical resources of processing system 200. An individual guest 206 is executed by one or more of the processor cores included in the physical resources. The processors switch between execution of VMM 202 and execution of one or more guests 206. As referred to herein, a "world switch" is a switch between execution of a guest (i.e., a software module executing in a guest mode of processing system 200) and execution of a host (i.e., a software module executing in a privileged or host mode of processing system 200, e.g., executing VMM 202) or vice versa. In general, a world switch may be initiated by a VMRUN instruction of an AMD Secure Virtual Machine, a VMLAUNCH or
VMRESUME virtual machine extension instruction of an Intel virtual machine, interrupt mechanisms, exception mechanisms, predetermined instructions defined by a control block (e.g., VMMCALL), or by other suitable technique. During a world switch, a current processor environment (e.g., processor core(s) executing guest 206 in guest mode or executing VMM 202 in host mode) saves its state information and restores state information for a target processor environment (e.g., processor core(s) executing VMM 202 in host mode or executing guest 206 in guest mode) to which the processor execution is switched. For example, VMM 202 initiates a world switch when VMM 202 executes a guest 206 that was scheduled for execution. Similarly, a world switch from executing guest 206 to executing VMM 202 is made when VMM 202 exercises control over physical resources, e.g., when guest 206 attempts to access a peripheral device, when guest 206 attempts to access a performance counter, when a new page of memory is to be allocated to guest 206, or when it is time for VMM 202 to schedule another guest 206, etc. A typical world switch can take thousands of cycles.
Virtualization techniques may be implemented using only software (which includes firmware) or by a combination of software and hardware (which includes microcode). For example, some processors include virtualization hardware, which allows simplification of VMM code and improves system performance for full virtualization (e.g., hardware extensions for virtualization provided by AMD-V and Intel VT-x). For example, AMD-V is an AMD64 extension that effectively provides a super-privileged operating mode in which a VMM can control a guest operating system.
In at least one embodiment of system 100, rather than requiring the VMM to emulate devices to route I/O requests from guest operating system drivers to manage access to common memory space and to restrict real device access to kernel mode drivers, virtualization techniques are further supported by IOMMU 105. IOMMU 105 is an MMU that couples a Direct Memory Access (DMA) capable input/output (I/O) bus to memory 106. As described above, MMU 107 translates processor-visible virtual addresses to physical addresses. Similarly, IOMMU 105 translates device-visible virtual addresses (i.e., device addresses or I/O addresses) to physical addresses. In at least one embodiment,
IOMMU 105 provides DMA address translation and permission checking for device reads and writes. IOMMU 105 allows an unmodified driver in a guest OS to directly access a target device, without the overhead of running through a VMM (i.e., without a world switch) and without device emulation. In at least one embodiment, IOMMU 105 translates addresses from device requests in system memory addresses and checks appropriate permissions on each access to provide memory protection from misbehaving devices. In at least one embodiment, IOMMU 105 is included as part of a HyperTransport™ or PCI bridge device. Embodiments of system 100 that include multiple HyperTransport™ links between processors and I/O hubs also include multiple IOMMUs. In at least one embodiment, IOMMU 105 assigns each of device(s) 108 a protection domain that defines I/O page translations used for each device in the domain. The protection domain specifies access permissions for each I/O page. In at least one embodiment, VMM 202 assigns all devices assigned to a particular guest operating system 208 the same protection domain, which creates a consistent set of address translations and access restrictions used by all devices running under control of the particular guest operating system 208. In at least one embodiment, VMM 202 configures I/O page tables to map system physical addresses to guest physical addresses, configures a protection domain for guest operating system 208, and then allows guest operating system 208 to execute. Drivers written for the real device execute as part of guest operating system 208 unmodified and unaware of underlying translations. Guest operating system transactions are isolated from those of other guests by I/O mapping provided by IOMMU 105. In at least one embodiment, IOMMU 105 includes performance counter module 500, which facilitates secure and virtualizable performance counters. In at least one embodiment of system 200, performance counter module 500 is located in a separate module coupled between IOMMU and memory 106. Referring to Fig. 5, in at least one embodiment, performance counter module 500 includes multiple sets of registers (i.e., multiple sets of storage elements, e.g., register sets 530) and associated circuits (e.g., control module 502 and detection module 504) that are configured to be secure and virtualizable performance counters. In at least one embodiment, each set of registers is associated with special, known addresses. In at least one embodiment of performance counter module 500, each set of registers is associated with special, known offsets from a base address associated with IOMMU 105. In at least one embodiment of performance counter module 500, the register sets are memory-mapped I/O. Properties of the virtual memory management subsystem are used to set permissions to protect access to those registers. For example, the performance counters may be aligned at memory address boundaries that match the memory page granularity (e.g., 4 kilobyte (KB) page boundaries for an x86 architecture). The memory address boundaries can have any values that align with page-protection granularity of the host system (e.g., 512 bytes, 8 KB, or 2 megabytes (MB)). This allows privileged software to independently assign individual sets of performance counters to particular software components. For example, referring to Figs. 2 and 5, a set of performance counters (e.g., SET 0) may be reserved for virtual machine monitor 202, while one or more other sets of performance counters (e.g., SET 1) are reserved for each guest operating system 208, and still other sets of performance counters (e.g., SET 2...N) are reserved for user-level processes 210 of a particular guest operating system 208. In at least one embodiment of system 200, virtual machine monitor 202 allocates the sets of performance counters dynamically and arbitrarily, i.e., any particular set of performance counters can be assigned to any particular software module, and the allocation can be changed during system operation.
Referring to Fig. 6, in at least one embodiment of performance counter module 500, an individual register set 530 includes a count register (e.g., value register 506) and at least one corresponding control register (e.g., match register 508 and match register 510) that software uses to specify which event(s) to count using the particular performance counter. In at least one embodiment, value register 506 is configured to accumulate performance information based on the contents of at least one corresponding match register 508. A module (e.g., control module 502, which may include hardware and/or firmware) configures hardware (e.g., register set 530 and detection module 504) to select events to be counted based on configuration information received from software. For example, an application 210, an operating system 208, or virtual machine monitor 202 executing on one or more of processors 102 may include instructions for at least partially configuring a register set 530 as part of a performance counter. Execution of those instructions communicates
information to control module 502 for configuration of register set 530 for a particular software module.
In at least one embodiment of performance counter module 500, match register 508 is configured to select a particular device for events that are counted based on a device identifier (DevicelD). In at least one embodiment of performance counter module 500, match register 510 is configured to select a Process Address Space Identifier (PASID) that is used to identify an application address space within an x86-canonical guest virtual machine. It is used on a peripheral to isolate concurrent contexts residing in a shared local memory. Together, the PASID and DevicelD information uniquely identify an application address space. Note that use of the PASID and DevicelD for specifying an event to be counted is exemplary only and the match register(s) may be configured for events qualified based on additional or other criterion. In at least one embodiment, the match registers include a field that can be used to cause the hardware to ignore actual comparison results and always indicate no match. That field may be used to disable counting of events (e.g., temporarily). In at least one embodiment, the match registers include a field that can be used to cause the hardware to ignore actual comparison results and always indicate a match. That field is useful to match on all PASID values or match on all Device ID values. In at least one embodiment, the match registers include a filter field that causes the hardware to ignore certain bits of a field in a comparison. That field is useful to count events for select groups of values (e.g., count events for all PASID values from 0 through 6, inclusively, or count events for all DevicelDs from 0 to 127). In at least one embodiment, the match registers include a min and/or max field so that the comparison is for a range of values, as programmed by software. Note that combinations of multiple match registers may be configured in complex ways to at least partially determine an event to be counted.
In at least one embodiment of performance counter module 500, each performance counter is associated with one or more attribute registers (e.g., attribute register 514) that is configured to select the type of event to be counted for the device specified by one or more corresponding match registers (e.g., match register 508 and match register 510). For example, an attribute register may indicate that the event is a hit of a Translation Lookaside Buffer (TLB) of the IOMMU for a selected value of a DevicelD and a selected value of PASID. Other events that may be counted include a number of interrupts, a number of page faults, a number of instructions executed, a number of I/O operations processed, and a number of times an attempt to read memory is satisfied by a cache. For security purposes, one or more of those parameters (e.g., one or more of the contents of the match registers and attribute registers) are locked, e.g., a user-level process is not allowed to change the
DevicelD although the user-level process may be allowed to change the event being counted (e.g., TLB hit) or the PASID being matched. In at least one embodiment of performance counter module 500, protection above and beyond the protection provided by memory page access controls includes providing one or more protect registers (e.g., protect register 516 and protect register 518) that indicate to control module 502 whether or not a particular register of register set 530 can be changed or viewed by a particular software module. In at least one embodiment of performance counter module 500, at least one protect register is configured to determine whether or not value register 506, match register 508, match register 510, and/or attribute register 514 can be modified by a particular software module. In at least one embodiment, the protect registers allow more privileged software to decide which devices and registers may be viewed and/or changed by less privileged software modules. Access control can be provided on a register- by-register basis. In at least one embodiment of performance counter module 500, one or more protect registers controls whether or not the corresponding match register can be written by a particular software module. In other embodiments of performance counter module 500, a read of the match register by a particular software module may be obscured by control module 502 based on contents of the protect register(s).
In at least one embodiment of performance counter module 500, virtual machine monitor 202 retains control over the protect register(s) and determines whether or not a particular software module (e.g., a guest operating system or a user-level process) may view or change the corresponding match register(s) of the register set for the performance counter. In at least one embodiment of performance counter module 500, a protect register is configured to prevent a user-level process from directly changing either the PASID or DevicelD programmed into the match registers unless the process makes the change request via the associated operating system. In at least one embodiment of performance counter module 500, a protect register is configured to prevent a guest operating system from changing the DevicelD programmed into a match register unless it makes the change request via the virtual machine monitor, but is configured to allow change to the PASID programmed into a corresponding match register. In at least one embodiment of performance counter module 500, one or more protect registers are configured to allow virtual machine monitor 202 to change the contents of any register in register set 530 and can do so by retaining control of the associated protect register(s).
In at least one embodiment of performance counter module 500, detection module 504 compares the contents of an IOMMU instruction buffer to the contents of at least one control register (e.g., match register) in register set 503. If detection module 504 detects a match for those control registers associated with a particular value register for a current event consistent with any corresponding attribute register, then the event is detected and detection module 504 updates the value register accordingly (e.g., increments or decrements the value register according to the design of the value register). The contents of the value register are made accessible to one or more software modules by the IOMMU and/or based on any corresponding protect register of performance module 500. The software module may then use the information in the value register to update system parameters. Thus, performance counter module 500 allows different software modules to receive performance information that is of interest to the particular software module and/or according to the privilege level of that software module. Those register sets 530 and associated modules (e.g., control module 502 and detection module 504) provide fast access to the most current information to software modules having different levels of privilege, while reducing or preventing opportunities for less privileged processes to perturb this information. The techniques described herein may be applied to additional levels of privilege and domains of isolation.
As described above, the techniques described herein allow less-privileged software to efficiently and quickly access IOMMU performance counter information with relatively low overhead (i.e., the cost of a hardware access rather than the cost of software-mediated access, which may require a world switch). Meanwhile, the virtual machine monitor and operating system retain control of changes to the information, thereby maintaining system isolation and protection properties. Instead of taking dozens, hundreds, or even thousands of instructions to read or change performance information, a read of performance information consistent with the techniques described herein only takes a few cycles.
Accordingly, software can obtain accurate, current performance information at any rate that it determines is necessary without throttling access or sampling rates, and without deferring usage of the performance information. As a result, software can adapt quickly and efficiently to changes in system behavior. In embodiments of system 200 that allocate much control of the system to threads and user-level processes executing on the system, performance counter module 500 allows those threads and user-level processes to efficiently access performance information and respond quickly and precisely to system operational changes. While circuits and physical structures have been generally presumed in describing embodiments of the invention, it is well recognized that in modern semiconductor design and fabrication, physical structures and circuits may be embodied in computer-readable descriptive form suitable for use in subsequent design, simulation, test or fabrication stages. Structures and functionality presented as discrete components in the exemplary configurations may be implemented as a combined structure or component. Various embodiments of the invention are contemplated to include circuits, systems of circuits, related methods, and tangible computer-readable medium having encodings thereon (e.g., VHSIC Hardware Description Language (VHDL), Verilog, GDSII data, Electronic Design Interchange Format (EDIF), and/or Gerber file) of such circuits, systems, and methods, all as described herein, and as defined in the appended claims. In addition, the computer-readable media may store instructions as well as data that can be used to implement the invention. The instructions/data may be related to hardware, software, firmware or combinations thereof.
Structures described herein may be implemented using software executing on a processor (which includes firmware) or by a combination of software and hardware. Software, as described herein, may be encoded in at least one tangible computer readable medium. As referred to herein, a tangible computer-readable medium includes at least a disk, tape, or other magnetic, optical, or electronic storage medium.
The description of certain embodiments of the invention set forth herein is illustrative, and is not intended to limit the scope of the invention as set forth in the following claims. For example, while the invention has been described in an embodiment in which performance counters for events of an IOMMU are managed, one of skill in the art will appreciate that the teachings herein can be utilized with performance counters associated with other control modules of a computing system, and performance counter module 500 may be located and configured accordingly. For example, techniques described herein may be applied to MMU 107, performance counters for processors 102, devices 108, memory 106/1 10 and/or other system modules having events to be counted. Variations and modifications of the embodiments disclosed herein, may be made based on the description set forth herein, without departing from the scope and spirit of the invention as set forth in the following claims.

Claims

WHAT IS CLAIMED IS:
1. A method comprising:
updating contents of a value storage element indicating a number of occurrences of an event, the updating being based on contents of a match storage element storing event qualification information; and
providing the contents of the value storage element to a first software module
executing on at least one processor, the providing being based on contents of a protect storage element indicating access information.
2. The method, as recited in claim 1, further comprising:
executing the first software module on the at least one processor in a first mode of operation; and
executing a second software module on the at least one processor in a second mode of operation, the second mode being more privileged than the first mode, wherein the first software module is a user application or a guest under control of a virtual machine monitor,
wherein the second software module is a virtual machine monitor or a guest
executing under control of a virtual machine monitor.
3. The method, as recited in claim 2, further comprising:
configuring the protect storage element to allow access of the match storage element to the first software module in the second mode of operation.
4. The method, as recited in claim 2, further comprising:
configuring the protect storage element to allow read access of the value storage element to the first software module in the second mode of operation.
5. The method, as recited in claim 1, further comprising:
updating an operational parameter by the first software module based on contents of the value storage element, wherein the first software module has only user- level privileges.
6. The method, as recited in claim 1, further comprising:
configuring the protect storage element by a second software module executing on the at least one processor; and
resetting the value storage element by the second software module.
7. The method, as recited in claim 6, further comprising:
configuring the match storage element and an attribute storage element by the first software module, the first software module being less privileged than the second software module,
wherein the contents of the match storage element indicate a device corresponding to the event and the updating is further based on contents of an attribute storage element containing an indication of a type of the event.
8. The method, as recited in claim 6, further comprising:
configuring the match storage element and an attribute storage element by the
second software module; and
prohibiting access of the first software module to the match storage element, wherein the contents of the match storage element indicate a device corresponding to the event and the updating is further based on contents of an attribute storage element containing an indication of a type of the event.
9. An apparatus comprising:
a match storage element configured to store event qualification information;
a value storage element configured to accumulate occurrences of an event in
response to an indicator indicating detection of the event based on contents of the match storage element;
a protect storage element configured to store information indicating access to the value storage element by a software module executing on at least one processor; and
a control module configured to provide, to the software module, read access to
contents of the value storage element based on contents of the protect storage element.
10. The apparatus, as recited in claim 9, further comprising:
a detection module configured to generate the indicator in response to detecting the event based on contents of the match storage element.
11. The apparatus, as recited in claim 9, wherein the control module is further configured to provide, to the software module, write access to the match storage element based on the contents of the protect storage element.
12. The apparatus, as recited in claim 9, further comprising:
an attribute storage element configured to store additional event qualification
information,
wherein the detection module is configured to generate the indicator further based on contents of the attribute storage element.
13. The apparatus, as recited in claim 9, further comprising:
at least one processor operable to execute a second software module in a first mode of a virtualized processing system and operable to execute the software module in a second mode of the virtualized processing system, the first mode being more privileged than the second mode,
wherein the second software module is executable to configure the protect storage element and the match storage element.
PCT/US2012/043450 2011-06-30 2012-06-21 Secure and virtualizable performance counters Ceased WO2013003177A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US13/172,935 2011-06-30
US13/172,935 US20130007379A1 (en) 2011-06-30 2011-06-30 Secure and virtualizable performance counters

Publications (1)

Publication Number Publication Date
WO2013003177A1 true WO2013003177A1 (en) 2013-01-03

Family

ID=46465305

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2012/043450 Ceased WO2013003177A1 (en) 2011-06-30 2012-06-21 Secure and virtualizable performance counters

Country Status (2)

Country Link
US (1) US20130007379A1 (en)
WO (1) WO2013003177A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025210456A1 (en) 2024-04-03 2025-10-09 Regenics As Matrices for wound healing

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9600336B1 (en) 2015-08-28 2017-03-21 International Business Machines Corporation Storing service level agreement compliance data
US9424155B1 (en) * 2016-01-27 2016-08-23 International Business Machines Corporation Use efficiency of platform memory resources through firmware managed I/O translation table paging
US10671419B2 (en) * 2016-02-29 2020-06-02 Red Hat Israel, Ltd. Multiple input-output memory management units with fine grained device scopes for virtual machines
US10949202B2 (en) 2016-04-14 2021-03-16 International Business Machines Corporation Identifying and tracking frequently accessed registers in a processor
US10761996B2 (en) * 2018-09-28 2020-09-01 Intel Corporation Apparatus and method for secure memory access using trust domains
US11500550B2 (en) * 2019-08-27 2022-11-15 Red Hat, Inc. Inhibiting memory accesses to executable modules
US11816498B2 (en) * 2021-01-21 2023-11-14 Nutanix, Inc. Early event-based notification for VM swapping
US20240220603A1 (en) * 2022-12-29 2024-07-04 Advanced Micro Devices, Inc. Secure virtualized performance monitoring counters
US12499280B2 (en) * 2023-05-01 2025-12-16 Mellanox Technologies, Ltd Integrated-circuit memory dump using hardware security mechanism

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7191440B2 (en) * 2001-08-15 2007-03-13 Intel Corporation Tracking operating system process and thread execution and virtual machine execution in hardware or in a virtual machine monitor
US8209681B1 (en) * 2005-11-08 2012-06-26 Hewlett-Packard Development Company, L.P. Method of sampling hardware events in computer system
US8676746B2 (en) * 2008-01-03 2014-03-18 Microsoft Corporation Database management system risk assessment
GB2474666B (en) * 2009-10-21 2015-07-15 Advanced Risc Mach Ltd Hardware resource management within a data processing system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
VARIOUS: "AMD I/O Virtualization Technology (IOMMU) Specification 2.00", INET, 24 March 2011 (2011-03-24), inet, pages 1 - 167, XP055040692, Retrieved from the Internet <URL:http://support.amd.com/us/Processor_TechDocs/48882.pdf> [retrieved on 20121011] *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025210456A1 (en) 2024-04-03 2025-10-09 Regenics As Matrices for wound healing

Also Published As

Publication number Publication date
US20130007379A1 (en) 2013-01-03

Similar Documents

Publication Publication Date Title
US10901772B2 (en) Virtualization exceptions
US20130007379A1 (en) Secure and virtualizable performance counters
US8127107B2 (en) Virtualization with merged guest page table and shadow page directory
KR101253454B1 (en) Managing use of storage by multiple pageable guests of a computing environment
US7127548B2 (en) Control register access virtualization performance improvement in the virtual-machine architecture
EP2891067B1 (en) Virtual input/output memory management unit wihtin a guest virtual machine
US9507727B2 (en) Page fault injection in virtual machines
JP2022503562A (en) Range check command
US20160188354A1 (en) Efficient enabling of extended page tables
US7506121B2 (en) Method and apparatus for a guest to access a memory mapped device
US9558364B2 (en) Computing machine, access management method, and access management program
Grinberg et al. Architectural virtualization extensions: A systems perspective
Yao et al. White Paper A Tour beyond BIOS Using Intel® VT-d for DMA Protection in UEFI BIOS
HK40004204B (en) Event filtering for virtual machine security applications
HK1216679B (en) Page fault injection in virtual machines

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12732923

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12732923

Country of ref document: EP

Kind code of ref document: A1