VirtualBox

Changeset 38851 in vbox


Ignore:
Timestamp:
Sep 23, 2011 2:00:03 PM (13 years ago)
Author:
vboxsync
Message:

Recompiler DMA workaround.

Location:
trunk/src/VBox/Devices/PC/BIOS-new
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/BIOS-new/ahci.c

    r38848 r38851  
    4343
    4444#define AHCI_MAX_STORAGE_DEVICES 4
     45
     46/* Because we don't tell the recompiler when guest's physical memory
     47 * is written, it can incorrectly cache guest code overwritten by
     48 * bus master DMA. We just re-write the memory block to flush any of
     49 * its caches. This is not exactly efficient, but works!
     50 */
     51#define DMA_WORKAROUND      1
    4552
    4653/**
     
    645652}
    646653
     654
    647655/**
    648656 * Read data from the device.
     
    668676                  u8Sect, 0, u8CylHighExp, u8CylLowExp, u8SectExp, u8SectCount,
    669677                  u8SectCountExp, SegData :> OffData, u16Sectors * 512, 0);
     678#ifdef DMA_WORKAROUND
     679    rep_movsw(SegData :> OffData, SegData :> OffData, u16Sectors * 512 / 2);
     680#endif
    670681}
    671682
  • trunk/src/VBox/Devices/PC/BIOS-new/inlines.h

    r38699 r38851  
    6161    modify exact [] nomemory aborts;
    6262
     63void rep_movsw(void __far *d, void __far *s, int nwords);
     64#pragma aux rep_movsw =     \
     65    "push   ds"             \
     66    "mov    ds, dx"         \
     67    "rep    movsw"          \
     68    "pop    ds"             \
     69    parm [es di] [dx si] [cx];
     70
    6371char __far *rep_insb(char __far *buffer, unsigned nbytes, unsigned port);
    6472#pragma aux rep_insb = ".286" "rep insb" parm [es di] [cx] [dx] value [es di] modify exact [cx di];
Note: See TracChangeset for help on using the changeset viewer.

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