VirtualBox

Changeset 88215 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Mar 19, 2021 6:42:55 PM (4 years ago)
Author:
vboxsync
Message:

Solaris-specific changes needed for building VBox on Solaris 11.4.
ticketref:9956

/Config.kmk,tools/Makefile.kmk: The Solaris package FMRI changed in
Solaris 11.4 so further care is needed when parsing the 'pkg contents -o
pkg.fmri' output. Some further simplification done as well as only the
Solaris 11 update and build number are needed for feature checking
elsewhere.

Additions/solaris/DRM: In Solaris 11 FCS <sys/queue.h> was taken from
FreeBSD and added to the OS. VirtualBox copied this file to
Additions/solaris/DRM/include and it is included by
Additions/solaris/DRM/include/drmP.h. Solaris 11.4 modified <sys/modctl.h>
to include <sys/queue.h> and drmP.h includes <sys/modctl.h> so thus
drmP.h shouldn't include queue.h on Solaris 11.4 FCS and later.

Additions/solaris/SharedFolders,Runtime/r0drv/solaris: Solaris 11.4
removed the 'alignment' argument from the VM map_addr() and
choose_addr() routines so we now leverage RTR0DbgKrnlInfoQuerySymbol()
at module initialization to determine which version of these functions
needs to be invoked.

Runtime/r0drv/solaris: In Solaris 11.4 the VM seg_ops getpolicy()
routine changed its return value and added an extra argument but since
we don't need to do anything for this and Solaris 10 and 11 both check
for a non-NULL s_ops->getpolicy() entry or else for s_ops->capable()
before calling getpolicy() we just set the s_SegVBoxOps getpolicy()
entry to NULL. Solaris 11.4 also added an extra argument to the VM
seg_ops dump() routine but there aren't any checks made before calling
it. Since we don't do anything with dump() we just use #ifdefs to get
the correct prototype at build-time.

Additions/x11/vboxvideo: The Xorg vboxvideo_drv.so shared object on
Solaris 11.4 has an undefined weak symbol reference to assert_c99
which needs to be added to the undefined_xorg file.

Location:
trunk/src/VBox/Runtime/r0drv/solaris
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c

    r82968 r88215  
    8585/** Host scheduler force preemption offset. */
    8686size_t                          g_offrtSolCpuForceKernelPreempt;
     87/** Whether to use the old-style map_addr() routine. */
     88bool                            g_frtSolOldMapAddr = false;
     89/** The map_addr() hooks callout table structure. */
     90RTR0FNSOLMAPADDR                g_rtSolMapAddr;
    8791/* Resolve using dl_lookup (remove if no longer relevant for supported S10 versions) */
    8892extern void contig_free(void *addr, size_t size);
     
    223227
    224228        /*
     229         * Mandatory: map_addr() hooks.
     230         */
     231        rc = RTR0DbgKrnlInfoQuerySymbol(g_hKrnlDbgInfo, NULL /* pszModule */, "plat_map_align_amount",  NULL /* ppvSymbol */);
     232        if (RT_SUCCESS(rc))
     233        {
     234            g_rtSolMapAddr.u.pfnSol_map_addr    = (void *)map_addr;
     235        }
     236        else
     237        {
     238            g_frtSolOldMapAddr = true;
     239            g_rtSolMapAddr.u.pfnSol_map_addr_old    = (void *)map_addr;
     240        }
     241
     242        /*
    225243         * Optional: Timeout hooks.
    226244         */
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c

    r87106 r88215  
    578578
    579579    as_rangelock(pAddrSpace);
    580     map_addr(pVirtAddr, cb, 0 /* offset */, 0 /* vacalign */, MAP_SHARED);
     580    if (g_frtSolOldMapAddr)
     581        g_rtSolMapAddr.u.pfnSol_map_addr_old(pVirtAddr, cb, 0 /* offset */, 0 /* vacalign */, MAP_SHARED);
     582    else
     583        g_rtSolMapAddr.u.pfnSol_map_addr(pVirtAddr, cb, 0 /* offset */, MAP_SHARED);
    581584    if (*pVirtAddr != NULL)
    582585        rc = as_map(pAddrSpace, *pVirtAddr, cb, rtR0SegVBoxSolCreate, &Args);
     
    10531056            page_t **papPages = pMemToMapSolaris->pvHandle;
    10541057            AssertPtr(papPages);
    1055             papPages += offSub >> PAGE_SIZE;
     1058            papPages += offSub >> PAGE_SHIFT;
    10561059            for (size_t iPage = 0; iPage < cPages; iPage++)
    10571060                paPhysAddrs[iPage] = rtR0MemObjSolPagePhys(papPages[iPage]);
  • trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.h

    r82968 r88215  
    258258
    259259
     260#if defined(VBOX_NEW_CRASH_DUMP_FORMAT)
     261static void rtR0SegVBoxSolDump(seg_t *pSeg, dump_addpage_f Func)
     262#else
    260263static void rtR0SegVBoxSolDump(seg_t *pSeg)
     264#endif
    261265{
    262266    /* Nothing to do. */
     
    279283{
    280284    return ENODEV;
    281 }
    282 
    283 
    284 static lgrp_mem_policy_info_t *rtR0SegVBoxSolGetPolicy(seg_t *pSeg, caddr_t virtAddr)
    285 {
    286     return NULL;
    287285}
    288286
     
    317315    rtR0SegVBoxSolSetPageSize,
    318316    rtR0SegVBoxSolGetMemId,
    319     rtR0SegVBoxSolGetPolicy,
     317    NULL,                       /* getpolicy() */
    320318    rtR0SegVBoxSolCapable
    321319};
  • trunk/src/VBox/Runtime/r0drv/solaris/the-solaris-kernel.h

    r82968 r88215  
    203203extern bool                     g_frtSolOldThreadCtx;
    204204
     205/*
     206 * Workaround for older Solaris versions which called map_addr()/choose_addr()/
     207 * map_addr_proc() with an 'alignment' argument that was removed in Solaris
     208 * 11.4.
     209 */
     210typedef struct RTR0FNSOLMAPADDR
     211{
     212    union
     213    {
     214        void *(*pfnSol_map_addr)          (caddr_t *, size_t, offset_t, uint_t);
     215        void *(*pfnSol_map_addr_old)      (caddr_t *, size_t, offset_t, int, uint_t);
     216    } u;
     217} RTR0FNSOLMAPADDR;
     218typedef RTR0FNSOLMAPADDR *PRTR0FNSOLMAPADDR;
     219
     220extern RTR0FNSOLMAPADDR         g_rtSolMapAddr;
     221extern bool                     g_frtSolOldMapAddr;
     222
    205223/* Solaris globals. */
    206224extern uintptr_t                kernelbase;
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