From: "Jan Beulich" Subject: Re: [PATCH v2 10/12] xenctx: change is_kernel_text() into is_kernel_addr(). Date: Thu, 07 Nov 2013 08:35:40 +0000 Message-ID: <527B5EEC02000078001007BD@nat28.tlf.novell.com> References: <1383768500-4245-1-git-send-email-dslutz@terremark.com> <1383768500-4245-11-git-send-email-dslutz@terremark.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [195.245.231.135] (helo=mail6.bemta5.messagelabs.com) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VeL4N-0001E3-Sa for xen-devel@lists.xenproject.org; Thu, 07 Nov 2013 08:36:04 +0000 In-Reply-To: <1383768500-4245-11-git-send-email-dslutz@terremark.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: Ian Campbell , Stefano Stabellini , George Dunlap , Don Slutz , Ian Jackson , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 06.11.13 at 21:08, Don Slutz wrote: > @@ -76,22 +86,28 @@ unsigned long long kernel_start = 0xc0000000; > unsigned long long kernel_start = 0xffffffff80000000UL; > #endif > > -static int is_kernel_text(guest_word_t addr) > +static type_of_addr is_kernel_addr(guest_word_t addr) The "is_" prefix is now bogus. > { > - if (symbol_table == NULL) > - return (addr > kernel_start); > + if (symbol_table == NULL) { > + if (addr > kernel_start) > + return KERNEL_TEXT_ADDR; > + else > + return NOT_KERNEL_ADDR; > + } > > if (addr >= kernel_stext && > addr <= kernel_etext) > - return 1; > - if (kernel_hypercallpage && > - (addr >= kernel_hypercallpage && > - addr <= kernel_hypercallpage + 4096)) > - return 1; > + return KERNEL_TEXT_ADDR; > + if (kernel_hypercallpage && (addr >= kernel_hypercallpage && > + addr <= kernel_hypercallpage + 4096)) This reformatting is pointlessly bloating the patch - if you want the line reformatted, you should (a) do this in the patch that adds the first part of the condition and (b) obey to indentation rules. > + return KERNEL_TEXT_ADDR; > if (addr >= kernel_sinittext && > addr <= kernel_einittext) > - return 1; > - return 0; > + return KERNEL_TEXT_ADDR; > + if (addr >= kernel_text && > + addr <= kernel_end) > + return KERNEL_DATA_ADDR; As you supposedly filtered out all text ranges before, did you really mean to compare to kernel_text here (rather than kernel_start)? > @@ -749,7 +769,7 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width, guest > void *p = map_page(ctx, vcpu, stack); > if (!p) > return -1; > - word = read_stack_word(p, width); > + word = read_mem_word(ctx, vcpu, stack, width); How is this change related to the purpose of the patch? > @@ -818,7 +838,7 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width, guest > if (xenctx.stack_trace) { > print_stack_word(stack, width); > printf(": |-- "); > - print_stack_word(read_stack_word(p, width), width); > + print_stack_word(frame, width); And this one? > @@ -843,13 +863,13 @@ static int print_stack(vcpu_guest_context_any_t *ctx, int vcpu, int width, guest > void *p = map_page(ctx, vcpu, stack); > if (!p) > return -1; > - word = read_stack_word(p, width); > - if (is_kernel_text(word)) { > + word = read_mem_word(ctx, vcpu, stack, width); > + if (is_kernel_addr(word) >= KERNEL_TEXT_ADDR) { And one more. Jan