VirtualBox

Ignore:
Timestamp:
Aug 27, 2009 11:38:33 AM (15 years ago)
Author:
vboxsync
Message:

use GFP_DMA32 first on 32-bit PAE systems (like on 64-bit hosts) when allocating memory below 4GB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c

    r22355 r22508  
    239239    cPages = cb >> PAGE_SHIFT;
    240240    cOrder = CalcPowerOf2Order(cPages);
     241#if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32)
     242    paPages = alloc_pages(GFP_DMA32, cOrder);
     243    if (!paPages)
     244#endif
    241245#ifdef RT_ARCH_AMD64
    242     /** @todo check out if there is a correct way of getting memory below 4GB (physically).
    243      * GFP_DMA32 is available since Linux 2.6.15 */
    244     paPages = alloc_pages(GFP_DMA, cOrder);
     246        paPages = alloc_pages(GFP_DMA, cOrder);
    245247#else
    246     /** XXX Wrong: GFP_USER can return page frames above 4GB! */
    247     paPages = alloc_pages(GFP_USER, cOrder);
     248# if defined(CONFIG_X86_PAE)
     249    /** GFP_USER can return page frames above 4GB on PAE systems => GFP_DMA? */
     250# endif
     251        paPages = alloc_pages(GFP_USER, cOrder);
    248252#endif
    249253    if (paPages)
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