Skip to content
Snippets Groups Projects
  1. Oct 30, 2013
    • Avi Kivity's avatar
      x64: fix TLS segment alignment · 15d30a11
      Avi Kivity authored
      
      The TLS segment is a little wierd in that it grows backwards from percpu_base
      instead of forwards.  This causes the alignment code to calculate wrong
      offsets when the segment size is 8 (mod 16).  A failure was seen where
      ::percpu_base was set at offset 0xfffffffffffffa08 in code that was in the
      same translation unit as ::percpu_base, and 0xfffffffffffffa10 elsewhere.
      This caused all dynamic_percpu instances to crash.
      
      Fix by aligning the segment size.  For good measure, align also the segment
      base, both to a cacheline boundary.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      15d30a11
  2. Oct 29, 2013
  3. Oct 28, 2013
    • Avi Kivity's avatar
      x64: fix APIC ID register read on QEMU · c19e28f4
      Avi Kivity authored
      
      The expression *p >> 24, where p is an unsigned*, is optimized by
      the compiler to *((u8*)p + 3) - reading the most significant byte only and
      dropping the shift.
      
      When this optimization is applied to reading the APIC ID, QEMU
      returns zero for all processors, since the manual requires reading
      entire words.
      
      Fix by using a volatile pointer, disabling the optimization.
      
      Note that QEMU is technically correct here though it violates all known
      real x86 implementations.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      c19e28f4
    • Avi Kivity's avatar
      x64: fix xapic INIT IPI · e7ba2287
      Avi Kivity authored
      
      xapic::init_ipi() shifts apic_id by 24, unaware that xapic::ipi will do it
      again.  The result is that the boot processor is reset instead of the
      auxiliary processor.
      
      Remove the extraneous shift.
      
      Found by booting with QEMU without kvm.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      e7ba2287
    • Pekka Enberg's avatar
      drivers/xenfront-xenbus: Fix scanf() variable type · 3832440a
      Pekka Enberg authored
      
      Spotted by GCC with '-Wformat=1':
      
      ../../drivers/xenfront-xenbus.cc: In function ‘XenbusState xenbus_get_state(device_t)’:
      ../../drivers/xenfront-xenbus.cc:219:80: warning: format ‘%d’ expects argument of type ‘int*’, but argument 6 has type ‘XenbusState* {aka xenbus_state*}’ [-Wformat=]
           xs_scanf(XST_NIL, dev->get_node_path().c_str(), "state", NULL, "%d", &state);
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      3832440a
    • Pekka Enberg's avatar
      bsd: Fix printf format string · 55542075
      Pekka Enberg authored
      
      Spotted by GCC with '-Wformat=1':
      
      ../../bsd/sys/netinet/tcp_subr.c: In function ‘tcp_log_addr’:
      ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: unknown conversion type character ‘b’ in format [-Wformat=]
         sprintf(sp, " tcpflags 0x%b", th->th_flags, PRINT_TH_FLAGS);
         ^
      ../../bsd/sys/netinet/tcp_subr.c:2286:3: warning: too many arguments for format [-Wformat-extra-args]
      
      BSD has some nice printf extension for printing out bitfields. We don't
      so switch to hexadecimal output.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      55542075
    • Pekka Enberg's avatar
      build: Add 'werror' option to Makefile · f6360170
      Pekka Enberg authored
      
      Add 'werror' option to Makefile that can be used to disable the -Werror
      GCC option temporarily as follows:
      
        make werror=0
      
      This is useful when fixing up build breakage caused by addition of new
      default compiler warnings.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      f6360170
    • Pekka Enberg's avatar
      percpu: Fix arithmetic on pointer to void · 8dbcbbf1
      Pekka Enberg authored
      
      Spotted by Clang:
      
      In file included from ../../loader.cc:27:
      In file included from ../../drivers/virtio-net.hh:12:
      In file included from ../../bsd/sys/net/if_var.h:80:
      In file included from ../../bsd/sys/sys/mbuf.h:40:
      In file included from ../../bsd/porting/uma_stub.h:161:
      ../../include/osv/percpu.hh:35:42: error: arithmetic on a pointer to void
              return reinterpret_cast<T*>(base + offset);
                                          ~~~~ ^
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      8dbcbbf1
    • Avi Kivity's avatar
      build: run mkfs with one vcpu · 569bbd99
      Avi Kivity authored
      
      smp doesn't currently work on non-accelerated qemu, and doesn't help anyway
      during mkfs.  Restrict ourselves to 1 vcpu to avoid problems.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      569bbd99
    • Avi Kivity's avatar
      run: auto-detect the hypervisor · 88d0a0e1
      Avi Kivity authored
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      88d0a0e1
  4. Oct 27, 2013
  5. Oct 25, 2013
  6. Oct 24, 2013
Loading