]> git.saurik.com Git - apple/xnu.git/commitdiff
xnu-1699.22.81.tar.gz mac-os-x-1071 v1699.22.81
authorApple <opensource@apple.com>
Fri, 19 Aug 2011 15:06:14 +0000 (15:06 +0000)
committerApple <opensource@apple.com>
Fri, 19 Aug 2011 15:06:14 +0000 (15:06 +0000)
bsd/crypto/aes/i386/aes_modes_hw.s
bsd/crypto/aes/test/tstaes.c
bsd/hfs/hfs_vnops.c
config/MasterVersion
iokit/Kernel/IOPMrootDomain.cpp
iokit/Kernel/IOServicePM.cpp
iokit/Kernel/IOServicePMPrivate.h
osfmk/i386/AT386/model_dep.c

index 401fd3dd9b05ad4695aa114a955b2627556c91d3..574ee3c72ed14032e36d211823f0c351cad7d57a 100644 (file)
@@ -74,7 +74,7 @@
        The idea was actually described in the Intel AES Instruction Set White Paper (Rev. 2.0 page 53-55) \r
 \r
        This modification interleaves the aesdec/aesdeclast instructions for 4 blocks in cbc mode.\r
-       On a K18 (2.4GHz core-i5/2.66GHz core-i7), the x86_64 decrypt throughput (in xnu-iokit) has been improved\r
+       On a 2.4GHz core-i5/2.66GHz core-i7, the x86_64 decrypt throughput (in xnu-iokit) has been improved\r
        from 1180/1332 to 1667/1858 MBytes/sec. This is approximately 1.40 times speedup in the decryption.\r
        The encrypt throughput is not changed.  \r
 \r
