Главная » Просмотр файлов » Volume 3B System Programming Guide_ Part 2

Volume 3B System Programming Guide_ Part 2 (794104), страница 25

Файл №794104 Volume 3B System Programming Guide_ Part 2 (Intel and AMD manuals) 25 страницаVolume 3B System Programming Guide_ Part 2 (794104) страница 252019-04-28СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 25)

After the counter has been enabled and the prescribed number of events has transpired, the counter will overflow.Approximately 5 clocks later, the overflow is indicated externally and appropriateaction, such as signaling an interrupt, may then be taken.The PM0/BP0 and PM1/BP1 pins also serve to indicate breakpoint matches during incircuit emulation, during which time the counter increment or overflow function ofthese pins is not available.

After RESET, the PM0/BP0 and PM1/BP1 pins are configured for performance monitoring, however a hardware debugger may reconfigurethese pins to indicate breakpoint matches.18.22.3 Events CountedEvents that performance-monitoring counters can be set to count and record (usingCTR0 and CTR1) are divided in two categories: occurrence and duration:•Occurrence events — Counts are incremented each time an event takes place.If PM0/BP0 or PM1/BP1 pins are used to indicate when a counter increments, thepins are asserted each clock counters increment. But if an event happens twice inone clock, the counter increments by 2 (the pins are asserted only once).•Duration events — Counters increment the total number of clocks that thecondition is true.

When used to indicate when counters increment, PM0/BP0and/or PM1/BP1 pins are asserted for the duration.Vol. 3 18-119DEBUGGING AND PERFORMANCE MONITORING18-120 Vol. 3CHAPTER 19INTRODUCTION TO VIRTUAL-MACHINE EXTENSIONS19.1OVERVIEWThis chapter describes the basics of virtual machine architecture and an overview ofthe virtual-machine extensions (VMX) that support virtualization of processor hardware for multiple software environments.Information about VMX instructions is provided in Intel® 64 and IA-32 ArchitecturesSoftware Developer’s Manual, Volume 2B.

Other aspects of VMX and systemprogramming considerations are described in chapters of Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3B.19.2VIRTUAL MACHINE ARCHITECTUREVirtual-machine extensions define processor-level support for virtual machines onIA-32 processors. Two principal classes of software are supported:•Virtual-machine monitors (VMM) — A VMM acts as a host and has full controlof the processor(s) and other platform hardware. A VMM presents guest software(see next paragraph) with an abstraction of a virtual processor and allows it toexecute directly on a logical processor. A VMM is able to retain selective control ofprocessor resources, physical memory, interrupt management, and I/O.•Guest software — Each virtual machine (VM) is a guest software environmentthat supports a stack consisting of operating system (OS) and applicationsoftware. Each operates independently of other virtual machines and uses on thesame interface to processor(s), memory, storage, graphics, and I/O provided bya physical platform.

The software stack acts as if it were running on a platformwith no VMM. Software executing in a virtual machine must operate with reducedprivilege so that the VMM can retain control of platform resources.19.3INTRODUCTION TO VMX OPERATIONProcessor support for virtualization is provided by a form of processor operationcalled VMX operation.

There are two kinds of VMX operation: VMX root operation andVMX non-root operation. In general, a VMM will run in VMX root operation and guestsoftware will run in VMX non-root operation. Transitions between VMX root operationand VMX non-root operation are called VMX transitions. There are two kinds of VMXtransitions. Transitions into VMX non-root operation are called VM entries.

Transitions from VMX non-root operation to VMX root operation are called VM exits.Vol. 3 19-1INTRODUCTION TO VIRTUAL-MACHINE EXTENSIONSProcessor behavior in VMX root operation is very much as it is outside VMX operation.The principal differences are that a set of new instructions (the VMX instructions) isavailable and that the values that can be loaded into certain control registers arelimited (see Section 19.8).Processor behavior in VMX non-root operation is restricted and modified to facilitatevirtualization. Instead of their ordinary operation, certain instructions (including thenew VMCALL instruction) and events cause VM exits to the VMM. Because theseVM exits replace ordinary behavior, the functionality of software in VMX non-rootoperation is limited.

