VirtualBox

Ignore:
Timestamp:
Sep 11, 2012 11:55:10 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
80723
Message:

Forward ported r78414 from 4.1: Fix VERR_NO_MEMORY loading VMMR0.r0 because of mt.lion executable memory fixes.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp

    r41052 r43303  
    395395extern "C" void OSMalloc(void);
    396396extern "C" void OSlibkernInit(void);
    397 extern "C" int  osrelease;
    398 extern "C" int  ostype;
    399397extern "C" void kdp_set_interface(void);
    400398
     
    743741                    RETURN_VERR_BAD_EXE_FORMAT;
    744742
    745                 if (pSeg->vmaddr != 0)
     743                if (   pSeg->vmaddr != 0
     744                    || !strcmp(pSeg->segname, "__PAGEZERO"))
    746745                {
    747746                    if (pSeg->vmaddr + RT_ALIGN_Z(pSeg->vmsize, RT_BIT_32(12)) < pSeg->vmaddr)
     
    775774                        case S_MOD_TERM_FUNC_POINTERS:
    776775                        case S_COALESCED:
     776                        case S_4BYTE_LITERALS:
    777777                            if (  pSeg->filesize != 0
    778778                                ? paSects[i].offset - pSeg->fileoff >= pSeg->filesize
     
    792792                        case S_SYMBOL_STUBS:
    793793                        case S_INTERPOSING:
    794                         case S_4BYTE_LITERALS:
    795794                        case S_8BYTE_LITERALS:
    796795                        case S_16BYTE_LITERALS:
  • trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp

    r42037 r43303  
    547547                        RTThreadPreemptRestore(&State);
    548548# endif
     549
     550                        /* Bug 6226: Ignore KERN_PROTECTION_FAILURE on Leopard and older. */
     551                        if (   rc == VERR_PERMISSION_DENIED
     552                            && version_major <= 9 /* 9 = 10.5.x = Leopard. */)
     553                            rc = VINF_SUCCESS;
    549554                    }
    550555                    else
     
    10341039                                   fMachProt);
    10351040    if (krc != KERN_SUCCESS)
     1041    {
     1042        static int s_cComplaints = 0;
     1043        if (s_cComplaints < 10)
     1044        {
     1045            s_cComplaints++;
     1046            printf("rtR0MemObjNativeProtect: vm_protect(%p,%p,%p,false,%#x) -> %d\n",
     1047                   pVmMap, (void *)Start, (void *)cbSub, fMachProt, krc);
     1048
     1049            kern_return_t               krc2;
     1050            vm_offset_t                 pvReal = Start;
     1051            vm_size_t                   cbReal = 0;
     1052            mach_msg_type_number_t      cInfo  = VM_REGION_BASIC_INFO_COUNT;
     1053            struct vm_region_basic_info Info;
     1054            RT_ZERO(Info);
     1055            krc2 = vm_region(pVmMap, &pvReal, &cbReal, VM_REGION_BASIC_INFO, (vm_region_info_t)&Info, &cInfo, NULL);
     1056            printf("rtR0MemObjNativeProtect: basic info - krc2=%d pv=%p cb=%p prot=%#x max=%#x inh=%#x shr=%d rvd=%d off=%#x behavior=%#x wired=%#x\n",
     1057                   krc2, (void *)pvReal, (void *)cbReal, Info.protection, Info.max_protection,  Info.inheritance,
     1058                   Info.shared, Info.reserved, Info.offset, Info.behavior, Info.user_wired_count);
     1059        }
    10361060        return RTErrConvertFromDarwinKern(krc);
     1061    }
    10371062
    10381063    /*
  • trunk/src/VBox/Runtime/r0drv/darwin/the-darwin-kernel.h

    r37575 r43303  
    6060#include <libkern/libkern.h>
    6161#include <libkern/sysctl.h>
     62#include <libkern/version.h>
    6263#include <mach/thread_act.h>
    6364#include <mach/vm_map.h>
     65#include <mach/vm_region.h>
    6466#include <pexpert/pexpert.h>
    6567#include <sys/conf.h>
     
    142144/* osfmk/vm/vm_user.c */
    143145extern kern_return_t vm_protect(vm_map_t, vm_offset_t, vm_size_t, boolean_t, vm_prot_t);
     146/*extern kern_return_t vm_region(vm_map_t, vm_address_t *, vm_size_t *, vm_region_flavor_t, vm_region_info_t,
     147                               mach_msg_type_number_t *, mach_port_t *);*/
    144148
    145149/* i386/machine_routines.h */
Note: See TracChangeset for help on using the changeset viewer.

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