index cbe364ed76f9661fbfd27ea6b0fdcd1c440ee79a..9d186ee772b5a201ea41b5ed98b8bd3e1af5704e 100644 (file)
@@ -46,7 +46,7 @@ uint32_t      data_size;
        cpu_freq = getFreq();
 
        if (cpu_freq == 0) {
-               fprintf(stderr, "this appears to be an N90 device, where cpu_freq can not be detected. set to 800MHz.\n");
+               fprintf(stderr, "this appears to be an iPhone device, where cpu_freq can not be detected. set to 800MHz.\n");
                cpu_freq = 800000000;
        } else {
                fprintf(stderr, "device max CPU clock rate = %.2f MHz\n", cpu_freq/1.e6);
index 4c526f77ba4e8b0c5251566cb468cd51fbb6ccb2..03c11347503f6bb739d79a4feba9f378de49d818 100644 (file)
@@ -3416,6 +3416,8 @@ hfs_vnop_rename(ap)
        int lockflags;
        int error;
        time_t orig_from_ctime, orig_to_ctime;
+       int emit_rename = 1;
+       int emit_delete = 1;
 
        orig_from_ctime = VTOC(fvp)->c_ctime;
        if (tvp && VTOC(tvp)) {
@@ -3424,10 +3426,55 @@ hfs_vnop_rename(ap)
                orig_to_ctime = ~0;
        }
 
-       check_for_tracked_file(fvp, orig_from_ctime, NAMESPACE_HANDLER_RENAME_OP, NULL);
+       hfsmp = VTOHFS(tdvp);
+       /* 
+        * Do special case checks here.  If fvp == tvp then we need to check the
+        * cnode with locks held.
+        */
+       if (fvp == tvp) {
+               int is_hardlink = 0;
+               /* 
+                * In this case, we do *NOT* ever emit a DELETE event.  
+                * We may not necessarily emit a RENAME event 
+                */     
+               emit_delete = 0;
+               if ((error = hfs_lock(VTOC(fvp), HFS_SHARED_LOCK))) {
+                       return error;
+               }
+               /* Check to see if the item is a hardlink or not */
+               is_hardlink = (VTOC(fvp)->c_flag & C_HARDLINK);
+               hfs_unlock (VTOC(fvp));
+               
+               /* 
+                * If the item is not a hardlink, then case sensitivity must be off, otherwise
+                * two names should not resolve to the same cnode unless they were case variants.
+                */
+               if (is_hardlink) {
+                       emit_rename = 0;
+                       /*
+                        * Hardlinks are a little trickier.  We only want to emit a rename event
+                        * if the item is a hardlink, the parent directories are the same, case sensitivity
+                        * is off, and the case folded names are the same.  See the fvp == tvp case below for more
+                        * info.
+                        */
+
+                       if ((fdvp == tdvp) && ((hfsmp->hfs_flags & HFS_CASE_SENSITIVE) == 0)) {
+                               if (hfs_namecmp((const u_int8_t *)fcnp->cn_nameptr, fcnp->cn_namelen,
+                                                       (const u_int8_t *)tcnp->cn_nameptr, tcnp->cn_namelen) == 0) {
+                                       /* Then in this case only it is ok to emit a rename */
+                                       emit_rename = 1;
+                               }
+                       }
+               }
+       }
+       if (emit_rename) {
+               check_for_tracked_file(fvp, orig_from_ctime, NAMESPACE_HANDLER_RENAME_OP, NULL);
+       }
 
        if (tvp && VTOC(tvp)) {
-               check_for_tracked_file(tvp, orig_to_ctime, NAMESPACE_HANDLER_DELETE_OP, NULL);
+               if (emit_delete) {
+                       check_for_tracked_file(tvp, orig_to_ctime, NAMESPACE_HANDLER_DELETE_OP, NULL);
+               }
        }
        
        /* 
@@ -3533,7 +3580,6 @@ hfs_vnop_rename(ap)
        fcp = VTOC(fvp);
        tdcp = VTOC(tdvp);
        tcp = tvp ? VTOC(tvp) : NULL;
-       hfsmp = VTOHFS(tdvp);
 
        /* Ensure we didn't race src or dst parent directories with rmdir. */
        if (fdcp->c_flag & (C_NOEXISTS | C_DELETED)) {
@@ -3799,14 +3845,48 @@ hfs_vnop_rename(ap)
                 */
                if (fvp == tvp) {
                        if (!(fcp->c_flag & C_HARDLINK)) {
+                               /* 
+                                * If they're not hardlinks, then fvp == tvp must mean we 
+                                * are using case-insensitive HFS because case-sensitive would
+                                * not use the same vnode for both.  In this case we just update
+                                * the catalog for: a -> A
+                                */
                                goto skip_rm;  /* simple case variant */
 
-                       } else if ((fdvp != tdvp) ||
+                       }
+                       /* For all cases below, we must be using hardlinks */   
+                       else if ((fdvp != tdvp) ||
                                   (hfsmp->hfs_flags & HFS_CASE_SENSITIVE)) {
+                               /*
+                                * If the parent directories are not the same, AND the two items
+                                * are hardlinks, posix says to do nothing:
+                                * dir1/fred <-> dir2/bob   and the op was mv dir1/fred -> dir2/bob
+                                * We just return 0 in this case.
+                                *
+                                * If case sensitivity is on, and we are using hardlinks 
+                                * then renaming is supposed to do nothing.
+                                * dir1/fred <-> dir2/FRED, and op == mv dir1/fred -> dir2/FRED
+                                */
                                goto out;  /* matching hardlinks, nothing to do */
 
                        } else if (hfs_namecmp((const u_int8_t *)fcnp->cn_nameptr, fcnp->cn_namelen,
                                               (const u_int8_t *)tcnp->cn_nameptr, tcnp->cn_namelen) == 0) {
+                               /*
+                                * If we get here, then the following must be true:
+                                * a) We are running case-insensitive HFS+.
+                                * b) Both paths 'fvp' and 'tvp' are in the same parent directory.
+                                * c) the two names are case-variants of each other.
+                                *
+                                * In this case, we are really only dealing with a single catalog record
+                                * whose name is being updated.
+                                * 
+                                * op is dir1/fred -> dir1/FRED
+                                * 
+                                * We need to special case the name matching, because if
+                                * dir1/fred <-> dir1/bob were the two links, and the 
+                                * op was dir1/fred -> dir1/bob
+                                * That would fail/do nothing.
+                                */
                                goto skip_rm;  /* case-variant hardlink in the same dir */
                        } else {
                                goto out;  /* matching hardlink, nothing to do */
index 8f5b9dd3463cae1c09b421de1e00f4f54e0e0426..20db06b5d60554d82051356f27028ee113a8138c 100644 (file)
@@ -1,4 +1,4 @@
-11.0.0
+11.1.0
 
 # The first line of this file contains the master version number for the kernel.
 # All other instances of the kernel version in xnu are derived from this file.
index e6146bb2432bb448bd38a318e26d8cd912f1a4df..81c6478e109c5f59b334db4e20b36ba1db6b5df8 100644 (file)
@@ -268,6 +268,7 @@ static UInt32           gPagingOff = 0;
 static UInt32           gSleepWakeUUIDIsSet = false;
 static uint32_t         gAggressivesState = 0;
 static uint32_t         gDarkWakeFlags = kDarkWakeFlagHIDTickleNone;
+static bool             gRAMDiskImageBoot = false;
 
 struct timeval gIOLastSleepTime;
 struct timeval gIOLastWakeTime;
@@ -845,6 +846,17 @@ bool IOPMrootDomain::start( IOService * nub )
         };
 
     PE_parse_boot_argn("darkwake", &gDarkWakeFlags, sizeof(gDarkWakeFlags));
+    
+    IORegistryEntry * chosenEntry = IORegistryEntry::fromPath("/chosen", gIODTPlane);
+    if (chosenEntry)
+    {
+        if (chosenEntry->getProperty("boot-ramdmg-size") &&
+            chosenEntry->getProperty("boot-ramdmg-extents"))
+        {
+            gRAMDiskImageBoot = true;
+        }
+        chosenEntry->release();
+    }
 
     queue_init(&aggressivesQueue);
     aggressivesThreadCall = thread_call_allocate(handleAggressivesFunction, this);
@@ -4360,6 +4372,13 @@ void IOPMrootDomain::overridePowerChangeForUIService(
         }
     }
 
+    if (gRAMDiskImageBoot &&
+        (actions->parameter & kPMActionsFlagIsDisplayWrangler))
+    {
+        // Tag devices subject to power suppression.
+        *inOutChangeFlags |= kIOPMPowerSuppressed;
+    }
+
     if (actions->parameter & kPMActionsFlagLimitPower)
     {
         uint32_t maxPowerState = (uint32_t)(-1);
@@ -4369,7 +4388,8 @@ void IOPMrootDomain::overridePowerChangeForUIService(
             // Enforce limit for system power/cap transitions.
 
             maxPowerState = 0;
-            if (actions->parameter & kPMActionsFlagIsDisplayWrangler)
+            if ((actions->parameter & kPMActionsFlagIsDisplayWrangler) &&
+                (!gRAMDiskImageBoot || (service->getPowerState() > 0)))
             {
                 // Forces a 3->1 transition sequence
                 if (changeFlags & kIOPMDomainWillChange)
index bd7bcd0024d8918dbc85e7a347af2c1d3ff7e8fd..11efcab256d367c193e9b0905ad737905dfd9062 100644 (file)
@@ -4019,6 +4019,15 @@ void IOService::all_done ( void )
                          ((fHeadNoteChangeFlags & kIOPMDomainDidChange)  &&
              (fCurrentPowerState < fHeadNotePowerState)))
         {
+            if ((fHeadNoteChangeFlags & kIOPMPowerSuppressed) &&
+                (fHeadNotePowerState != fCurrentPowerState) &&
+                (fHeadNotePowerState == fDesiredPowerState))
+            {
+                // Power changed, and desired power state restored.
+                // Clear any prior power desire while in suppressed state.
+                requestDomainPower(fHeadNotePowerState);
+            }
+
             // did power raise?
             if ( fCurrentPowerState < fHeadNotePowerState )
             {
index 96e5bfaccc6c7933ff41cc54544c13f3ea9fea62..00f53cdfe834d71c77dc06b91be53d0d5c9a18cc 100644 (file)
@@ -442,6 +442,7 @@ the ack timer is ticking every tenth of a second.
 #define kIOPMSyncNoChildNotify      0x0200  // sync root domain only, not entire tree
 #define kIOPMSyncTellPowerDown      0x0400  // send the ask/will power off messages
 #define kIOPMSyncCancelPowerDown    0x0800  // sleep cancel for maintenance wake
+#define kIOPMPowerSuppressed        0x1000  // power suppressed for dark wake
 
 enum {
     kDriverCallInformPreChange,
index c21012552ff988a1f7fa50026c1cd23513696822..b020ed4196e05a09d795037757e772672487a096 100644 (file)
@@ -968,7 +968,7 @@ panic_print_macho_symbol_name(kernel_mach_header_t *mh, vm_address_t search, con
                 orig_le = orig_sg;
             else if (strncmp("", orig_sg->segname,
                                    sizeof(orig_sg->segname)) == 0)
-                orig_ts = orig_sg; /* pre-Barolo i386 kexts have a single unnamed segment */
+                orig_ts = orig_sg; /* pre-Lion i386 kexts have a single unnamed segment */
         }
         else if (cmd->cmd == LC_SYMTAB)
             orig_st = (struct symtab_command *) cmd;