Commit Graph
129 Commits
Author SHA1 Message Date
Manuel Bouyer 5e53349960 tools/gdbsx: Use right path for privcmd on NetBSD
On NetBSD the privcmd interface node is /kern/xen/privcmd

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2021-01-18 19:07:37 +00:00
Jan Beulich 6ee2e66674 tools/gdbsx: drop stray recursion into tools/include/
Doing so isn't appropriate here - this gets done very early in the build
process. If the directory is mean to to be buildable on its own,
different arrangements would be needed.

The issue has become more pronounced by 47654a0d73 ("tools/include:
fix (drop) dependencies of when to populate xen/"), but was there before
afaict.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2020-10-15 17:18:25 +02:00
Wei Liu d44cbbe0f3 kdd: fix build again
Restore Tim's patch. The one that was committed was recreated by me
because git didn't accept my saved copy. I made some mistakes while
recreating that patch and here we are.

Fixes: 3471cafbdd ("kdd: stop using [0] arrays to access packet contents")
Reported-by: Michael Young <m.a.young@durham.ac.uk>
Signed-off-by: Wei Liu <wl@xen.org>
Reviewed-by: Tim Deegan <tim@xen.org>
Release-acked-by: Paul Durrant <paul@xen.org>
2020-07-06 08:38:03 +00:00
Tim Deegan 3471cafbdd kdd: stop using [0] arrays to access packet contents
GCC 10 is unhappy about this, and we already use 64k buffers
in the only places where packets are allocated, so move the
64k size into the packet definition.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Paul Durrant <paul@xen.org>
2020-06-26 10:41:33 +00:00
Julian Tuminaro 0022387cef Fix the KDD_LOG statements to use appropriate format specifier for printing uint64_t
Previous commit in kdd.c had a small issue which lead to warning/error while compiling
on 32-bit systems due to mismatch of type size while doing type cast from uint64_t to
void *

Signed-off-by: Jenish Rakholiya <rjenish@cmu.edu>
Signed-off-by: Julian Tuminaro <jtuminar@andrew.cmu.edu>
Acked-by: Tim Deegan <tim@xen.org>
2019-12-01 22:06:15 +00:00
julian.tuminaro@gmail.com 53e9ecffde kdd.c: Add support for initial handshake in KD protocol for Win 7, 8 and 10 (64 bit)
Current implementation of find_os is based on the hard-coded values for
different Windows version. It uses the value for get the address to
start looking for DOS header in the given specified range. However, this
is not scalable to all version of Windows as it will require us to keep
adding new entries and also due to KASLR, chances of not hitting the PE
header is significant. We implement a way for 64-bit systems to use IDT
entry to get a valid exception/interrupt handler and then move back into
the memory to find the valid DOS header. Since IDT entries are protected
by PatchGuard, we think our assumption that IDT entries will not be
corrupted is valid for our purpose. Once we have the image base, we
search for the DBGKD_GET_VERSION64 structure type in .data section to
get information required for handshake.

Currently, this is a work in progress feature and current patch only
supports the handshake and memory read/write on 64-bit systems.

NOTE: This is the Updated version of the previous patch submitted
NOTE: This has currently been only tested when debugging was not enabled
on the guest Windows.

Signed-off-by: Jenish Rakholiya <rjenish@cmu.edu>
Signed-off-by: Julian Tuminaro <jtuminar@andrew.cmu.edu>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: Paul Durrant <paul@xen.org>
2019-11-29 20:49:34 +00:00
Ian Jackson 70c7c34cc6 tools/debugger/kdd: Install as xen-kdd', not just kdd'
`kdd' is an unfortunate namespace landgrab.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
2018-10-15 14:49:33 +01:00
Ian Jackson 7606995e7a gdbsx: Honour LDFLAGS when linking
This command does the link, so it needs LDFLAGS.

Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
2018-10-15 14:49:33 +01:00
Wei Liu 48a70499e6 tools/kdd: work around gcc 8.1 bug
Gcc 8.1 has a bug that causes kdd fail to build. Rewrite the code to
work around that bug.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86827

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-08-20 11:49:46 +01:00
Marek Marczykowski-Górecki ed5f8d9ca4 tools/gdbsx: use inttypes.h instead of custom macros
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
[ wei: fix up patch ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-08-01 10:39:47 +01:00
Marek Marczykowski-Górecki 0c9821d5c8 tools/gdbsx: fix 'g' packet response for 64bit guests
gdb 8.0 fixed bounds checking for 'g' packet (commit
9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
registers in process_g_packet"). This revealed that gdbsx did
not properly formatted 'g' packet - segment registers and eflags are
expected to be 32-bit fields in the response (according to
gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:

    Truncated register 26 in remote 'g' packet

instead of silently truncating part of register.

Additionally, it looks like segment registers of 64bit guests were never
reported correctly, because of type mismatch.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2018-08-01 10:26:11 +01:00
Wei Liu 1626164929 tools/gdbsx: fix build with clang 3.8
Currently building gdbsx with clang 3.8 gives the following errors:

xg_main.c:783:17: error: 'aligned' attribute ignored when parsing type [-Werror,-Wignored-attributes]
    iop->uva = (uint64_aligned_t)((unsigned long)tobuf);
                ^~~~~~~~~~~~~~~~
/builds/liuw/xen/tools/debugger/gdbsx/xg/../../../../tools/include/xen/arch-x86/xen-x86_32.h:105:50: note: expanded from macro 'uint64_aligned_t'
                                                 ^~~~~~~~~~
xg_main.c:816:17: error: 'aligned' attribute ignored when parsing type [-Werror,-Wignored-attributes]
    iop->uva = (uint64_aligned_t)((unsigned long)frombuf);
                ^~~~~~~~~~~~~~~~
/builds/liuw/xen/tools/debugger/gdbsx/xg/../../../../tools/include/xen/arch-x86/xen-x86_32.h:105:50: note: expanded from macro 'uint64_aligned_t'

According to https://bugs.llvm.org/show_bug.cgi?id=11071, this issue has
been fixed in clang. But we're not going to get that in 3.8.

Explicitly disable that warning to fix the build.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-07-24 09:16:01 +01:00
Marek Marczykowski-Górecki 2de2b10b22 tools/kdd: alternative way of muting spurious gcc warning
Older gcc does not support #pragma GCC diagnostics, so use alternative
approach - change variable type to uint32_t (this code handle 32-bit
requests only anyway), which apparently also avoid gcc complaining about
this (otherwise correct) code.

Fixes 437e00fea0 "tools/kdd: mute spurious
gcc warning"

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
2018-05-29 10:51:02 +01:00
Marek Marczykowski-Górecki 437e00fea0 tools/kdd: mute spurious gcc warning
gcc-8 complains:

    kdd.c:698:13: error: 'memcpy' offset [-204, -717] is out of the bounds [0, 216] of object 'ctrl' with type 'kdd_ctrl' {aka 'union <anonymous>'} [-Werror=array-bounds]
                 memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    kdd.c: In function 'kdd_select_callback':
    kdd.c:642:14: note: 'ctrl' declared here
         kdd_ctrl ctrl;
                  ^~~~

But this is impossible - 'offset' is unsigned and correctly validated
few lines before.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-Acked-by: Juergen Gross <jgross@suse.com>
2018-04-06 09:06:19 +01:00
Marek Marczykowski-Górecki 7f601f7c34 tools/gdbsx: fix -Wstringop-truncation warning
gcc-8 complains:

    gx_main.c: In function 'prepare_stop_reply':
    gx_main.c:385:9: error: 'strncpy' output truncated before terminating nul copying 6 bytes from a string of the same length [-Werror=stringop-truncation]
             strncpy(buf, "watch:", 6);
             ^~~~~~~~~~~~~~~~~~~~~~~~~

Since terminating '\0' isn't needed here at all, switch to memcpy.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-Acked-by: Juergen Gross <jgross@suse.com>
2018-04-06 09:06:01 +01:00
Doug Goldstein 9f592d1030 gdbsx: prefer privcmd character device
Prefer using the character device over the proc file if the character
device exists.

CC: Elena Ufimtseva <elena.ufimtseva@oracle.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
2017-11-02 16:42:40 +00:00
Ian Jackson 300929f6e4 DEPS handling: Use DEPS_RM everywhere
DEPS_RM is currently the same as DEPS, so no functional change.

This patch is the result of two perl runes:

  git-grep -l 'rm.*DEPS' | xargs perl -i~ -pe 'next unless m/^\t+rm\b/; s/\bDEPS\b/DEPS_RM/;'

  git-grep -l 'RM.*DEPS' | xargs perl -i~ -pe 'next unless m/^\t+\$\(RM\)/; s/\bDEPS\b/DEPS_RM/;'

And editing  tools/xenstat/libxenstat/Makefile  by hand.

I verified that I didn't miss anything with this rune:

  git-grep '\bDEPS\b' | grep -v include |less

Reported-by: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-09-07 16:21:45 +01:00
Petre Pircalabu f2b40dabab Makefile: Fix uninstall target
Running "make uninstall" does not remove all installed files, a
situation which might cause link related issues if xen is re-installed
in a different location.
In order to make uninstall correctly remove the files it is best
the process should be done recursively by mirroring each "install"
target with an "uninstall" who removes the installed files.

An exception to this rule is uninstalling the files produced by
"qemu-xen-dir-remote" and "qemu-xen-traditional-dir", which are external
to the project. These projects do not implement an "uninstall" target so
the files have to be removed manually.

Signed-off-by: Petre Pircalabu <ppircalabu@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2017-07-28 17:47:42 +01:00
Roger Pau Monne 33e5c32559 x86: remove PVHv1 code
This removal applies to both the hypervisor and the toolstack side of PVHv1.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
2017-03-16 14:50:10 +00:00
Tim Deegan bfd9a2095f tools/kdd: don't use a pointer to an unaligned field.
The 'val' field in the packet is byte-aligned (because it is part of a
packed struct), but the pointer argument to kdd_rdmsr() has the normal
alignment constraints for a uint64_t *.  Use a local variable to make sure
the passed pointer has the correct alignment.

Reported-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com>
2017-03-15 10:57:00 +00:00
Andrew Cooper bec4135fdc tools/kdd: Fix uninitialised variable warning
Clang warns:

  kdd.c:1031:9: error: variable 'fd' is used uninitialized whenever '||'
  condition is true [-Werror,-Wsometimes-uninitialized]
      if (argc != 4
          ^~~~~~~~~
  kdd.c:1040:20: note: uninitialized use occurs here
      if (select(fd + 1, &fds, NULL, NULL, NULL) > 0)
                 ^~

This situation can't actually happen, as usage() is a terminal path.  Annotate
it appropriately.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-04-27 20:31:48 +01:00
Ian Campbell 3237645813 tools: Do not expose all builds to unstable hypercall APIs by default
Currently __XEN_TOOLS__ is defined in the global CFLAGS used for tools
builds, exposing them all to the various unstable hypercall interfaces.

However there are places where we do not want this (in particular all
the stable libraries now under tools/libs), and there is a risk of
such uses slipping in unnoticed (currently there are none, but I
tripped over the mixed nature of the HVMOPs just now in some new code
I was putting together).

Instead only define __XEN_TOOLS__ for things which explicitly want the
unstable APIs. The vast majority of these are consumers of libxenctrl,
which have opted into unstable interfaces by using libxenctrl already,
so adding -D__XEN_TOOLS__ to CFLAGS_libxenctrl covers these without
needing to patch the dozen or so tools manually.

The libxc build itself, which doesn't use CFLAGS_libxenctrl, now needs
the define too. As does gdbsx's own low level hypercall binding
library xg.

hvmloader no longer needs to undefine the symbol.

The ocaml evtchn bindings don't actually need sysctl.h and therefore
don't actually need __XEN_TOOLS__ either.

qemu-xen-traditional doesn't use CFLAGS_libxenctrl and so we pass the
define there (via --extra-cflags) too.

Having removed __XEN_TOOLS__ replace it with
__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ so that in
tree code is always using the latest APIs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-02-04 15:20:40 +00:00
Ian Campbell 5e0da2ac71 kdd: build using Werror
We build most of tools using Werror and there seems to be no
deliberate reason for this to be an exception.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
2016-01-25 14:18:24 +00:00
Ian Campbell dc825dde07 kdd: Opt in to libxc compat xc_map_foreign_* intefaces.
This:

kdd-xen.c: In function 'kdd_access_physical_page':
kdd-xen.c:508:9: warning: implicit declaration of function 'xc_map_foreign_range' [-Wimplicit-function-declaration]
         map = xc_map_foreign_range(g->xc_handle,
         ^
kdd-xen.c:508:13: warning: assignment makes pointer from integer without a cast
         map = xc_map_foreign_range(g->xc_handle,
             ^

was caused by the refactoring of this functionality into
libxenforeignmemory.

Reported by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Tested-by: Olaf Hering <olaf@aepfle.de>
2016-01-25 14:18:24 +00:00
Ian Campbell 443701ef0c Replace FSF street address with canonical URL
As recommended in http://www.gnu.org/licenses/gpl-howto.en.html.

This is the result of:
$ git grep -El Mass\|Temple\|Franklin | xargs ./fsf.pl

Where fsf.pl is:
    #!/usr/bin/perl -w -pi.bak -0777
    my $repl = 'If not, see <http://www.gnu.org/licenses/>.';
    my $br = qr/(?:\s*\n\s*(?:[\*\#]|\/\/|\.\\" )?\s*|\s+)/;

    my $inwt = qr/[Ii]f${br}not,${br}write${br}(?:to${br})?the${br}Free${br}Software${br}Foundation,(?:${br}Inc\.,)?/;

    my $mass = qr/675${br}Mass${br}Ave,?${br}Cambridge,?${br}MA${br}02139,?${br}USA,?\.?/;
    my $franklin = qr/51${br}Franklin${br}St(?:reet)?(?:,${br}| - )Fifth${br}Floor,?${br}Boston,?${br}MA,?${br}02110-1301,?${br}USA,?\.?/;
    my $temple = qr/59${br}Temple${br}Place(?:,${br}| - )Suite${br}330,?${br}Boston,?${br}MA,?${br}021110?-1307,?${br}USA,?\.?/;

    s|$inwt$br$mass|$repl|m;
    s|$inwt$br$franklin|$repl|m;
    s|$inwt$br$temple|$repl|m;

The only remaining mentions of these addresses are in COPYING files which I
haven't touched.

Some of the changed files are imports from elsewhere, however
filtering them out is tricky, I think it is tolerable to have these
files be modified here and then perhaps reverted on the next sync,
since it's only 1-2 lines and obvious what is going on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2015-07-29 11:14:07 +01:00
Olaf Hering 8e986e5a61 tools: replace private SBINDIR with automake sbindir
Reuse automake variable instead of inventing a private variable.

The result of this command:
 git grep -wnl SBINDIR | xargs sed -i 's@SBINDIR@sbindir@g'

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: David Scott <dave.scott@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-05-21 15:12:10 +01:00
Wei Liu f9c9b12775 tools: fix "make distclean"
The original rule to target "distclean" in tools/Rules.mk was in effect
"make clean". It should be "make distclean".

However not all Makefiles in subdirectories have distclean target
defined. So this patch also adds a bunch of distclean targets to various
Makefiles. They only depend on clean target and don't have any actions
in most cases.

With the patch applied, following command outputs 0 results:

  find tools -name 'Makefile*' -exec grep -L 'distclean' {} \+ \
     | grep -v ocaml | grep -v libfsimage

Ocaml and libfsimage are known to have distclean defined in a dedicated
rules file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2015-01-27 16:34:45 +00:00
Roger Pau Monne aa14d8b5f2 gdbsx: remove cast from ioctl
The ulong type is not defined on FreeBSD, and the cast seems
pointless, so just remove it.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2014-05-02 13:34:35 +01:00
Olaf Hering 939182a43d tools/debugger: append APPEND_LDFLAGS to link command
Required to pass -Wl,-rpath,$libdir to link command.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-04-23 12:21:34 +01:00
Don Slutz f91dc2000a xg_main: If XEN_DOMCTL_gdbsx_guestmemio fails then force error.
Without this gdb does not report an error.

With this patch and using a 1G hvm domU:

(gdb) x/1xh 0x6ae9168b
0x6ae9168b:     Cannot access memory at address 0x6ae9168b

Drop output of iop->remain because it most likely will be zero.
This leads to a strange message:

ERROR: failed to read 0 bytes. errno:14 rc:-1

Add address to write error because it may be the only message
displayed.

Note: currently XEN_DOMCTL_gdbsx_guestmemio does not change 'iop' on
error and so iop->remain will be zero.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2014-01-15 13:01:31 +00:00
Don Slutz dfbd3d62cd xg_read_mem: Report on error.
I had coded this with XGERR, but gdb will try to read memory without
a direct request from the user.  So the error message can be confusing.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2014-01-15 13:01:31 +00:00
Don Slutz 025c1b755a gdbsx: Add Emacs local variables to source files.
These 2 files are changed in this patch set.  So add the allowed
"Emacs local variables" from CODING_STYLE.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-01-08 15:13:47 +00:00
Mukesh Rathor dffc22a158 pvh support for gdbsx
Add pvh support to gdbsx so it can be used to debug pvh domUs.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2013-11-26 10:48:55 +00:00
Matthew Daley 6c1bfef445 gdbsx: clear sockaddr before using it
...so that sin_zero is actually zero.

Coverity-ID: 1056070
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-09-21 16:43:13 +01:00
Matthew Daley da89e7ef29 kdd: fix free of array-typed value
g->id is an array and is allocated as part of g itself; it's not a
separate allocation.

Coverity-ID: 1054980
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2013-09-13 13:15:09 +01:00
Daniel Kiper 38bdfb9197 tools/debugger/kdd: Remove dependencies files during make clean
Remove dependencies files during make clean.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2013-05-08 12:14:30 +01:00
Michael Young d119301b58 tools: Fix memset(&p,0,sizeof(p)) idiom in several places.
gcc 4.8 identifies several places where code of the form memset(x, 0,
sizeof(x)); is used incorrectly, meaning that less memory is set to
zero than required.

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Committed-by: Keir Fraser <keir@xen.org>
2013-02-13 17:00:15 +00:00
Olaf Hering 5d98adc3e5 tools/gdbsx: fix build failure with glibc-2.17
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
2012-12-06 16:50:48 +00:00
Ian Campbell e567964a54 tools: drop ia64 support
Removed support from libxc and mini-os.

This also took me under xen/include/public via various symlinks.

Dropped tools/debugger/xenitp entirely, it was described upon commit
as:
"Xenitp is a low-level debugger for ia64" and doesn't appear to be
linked into the build anywhere.

 99 files changed, 14 insertions(+), 32361 deletions(-)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-09-12 17:55:27 +01:00
Ian Jackson 85896a7c4d build: add autoconf to replace custom checks in tools/check
Added autotools magic to replace custom check scripts. The previous
checks have been ported to autoconf, and some additional ones have
been added (plus the suggestions from running autoscan). Two files are
created as a result from executing configure script, config/Tools.mk
and config.h.

conf/Tools.mk is included by tools/Rules.mk, and contains most of the
options previously defined in .config, that can now be set passing
parameters or defining environment variables when executing configure
script.

config.h is only used by libxl/xl to detect yajl_version.h.

[ tools/config.sub and config.guess copied from
  autotools-dev 20100122.1 from Debian squeeze i386,
  which is GPLv2.

  tools/configure generated using the included ./autogen.sh
  which ran autoconf 2.67-2 from Debian squeeze i386.  autoconf
  is GPLv3+ but has a special exception for the autoconf output;
  this exception applies to us and exempts us from complying
  with GPLv3+ for configure, which is good as Xen is GPL2 only.

  - Ian Jackson ]

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-02-22 01:55:03 +00:00
Ian Campbell 9ac650d825 tools: remove pattern matched linking rules
Most subdirs only build a single tool to start with and those which
build multiple tools often have different linkage requirements.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:34:56 +01:00
Ian Campbell 61d0fe74c6 tools: Remove $(CFLAGS) from links lines.
The relevant variable in these circumstances is called $(LDFLAGS).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-31 19:32:18 +01:00
Ian Campbell 3531dea6fd tools: consistently use $(CFLAGS_xeninclude) instead of open coding.
Renamed from the slightly ambiguous CFLAGS_include.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-21 18:04:59 +00:00
Ian Campbell 904216ffb2 tools: remove unnecessary uses of -I.
It's not needed unless you are including headers in the current
directory _and_ you can't use "" instead of <> because the headers are
to be installed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-21 17:58:52 +00:00
Ian Campbell 3135307760 tools: Drop use of $(INCLUDES)
Several places include it in CFLAGS even though it is never defined. A
few others use it as nothing more than a gathering point for
CFLAGS. Get rid of it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-03-21 17:45:50 +00:00
Keir Fraser 547cb1849c build: Make XEN_ROOT an absolute path.
Otherwise make can search the path relative to certain standard paths
such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in
Config.mk suffers from this).

Signed-off-by: Keir Fraser <keir@xen.org>
2011-03-17 10:36:25 +00:00
Mukesh Rathor 2a5c8ad466 tools/gdbsx: Update gdbsx README
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-04 15:40:00 +00:00
Ian Jackson 02bac862c0 tools: gdbsx: Check return of write()
Not checking leads to warn_unused_result checks triggering in some
libraries and compilers.  Combined with -Werror this breaks the build.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 11:58:25 +00:00
Gianni Tedesco 576b10f44c gdbsx: Makefiles: correctly generate dependencies
gdbsx hacks CFLAGS to remove optimisations for easier debugging, however
this breaks dep generation due to an early evaluation of CFLAGS and
leaves stale files called "..d" after a make clean. We could possibly
fix this by separating dep generation from the rest of CFLAGS but it
seems a little invasive. The gdbsx hackers can do their own thing during
development and testing anyway...

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-10-28 11:47:26 +01:00
Tim Deegan 5717f51369 "kdd" Windows debugger stub.
kdd runs in dom0, attaches to a domain and speaks the Windows kd serial
protocol over a TCP connection (which should go to kd or windbg, e.g.
by having another VM with its virtual COM1 set up as a TCP listener).

It doesn't do breakpoints &c yet, and windbg can get quite confused
since the kernel debugger's not actually running, but it's good enough
to extract backtraces from wedged VMs.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-10-26 11:56:31 +01:00