0c76f22ef1
- bnc#633573 - System fail to boot after running several warm reboot tests 22749-vtd-workarounds.patch - Upstream patches from Jan 22744-ept-pod-locking.patch 22777-vtd-ats-fixes.patch 22781-pod-hap-logdirty.patch 22782-x86-emul-smsw.patch 22789-i386-no-x2apic.patch 22790-svm-resume-migrate-pirqs.patch 22816-x86-pirq-drop-priv-check.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=94
115 lines
3.4 KiB
Diff
115 lines
3.4 KiB
Diff
# HG changeset patch
|
|
# User Keir Fraser <keir@xen.org>
|
|
# Date 1294746099 0
|
|
# Node ID 7926538a633297d65a5d6324bf9bd0eb158a6aff
|
|
# Parent 2ff199e2842b7e4f08ea99558afc32536a77280c
|
|
xenctx: misc adjustments
|
|
|
|
- fix off-by-one errors during symbol insertion and lookup
|
|
- don't store the symbol type, as it wasn't needed at all so far and
|
|
is only needed now at parsing time
|
|
- don't insert certain kinds of symbols
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
Index: xen-4.0.2-testing/tools/xentrace/xenctx.c
|
|
===================================================================
|
|
--- xen-4.0.2-testing.orig/tools/xentrace/xenctx.c
|
|
+++ xen-4.0.2-testing/tools/xentrace/xenctx.c
|
|
@@ -19,6 +19,7 @@
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <signal.h>
|
|
+#include <ctype.h>
|
|
#include <string.h>
|
|
#include <inttypes.h>
|
|
#include <getopt.h>
|
|
@@ -58,7 +59,6 @@ int disp_tlb;
|
|
|
|
struct symbol {
|
|
guest_word_t address;
|
|
- char type;
|
|
char *name;
|
|
struct symbol *next;
|
|
} *symbol_table = NULL;
|
|
@@ -112,12 +112,12 @@ static void insert_symbol(struct symbol
|
|
|
|
/* The System.map is usually already sorted... */
|
|
if (prev
|
|
- && prev->address < symbol->address
|
|
+ && prev->address <= symbol->address
|
|
&& (!prev->next || prev->next->address > symbol->address)) {
|
|
s = prev;
|
|
} else {
|
|
/* ... otherwise do crappy/slow search for the correct place */
|
|
- while(s && s->next && s->next->address < symbol->address)
|
|
+ while (s->next && s->next->address <= symbol->address)
|
|
s = s->next;
|
|
}
|
|
|
|
@@ -130,13 +130,13 @@ static struct symbol *lookup_symbol(gues
|
|
{
|
|
struct symbol *s = symbol_table;
|
|
|
|
- while(s && s->next && s->next->address < address)
|
|
- s = s->next;
|
|
+ if (!s)
|
|
+ return NULL;
|
|
|
|
- if (s && s->address < address)
|
|
- return s;
|
|
+ while (s->next && s->next->address < address)
|
|
+ s = s->next;
|
|
|
|
- return NULL;
|
|
+ return s->next && s->next->address <= address ? s->next : s;
|
|
}
|
|
|
|
static void print_symbol(guest_word_t addr)
|
|
@@ -159,7 +159,7 @@ static void print_symbol(guest_word_t ad
|
|
|
|
static void read_symbol_table(const char *symtab)
|
|
{
|
|
- char line[256];
|
|
+ char type, line[256];
|
|
char *p;
|
|
struct symbol *symbol;
|
|
FILE *f;
|
|
@@ -178,9 +178,13 @@ static void read_symbol_table(const char
|
|
|
|
/* need more checks for syntax here... */
|
|
symbol->address = strtoull(line, &p, 16);
|
|
- p++;
|
|
- symbol->type = *p++;
|
|
- p++;
|
|
+ if (!isspace(*p++))
|
|
+ continue;
|
|
+ type = *p++;
|
|
+ if (!isalpha(type) && type != '?')
|
|
+ continue;
|
|
+ if (!isspace(*p++))
|
|
+ continue;
|
|
|
|
/* in the future we should handle the module name
|
|
* being appended here, this would allow us to use
|
|
@@ -190,7 +194,18 @@ static void read_symbol_table(const char
|
|
p[strlen(p)-1] = '\0';
|
|
symbol->name = strdup(p);
|
|
|
|
- insert_symbol(symbol);
|
|
+ switch (type) {
|
|
+ case 'A': /* global absolute */
|
|
+ case 'a': /* local absolute */
|
|
+ break;
|
|
+ case 'U': /* undefined */
|
|
+ case 'v': /* undefined weak object */
|
|
+ case 'w': /* undefined weak function */
|
|
+ continue;
|
|
+ default:
|
|
+ insert_symbol(symbol);
|
|
+ break;
|
|
+ }
|
|
|
|
if (strcmp(symbol->name, "_stext") == 0)
|
|
kernel_stext = symbol->address;
|