1. 30 9月, 2006 3 次提交
    • J
      [PATCH] uml: locking documentation · 730760e9
      Jeff Dike 提交于
      Some locking documentation and a cleanup.  uml_exitcode is copied into a local
      before sprintf sees it, in case sprintf does anything non-atomic with it.
      
      The rest are comments about why certain globals don't need any kind of
      locking.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      730760e9
    • J
      [PATCH] uml: mechanical tidying after random MACs change · b10aeeef
      Jeff Dike 提交于
      Mechanical, hopefully non-functional changes stemming from
      setup_etheraddr always succeeding now that it always assigns a MAC,
      either from the command line or generated randomly:
         the test of the return of setup_etheraddr is removed, and code
      dependent on it succeeding is now unconditional
         setup_etheraddr can now be made void
         struct uml_net.have_mac is now always 1, so tests of it can be
      similarly removed, and uses of it can be replaced with 1
         struct uml_net.have_mac is no longer used, so it can be removed
         struct uml_net_private.have_mac is copied from struct uml_net, so
      it is always 1
         tests of uml_net_private.have_mac can be removed
         uml_net_private.have_mac can now be removed
         the only call to dev_ip_addr was removed, so it can be deleted
      
      It also turns out that setup_etheraddr is called only once, from the same
      file, so it can be static and its declaration removed from net_kern.h.
      
      Similarly, set_ether_mac is defined and called only from one file.
      
      Finally, setup_etheraddr and set_ether_mac were moved to avoid needing forward
      declarations.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b10aeeef
    • J
      [PATCH] uml: assign random MACs to interfaces if necessary · f3e7ed2b
      Jeff Dike 提交于
      Assign a random MAC to an ethernet interface if one was not provided on the
      command line.  This became pressing when distros started bringing interfaces
      up before assigning IPs to them.  The previous pattern of assigning an IP then
      bringing it up allowed the MAC to be generated from the first IP assigned.
      However, once the thing is up, it's probably a bad idea to change the MAC, so
      the MAC stayed initialized to fe:fd:0:0:0:0.
      
      Now, if there is no MAC from the command line, one is generated.  We use the
      microseconds from gettimeofday (20 bits), plus the low 12 bits of the pid to
      seed the random number generator.  random() is called twice, with 16 bits of
      each result used.  I didn't want to have to try to fill in 32 bits optimally
      given an arbitrary RAND_MAX, so I just assume that it is greater than 65536
      and use 16 bits of each random() return.
      
      There is also a bit of reformatting and whitespace cleanup here.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f3e7ed2b
  2. 29 9月, 2006 1 次提交
  3. 27 9月, 2006 13 次提交
  4. 26 9月, 2006 17 次提交
  5. 01 8月, 2006 1 次提交
    • R
      [PATCH] vDSO hash-style fix · 0b0bf7a3
      Roland McGrath 提交于
      The latest toolchains can produce a new ELF section in DSOs and
      dynamically-linked executables.  The new section ".gnu.hash" replaces
      ".hash", and allows for more efficient runtime symbol lookups by the
      dynamic linker.  The new ld option --hash-style={sysv|gnu|both} controls
      whether to produce the old ".hash", the new ".gnu.hash", or both.  In some
      new systems such as Fedora Core 6, gcc by default passes --hash-style=gnu
      to the linker, so that a standard invocation of "gcc -shared" results in
      producing a DSO with only ".gnu.hash".  The new ".gnu.hash" sections need
      to be dealt with the same way as ".hash" sections in all respects; only the
      dynamic linker cares about their contents.  To work with older dynamic
      linkers (i.e.  preexisting releases of glibc), a binary must have the old
      ".hash" section.  The --hash-style=both option produces binaries that a new
      dynamic linker can use more efficiently, but an old dynamic linker can
      still handle.
      
      The new section runs afoul of the custom linker scripts used to build vDSO
      images for the kernel.  On ia64, the failure mode for this is a boot-time
      panic because the vDSO's PT_IA_64_UNWIND segment winds up ill-formed.
      
      This patch addresses the problem in two ways.
      
      First, it mentions ".gnu.hash" in all the linker scripts alongside ".hash".
       This produces correct vDSO images with --hash-style=sysv (or old tools),
      with --hash-style=gnu, or with --hash-style=both.
      
      Second, it passes the --hash-style=sysv option when building the vDSO
      images, so that ".gnu.hash" is not actually produced.  This is the most
      conservative choice for compatibility with any old userland.  There is some
      concern that some ancient glibc builds (though not any known old production
      system) might choke on --hash-style=both binaries.  The optimizations
      provided by the new style of hash section do not really matter for a DSO
      with a tiny number of symbols, as the vDSO has.  If someone wants to use
      =gnu or =both for their vDSO builds and worry less about that
      compatibility, just change the option and the linker script changes will
      make any choice work fine.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Andi Kleen <ak@muc.de>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      0b0bf7a3
  6. 16 7月, 2006 1 次提交
  7. 15 7月, 2006 3 次提交
  8. 11 7月, 2006 1 次提交