From 5cff3c6395283fc4d04aa52668304f09eb379493 Mon Sep 17 00:00:00 2001 From: "mafetter@fleming.research" Date: Fri, 13 May 2005 11:14:06 +0000 Subject: [PATCH 1/5] bitkeeper revision 1.1159.258.120 (42848bfe8kMyWWcBA64rq7h7l7AyoA) Shadow code bug fix (found by Ian) that was breaking refcounts, and subsequently causing migration problems. --- xen/arch/x86/memory.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index 6fb5b059b1..eaf324eb21 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -1607,13 +1607,14 @@ int do_update_va_mapping(unsigned long page_nr, unsigned l2_idx = page_nr >> (L2_PAGETABLE_SHIFT - L1_PAGETABLE_SHIFT); l2_pgentry_t gpde = linear_l2_table[l2_idx]; unsigned long gpfn = l2_pgentry_val(gpde) >> PAGE_SHIFT; + unsigned long spfn; - if (get_shadow_status(&d->mm, gpfn)) + if ((spfn = (get_shadow_status(&d->mm, gpfn) & PSH_pfn_mask))) { - unsigned long *gl1e = map_domain_mem(gpfn << PAGE_SHIFT); + unsigned long *sl1e = map_domain_mem(spfn << PAGE_SHIFT); unsigned l1_idx = page_nr & (ENTRIES_PER_L1_PAGETABLE - 1); - gl1e[l1_idx] = sval; - unmap_domain_mem(gl1e); + sl1e[l1_idx] = sval; + unmap_domain_mem(sl1e); put_shadow_status(&d->mm); perfc_incrc(shadow_update_va_fail1); From 23a1ce0c8306cb397bec767905e1cf8f923dbaba Mon Sep 17 00:00:00 2001 From: "mafetter@fleming.research" Date: Fri, 13 May 2005 12:52:14 +0000 Subject: [PATCH 2/5] bitkeeper revision 1.1159.258.121 (4284a2fe8e-teEoJtU8EYiHY0jsBdg) Fix construction of ref directories when no patches are present --- buildconfigs/Rules.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildconfigs/Rules.mk b/buildconfigs/Rules.mk index a2c4cc5ecc..11678ed9db 100644 --- a/buildconfigs/Rules.mk +++ b/buildconfigs/Rules.mk @@ -71,8 +71,8 @@ clean:: ref-%/.valid-ref: pristine-%/.valid-pristine rm -rf $(@D) cp -al $( Date: Fri, 13 May 2005 14:36:51 +0000 Subject: [PATCH 3/5] bitkeeper revision 1.1159.281.1 (4284bb83DRFxFAWqa-zevESa69akFA) sxpr_parser.c, sxpr_parser.h: Revert size of sxpr parser input buffer to original size and make buffer allocated dynamically and increasing in size on demand. Signed-off-by: Christian Limpach --- tools/libxutil/sxpr_parser.c | 25 ++++++++++++++++++++++--- tools/libxutil/sxpr_parser.h | 4 ++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/tools/libxutil/sxpr_parser.c b/tools/libxutil/sxpr_parser.c index d32ef959b3..ba29c49f9c 100644 --- a/tools/libxutil/sxpr_parser.c +++ b/tools/libxutil/sxpr_parser.c @@ -160,6 +160,8 @@ void Parser_free(Parser *z){ if(!z) return; objfree(z->val); z->val = ONONE; + if (z->buf) + deallocate(z->buf); deallocate(z); } @@ -171,6 +173,7 @@ Parser * Parser_new(void){ if(!z) goto exit; err = 0; + z->buf = NULL; reset(z); exit: if(err){ @@ -201,8 +204,16 @@ static int inputchar(Parser *p, char c){ static int savechar(Parser *p, char c){ int err = 0; if(p->buf_i >= p->buf_n){ - err = -ENOMEM; - goto exit; + char *nbuf; + nbuf = allocate(2 * (p->buf_n + 1)); + if (nbuf == NULL) { + err = -ENOMEM; + goto exit; + } + memcpy(nbuf, p->buf, p->buf_i); + deallocate(p->buf); + p->buf = nbuf; + p->buf_n = 2 * (p->buf_n + 1) - 1; } p->buf[p->buf_i] = c; p->buf_i++; @@ -687,8 +698,16 @@ int end_list(Parser *p){ static void reset(Parser *z){ IOStream *error_out = z->error_out; int flags = z->flags; + int buf_n = z->buf_n; + char *buf = z->buf; memzero(z, sizeof(Parser)); - z->buf_n = sizeof(z->buf) - 1; + if (buf) { + z->buf = buf; + z->buf_n = buf_n; + } else { + z->buf = (char *)allocate(PARSER_BUF_SIZE); + z->buf_n = PARSER_BUF_SIZE - 1; + } z->buf_i = 0; z->line_no = 1; z->char_no = 0; diff --git a/tools/libxutil/sxpr_parser.h b/tools/libxutil/sxpr_parser.h index 0a3fde55fd..a47554633d 100644 --- a/tools/libxutil/sxpr_parser.h +++ b/tools/libxutil/sxpr_parser.h @@ -28,7 +28,7 @@ /** Size of a parser input buffer. * Tokens read must fit into this size (including trailing null). */ -#define PARSER_BUF_SIZE 4096 +#define PARSER_BUF_SIZE 1024 struct Parser; typedef int ParserStateFn(struct Parser *, char c); @@ -60,7 +60,7 @@ typedef struct Parser { /** Lookahead character. */ char c; /** Buffer for reading tokens. */ - char buf[PARSER_BUF_SIZE]; + char *buf; /** Size of token buffer. */ int buf_n; int buf_i; From 43c44b436d438416a718bd62962c4bfd911cc6bb Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Fri, 13 May 2005 18:20:40 +0000 Subject: [PATCH 4/5] bitkeeper revision 1.1389.1.60 (4284eff8xPCiJXQdVwPYSYL7MEB5zA) fix calls to xc_domain_getinfo() Signed-off-by: Steven Hand --- tools/libxc/xc_core.c | 2 +- tools/libxc/xc_linux_save.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c index 2d6b7d0fa2..8439d13119 100644 --- a/tools/libxc/xc_core.c +++ b/tools/libxc/xc_core.c @@ -48,7 +48,7 @@ xc_domain_dumpcore(int xc_handle, goto error_out; } - if (xc_domain_getinfo(xc_handle, domid, 1, &info)) { + if (xc_domain_getinfo(xc_handle, domid, 1, &info) != 1) { PERROR("Could not get info for domain"); goto error_out; } diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index 17000d668e..7c7415e831 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -333,9 +333,9 @@ int suspend_and_state(int xc_handle, XcIOContext *ioctxt, retry: - if ( xc_domain_getinfo(xc_handle, ioctxt->domain, 1, info) ) + if ( xc_domain_getinfo(xc_handle, ioctxt->domain, 1, info) != 1) { - xcio_error(ioctxt, "Could not get full domain info"); + xcio_error(ioctxt, "Could not get domain info"); return -1; } @@ -447,9 +447,9 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt) return 1; } - if ( xc_domain_getinfo(xc_handle, domid, 1, &info) ) + if ( xc_domain_getinfo(xc_handle, domid, 1, &info) != 1) { - xcio_error(ioctxt, "Could not get full domain info"); + xcio_error(ioctxt, "Could not get domain info"); goto out; } if ( xc_domain_get_vcpu_context( xc_handle, domid, /* FIXME */ 0, From e011ff2e399eb4623e3b6e09ecaeb740f0599222 Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Fri, 13 May 2005 18:28:45 +0000 Subject: [PATCH 5/5] bitkeeper revision 1.1389.1.61 (4284f1ddAO6PwLXgaP83tPIB0NH4cw) Cset exclude: cl349@firebug.cl.cam.ac.uk|ChangeSet|20050513143651|29037 --- tools/libxutil/sxpr_parser.c | 25 +++---------------------- tools/libxutil/sxpr_parser.h | 4 ++-- 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/tools/libxutil/sxpr_parser.c b/tools/libxutil/sxpr_parser.c index ba29c49f9c..d32ef959b3 100644 --- a/tools/libxutil/sxpr_parser.c +++ b/tools/libxutil/sxpr_parser.c @@ -160,8 +160,6 @@ void Parser_free(Parser *z){ if(!z) return; objfree(z->val); z->val = ONONE; - if (z->buf) - deallocate(z->buf); deallocate(z); } @@ -173,7 +171,6 @@ Parser * Parser_new(void){ if(!z) goto exit; err = 0; - z->buf = NULL; reset(z); exit: if(err){ @@ -204,16 +201,8 @@ static int inputchar(Parser *p, char c){ static int savechar(Parser *p, char c){ int err = 0; if(p->buf_i >= p->buf_n){ - char *nbuf; - nbuf = allocate(2 * (p->buf_n + 1)); - if (nbuf == NULL) { - err = -ENOMEM; - goto exit; - } - memcpy(nbuf, p->buf, p->buf_i); - deallocate(p->buf); - p->buf = nbuf; - p->buf_n = 2 * (p->buf_n + 1) - 1; + err = -ENOMEM; + goto exit; } p->buf[p->buf_i] = c; p->buf_i++; @@ -698,16 +687,8 @@ int end_list(Parser *p){ static void reset(Parser *z){ IOStream *error_out = z->error_out; int flags = z->flags; - int buf_n = z->buf_n; - char *buf = z->buf; memzero(z, sizeof(Parser)); - if (buf) { - z->buf = buf; - z->buf_n = buf_n; - } else { - z->buf = (char *)allocate(PARSER_BUF_SIZE); - z->buf_n = PARSER_BUF_SIZE - 1; - } + z->buf_n = sizeof(z->buf) - 1; z->buf_i = 0; z->line_no = 1; z->char_no = 0; diff --git a/tools/libxutil/sxpr_parser.h b/tools/libxutil/sxpr_parser.h index a47554633d..0a3fde55fd 100644 --- a/tools/libxutil/sxpr_parser.h +++ b/tools/libxutil/sxpr_parser.h @@ -28,7 +28,7 @@ /** Size of a parser input buffer. * Tokens read must fit into this size (including trailing null). */ -#define PARSER_BUF_SIZE 1024 +#define PARSER_BUF_SIZE 4096 struct Parser; typedef int ParserStateFn(struct Parser *, char c); @@ -60,7 +60,7 @@ typedef struct Parser { /** Lookahead character. */ char c; /** Buffer for reading tokens. */ - char *buf; + char buf[PARSER_BUF_SIZE]; /** Size of token buffer. */ int buf_n; int buf_i;