VirtualBox

Changeset 50008 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Dec 27, 2013 2:20:34 PM (11 years ago)
Author:
vboxsync
Message:

supdrv,iprt: Added VBOX_WITH_TEXT_MODMEM_HACK for getting VMMR0.r0 address in the linux kernel stack crawl.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r49965 r50008  
    44614461            supdrvLdrUnsetVMMR0EPs(pDevExt);
    44624462    }
     4463    SUPR0Printf("vboxdrv: %p %s\n", pImage->pvImage, pImage->szName);
    44634464
    44644465    if (RT_FAILURE(rc))
  • trunk/src/VBox/HostDrivers/Support/linux/Makefile

    r49395 r50008  
    276276 #KFLAGS  += -DIPRT_DEBUG_SEMS
    277277endif
     278ifdef VBOX_WITH_TEXT_MODMEM_HACK
     279 KFLAGS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK
     280endif
    278281
    279282# 2.6 and later
  • trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c

    r49767 r50008  
    153153#define DEVICE_NAME_USR     "vboxdrvu"
    154154
    155 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
     155#if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
    156156/**
    157157 * Memory for the executable memory heap (in IPRT).
    158158 */
    159 extern uint8_t g_abExecMemory[1572864]; /* 1.5 MB */
     159# ifdef DEBUG
     160#  define EXEC_MEMORY_SIZE   6291456    /* 6 MB */
     161# else
     162#  define EXEC_MEMORY_SIZE   1572864    /* 1.5 MB */
     163# endif
     164extern uint8_t g_abExecMemory[EXEC_MEMORY_SIZE];
     165# ifndef VBOX_WITH_TEXT_MODMEM_HACK
    160166__asm__(".section execmemory, \"awx\", @progbits\n\t"
    161167        ".align 32\n\t"
    162168        ".globl g_abExecMemory\n"
    163169        "g_abExecMemory:\n\t"
    164         ".zero 1572864\n\t"
     170        ".zero " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t"
    165171        ".type g_abExecMemory, @object\n\t"
    166         ".size g_abExecMemory, 1572864\n\t"
     172        ".size g_abExecMemory, " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t"
    167173        ".text\n\t");
     174# else
     175__asm__(".text\n\t"
     176        ".align 4096\n\t"
     177        ".globl g_abExecMemory\n"
     178        "g_abExecMemory:\n\t"
     179        ".zero " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t"
     180        ".type g_abExecMemory, @object\n\t"
     181        ".size g_abExecMemory, " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t"
     182        ".text\n\t");
     183# endif
    168184#endif
    169185
     
    377393        if (RT_SUCCESS(rc))
    378394        {
    379 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)
     395#if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK)
     396# ifdef VBOX_WITH_TEXT_MODMEM_HACK
     397            set_memory_x(&g_abExecMemory[0], sizeof(g_abExecMemory) / PAGE_SIZE);
     398            set_memory_rw(&g_abExecMemory[0], sizeof(g_abExecMemory) / PAGE_SIZE);
     399# endif
    380400            rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory));
    381401            printk(KERN_DEBUG "VBoxDrv: dbg - g_abExecMemory=%p\n", (void *)&g_abExecMemory[0]);
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