libxc: Free logger after printing error message

On error, PERROR calls the already destroyed logger, which can segfault.
Re-order the calls, so the logger is still available.

Signed-off-by: Jason Andryuk <andryuk@aero.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
libxl: add option for discard support to xl disk configuration

Handle new boolean option discard/no-discard for disk configuration. It
is supposed to disable discard support if file based backing storage was
intentionally created non-sparse to avoid fragmentation of the file.

The option intended for the backend driver. A new boolean property
"discard-enable" is written to the backend node. An upcoming patch for
qemu will make use of this property. The kernel blkback driver may be
updated as well to disable discard for phy based backing storage.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
x86/boot: drop pre-C IDT patching

It is not needed now that __start_xen sets itself up with complete trap
handlers as its first action.  This fixes a potential issue introduced in

  c/s 7e510a7b874
  "x86/boot: move some __high_start code and data into init sections"

which would leave ignore_int (in the .init section) patched into the reserved
exceptions in all IDTs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
x86/irqs: move interrupt-stub generation out of C

In addition, generate stubs for reserved exceptions.  These go through the
standard handle_exception mechanism, although the C handler do_reserved_trap()
is a terminal error path.

 * Move all automatic stub generation out of i8259.c and into entry.S.
 * Move patching of the master IDT into trap_init(). Provide ASSERT()s to
   ensure we have fully populated the IDT and don't accidentally clobbered any
   preexisting traps.
 * Demote TRAP_copro_seg and TRAP_spurious_int to being reserved exceptions
   and remove their custom entry points.
 * Point double_fault's exception_table entry at do_reserved_trap.  We do not
   ever expect to enter a real double fault this way.
 * Acquaint Xen with #VE but leave it reserved.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
x86/misc: post cleanup

* panic() now works on early boot.  Replace EARLY_FAIL()
* Cleanup __set_intr_gate() & friends.  The master IDT is fully constructed on
  early boot, and only subsequently altered on the crash path.  Make them
  private to traps.c, move them into .init, and remove the loop over all idts,
  as __set_intr_gate() will never find an AP to patch. (For some reason,
  leaving out the noinline causes ~1.5k of code bloat from GCC inlining
  everything)
* No need to clear X86_EFLAGS_NT in cpu_init().  This is covered by the eflags
  reset in __high_start().
* Missing '\n' from unexpected MCE printk.
* load_system_tables() is x86 specific.  Move its declaration into an x86 header.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
add Yang and Kevin as the new maintainer of VT-d stuff

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>

Restricted the change's effect to what its subject says: Replace the
VT-d maintainers, i.e. drop the new additions for the generic IOMMU
code for the time being.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
libxl: Rerun flex/bison for xl discard support

In 417e6b70 I overlooked the requirement to rerun bison/flex.  Do that
now.  The changes are exactly those which are the result of 417e6b70.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>