1. 29 Jan, 2019 1 commit
    • David Johnson's avatar
      Move emergency_restart call out of bh in Linux ipod module on aarch64/powerpc64. · 4a801b22
      David Johnson authored
      Calling emergency_restart directly from the softirq/bh ipod icmp handler
      has a history of causing panics prior to the intended shutdown on both
      aarch64 and powerpc64.  The panics didn't inhibit the intended reboot,
      but on OPAL-booted ppc64le, were very noisy, because each "hyperthread"
      cpu attempted a dealloc of the irq handler from within the handler, so
      the console got a noisy stack trace for each thread.
      
      So now if IPOD_QUEUE_RESTART is defined (and it is by default on aarch64
      and powerpc64), we move the call to emergency_restart into a dedicated,
      preallocated workqueue thread, whose sole purpose is to (eventually)
      reboot the machine.  Wasteful, but we don't want to need to initialize
      anything, or use a shared workqueue, if an IPOD is really necessary, at
      IPOD time.
      4a801b22
  2. 05 Sep, 2018 1 commit
  3. 17 May, 2018 1 commit
  4. 10 Nov, 2016 1 commit
    • David Johnson's avatar
      Fix two bugs in skb processing in Linux ipod module. · 0e3d8b99
      David Johnson authored
      One was minor (not rolling the ip optional field length into
      pskb_may_pull check).  The second was not minor; we weren't
      appropriately calling pskb_may_pull to check if the iph + icmph + ipod secret
      was in a linear buf... and then we finally ran across a driver for which
      the ipod secret did not fully fit in the first skb buffer chunk... so
      linearization was actually necessary.
      
      Another way that has been suggested to fix the potential bugs that arise
      from linearization, the use of skb_header_pointer, isn't the most
      desireable option in this case, since it costs more stack memory *for
      each* input ICMP packet (and nearly 100% of the time, it's not an ipod
      and we don't care).
      0e3d8b99
  5. 12 Jul, 2016 1 commit
    • David Johnson's avatar
      Update the Linux ipod module to compat with at least kernel 4.4.x . · f214a3ec
      David Johnson authored
      There were changes to the netfilter hook API in 4.1 and 4.4 to account
      for, but those were simple.  No hook params we rely on changed.
      
      There was a minor change to the proc handler table conventions back in
      2.6.33, but that wasn't a deal-breaker.  Anyway, "fixed".
      
      Much more bizarre was an apparent proc_dointvec change.  Since some
      kernel between Ubuntu 3.13 and Ubuntu 4.2, proc_dointvec's behavior
      changed (well, *something* changed!).  Some of our ipod sysctls
      ("icmp_ipod_host" and "icmp_ipod_mask") are uint32ts, but we have been
      using proc_dointvec to parse the values sent in from sysctl, probably
      forever.  So of course we regularly have to send in large negative
      values (i.e. 155.98.32.70, aka 0x9b622046, aka -1688068026).  At 3.13,
      proc_dointvec was happy to parse the hex version of that.  At 4.2, it is
      not happy to parse the hex, but it will parse decimal.  Well, we don't
      supply decimal in rc.ipod, just hex, and I don't want to fix it there.
      So I switched those two sysctl's proc handlers to proc_dointvec_minmax,
      specify INT_MIN and INT_MAX as my min/max values, and that works like a
      charm.  Very odd that this would change.  Of course these should just
      use an unsigned proc handler, like proc_doulongvec, but I don't want to
      break the fact that you used to be able to send in negative decimal
      integers and have things work (an oft-used feature, no doubt, in some
      parallel universe!).
      
      This is tested and working back to UBUNTU12-64-STD.  It should be fine
      going further back, as far back as 2.4.x, but I can't easily test there.
      f214a3ec
  6. 12 May, 2015 1 commit
  7. 17 Sep, 2014 1 commit
  8. 09 Apr, 2013 1 commit
    • David Johnson's avatar
      Add a Linux kernel module for ipod. · 9436dfb0
      David Johnson authored
      Rather than have to patch the kernel's network stack at build time
      to catch ipod ICMP packets in the normal processing path, make it
      a loadable module that dynamically registers a netfilter hook to
      check ICMP packets for ipod info.  This way, we don't require
      custom-built kernels anymore to get ipod support.
      
      The only drawback to making it a module is that we now have to
      call emergency_restart() instead of machine_restart().  For x86
      kernels, this basically means that we don't do *any* niceties on
      shutdown.  For instance, even machine_restart() shuts down lapics
      and the iommu and deals with processors.  We can't call
      machine_restart because it's not exported as a symbol that modules
      can be linked with at load time.  kernel_restart() does way too
      much stuff that could block the reboot if things are in a bad state.
      
      Frankly, after looking at the difference between machine_restart
      and emergency_restart for the x86, we don't care.
      
      To build this module, all you should have to do, say, on Fedora, is
      
        $ yum install kernel-devel kernel-headers
        $ cd <moduledir>
        $ make && sudo make install
          (as long as you're running the kernel you're building for)
      9436dfb0