~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/VMM/HWACCMInternal.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
} HWACCM_CPUINFO;
179
179
typedef HWACCM_CPUINFO *PHWACCM_CPUINFO;
180
180
 
181
 
/* VT-x capability qword. */
182
 
typedef union
183
 
{
184
 
    struct
185
 
    {
186
 
        uint32_t        disallowed0;
187
 
        uint32_t        allowed1;
188
 
    } n;
189
 
    uint64_t            u;
190
 
} VMX_CAPABILITY;
191
 
 
192
181
typedef enum
193
182
{
194
183
    HWACCMPENDINGIO_INVALID = 0,
276
265
    /** Set when TPR patching is allowed. */
277
266
    bool                        fTRPPatchingAllowed;
278
267
 
279
 
    /** Explicit alignment padding to make 32-bit gcc align u64RegisterMask
280
 
     *  naturally. */
281
 
    bool                        padding[1];
 
268
    /** Set when we initialize VT-x or AMD-V once for all CPUs. */
 
269
    bool                        fGlobalInit;
 
270
 
 
271
    /** Set when TPR patching is active. */
 
272
    bool                        fTPRPatchingActive;
 
273
    bool                        u8Alignment[7];
282
274
 
283
275
    /** And mask for copying register contents. */
284
276
    uint64_t                    u64RegisterMask;
413
405
        bool                        fEnabled;
414
406
        /** Set if erratum 170 affects the AMD cpu. */
415
407
        bool                        fAlwaysFlushTLB;
416
 
        /** Set when TPR patching is active. */
417
 
        bool                        fTPRPatchingActive;
 
408
        bool                        u8Alignment;
418
409
 
419
410
        /** R0 memory object for the IO bitmap (12kb). */
420
411
        RTR0MEMOBJ                  pMemObjIOBitmap;
423
414
        /** Virtual address of the IO bitmap. */
424
415
        R0PTRTYPE(void *)           pIOBitmap;
425
416
 
 
417
        /* HWCR msr (for diagnostics) */
 
418
        uint64_t                    msrHWCR;
 
419
 
426
420
        /** SVM revision. */
427
421
        uint32_t                    u32Rev;
428
422
 
429
423
        /** SVM feature bits from cpuid 0x8000000a */
430
424
        uint32_t                    u32Features;
431
 
 
432
 
        /**
433
 
         * AVL tree with all patches (active or disabled) sorted by guest instruction address
434
 
         */
435
 
        AVLOU32TREE                 PatchTree;
436
 
        uint32_t                    cPatches;
437
 
        HWACCMTPRPATCH              aPatches[64];
438
425
    } svm;
439
426
 
 
427
    /**
 
428
     * AVL tree with all patches (active or disabled) sorted by guest instruction address
 
429
     */
 
430
    AVLOU32TREE                     PatchTree;
 
431
    uint32_t                        cPatches;
 
432
    HWACCMTPRPATCH                  aPatches[64];
 
433
 
440
434
    struct
441
435
    {
442
436
        uint32_t                    u32AMDFeatureECX;
448
442
 
449
443
    /** HWACCMR0Init was run */
450
444
    bool                    fHWACCMR0Init;
451
 
    bool                    u8Alignment[7];
 
445
    bool                    u8Alignment1[7];
452
446
 
453
447
    STAMCOUNTER             StatTPRPatchSuccess;
454
448
    STAMCOUNTER             StatTPRPatchFailure;
547
541
    /** Set when we're using VT-x or AMD-V at that moment. */
548
542
    bool                        fActive;
549
543
 
 
544
    /** Set when the TLB has been checked until we return from the world switch. */
 
545
    volatile uint8_t            fCheckedTLBFlush;
 
546
    uint8_t                     bAlignment[3];
 
547
 
550
548
    /** HWACCM_CHANGED_* flags. */
551
549
    RTUINT                      fContextUseFlags;
552
550
 
553
 
    /* Id of the last cpu we were executing code on (NIL_RTCPUID for the first time) */
 
551
    /** Id of the last cpu we were executing code on (NIL_RTCPUID for the first time) */
554
552
    RTCPUID                     idLastCpu;
555
553
 
556
 
    /* TLB flush count */
 
554
    /** TLB flush count */
557
555
    RTUINT                      cTLBFlushes;
558
556
 
559
 
    /* Current ASID in use by the VM */
 
557
    /** Current ASID in use by the VM */
560
558
    RTUINT                      uCurrentASID;
561
559
 
 
560
    /** World switch exit counter. */ 
 
561
    volatile uint32_t           cWorldSwitchExit;
 
562
    uint32_t                    u32Alignment;
 
563
 
562
564
    struct
563
565
    {
564
566
        /** Physical address of the VM control structure (VMCS). */
571
573
        /** Ring 0 handlers for VT-x. */
572
574
        PFNHWACCMVMXSTARTVM         pfnStartVM;
573
575
 
 
576
#if HC_ARCH_BITS == 32
 
577
        uint32_t                    u32Alignment;
 
578
#endif
 
579
 
574
580
        /** Current VMX_VMCS_CTRL_PROC_EXEC_CONTROLS. */
575
581
        uint64_t                    proc_ctls;
576
582
 
757
763
#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
758
764
    STAMPROFILEADV          StatWorldSwitch3264;
759
765
#endif
 
766
    STAMPROFILEADV          StatPoke;
 
767
    STAMPROFILEADV          StatSpinPoke;
 
768
    STAMPROFILEADV          StatSpinPokeFailed;
760
769
 
761
770
    STAMCOUNTER             StatIntInject;
762
771
 
802
811
    STAMCOUNTER             StatIntReinject;
803
812
    STAMCOUNTER             StatPendingHostIrq;
804
813
 
 
814
    STAMCOUNTER             StatFlushPage;
805
815
    STAMCOUNTER             StatFlushPageManual;
806
816
    STAMCOUNTER             StatFlushPhysPageManual;
 
817
    STAMCOUNTER             StatFlushTLB;
807
818
    STAMCOUNTER             StatFlushTLBManual;
808
819
    STAMCOUNTER             StatFlushPageInvlpg;
809
820
    STAMCOUNTER             StatFlushTLBWorldSwitch;