It is this limitation that allows the VMM to retain control ofprocessor resources.There is no software-visible bit whose setting indicates whether a logical processor isin VMX non-root operation. This fact may allow a VMM to prevent guest software fromdetermining that it is running in a virtual machine.Because VMX operation places restrictions even on software running with currentprivilege level (CPL) 0, guest software can run at the privilege level for which it wasoriginally designed. This capability may simplify the development of a VMM.19.4LIFE CYCLE OF VMM SOFTWAREFigure 19-1 illustrates the life cycle of a VMM and its guest software as well as theinteractions between them. The following items summarize that life cycle:••Software enters VMX operation by executing a VMXON instruction.•VM exits transfer control to an entry point specified by the VMM. The VMM cantake action appropriate to the cause of the VM exit and can then return to thevirtual machine using a VM entry.•Eventually, the VMM may decide to shut itself down and leave VMX operation.

Itdoes so by executing the VMXOFF instruction.Using VM entries, a VMM can then enter guests into virtual machines (one at atime). The VMM effects a VM entry using instructions VMLAUNCH andVMRESUME; it regains control using VM exits.19-2 Vol. 3INTRODUCTION TO VIRTUAL-MACHINE EXTENSIONSGuest 0VM ExitVMXONGuest 1VM EntryVM MonitorVM ExitVMXOFFFigure 19-1. Interaction of a Virtual-Machine Monitor and Guests19.5VIRTUAL-MACHINE CONTROL STRUCTUREVMX non-root operation and VMX transitions are controlled by a data structure calleda virtual-machine control structure (VMCS).Access to the VMCS is managed through a component of processor state called theVMCS pointer (one per logical processor).

The value of the VMCS pointer is the 64-bitaddress of the VMCS. The VMCS pointer is read and written using the instructionsVMPTRST and VMPTRLD. The VMM configures a VMCS using the VMREAD, VMWRITE,and VMCLEAR instructions.A VMM could use a different VMCS for each virtual machine that it supports. For avirtual machine with multiple logical processors (virtual processors), the VMM coulduse a different VMCS for each virtual processor.19.6DISCOVERING SUPPORT FOR VMXBefore system software enters into VMX operation, it must discover the presence ofVMX support in the processor.

System software can determine whether a processorsupports VMX operation using CPUID. If CPUID.1:ECX.VMX[bit 5] = 1, then VMXoperation is supported. See Figure 19-2.Vol. 3 19-3INTRODUCTION TO VIRTUAL-MACHINE EXTENSIONS31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 76 5 4 3 21 0ECXCNXT-ID—L1 Context IDTM2—Thermal Monitor 2EST—Enhanced Intel SpeedStep® TechnologyVMX—Virtual Machine ExtensionsDS-CPL—CPL Qual.

Debug StoreMONITOR—Monitor/MwaitSSE3—Streaming SIMD Extensions 3ReservedFigure 19-2. CPUID Extended Feature Information ECXThe VMX architecture is designed to be extensible so that future processors in VMXoperation can support additional features not present in first-generation implementations of the VMX architecture. The availability of extensible VMX features isreported to software using a set of VMX capability MSRs (see Appendix G, “VMXCapability Reporting Facility”).19.7ENABLING AND ENTERING VMX OPERATIONBefore system software can enter VMX operation, it enables VMX by settingCR4.VMXE[bit 13] = 1.

VMX operation is then entered by executing the VMXONinstruction. VMXON causes an invalid-opcode exception (#UD) if executed withCR4.VMXE = 0. Once in VMX operation, it is not possible to clear CR4.VMXE (seeSection 19.8). System software leaves VMX operation by executing the VMXOFFinstruction. CR4.VMXE can be cleared outside of VMX operation after executing ofVMXOFF.VMXON is also controlled by the IA32_FEATURE_CONTROL MSR (MSR address 3AH).This MSR is cleared to zero when a logical processor is reset. The relevant bits of theMSR are:•Bit 0 is the lock bit.

Характеристики

Тип файла
PDF-файл
Размер
2,89 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6392
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее