All of lore.kernel.org
 help / color / mirror / Atom feed
From: Don Slutz <dslutz@verizon.com>
To: Jan Beulich <JBeulich@suse.com>, Don Slutz <dslutz@verizon.com>
Cc: Ian Campbell <ian.campbell@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Don Slutz <Don@CloudSwitch.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 10/12] xenctx: change is_kernel_text() into is_kernel_addr().
Date: Thu, 7 Nov 2013 19:51:38 -0500	[thread overview]
Message-ID: <527C359A.5090301@terremark.com> (raw)
In-Reply-To: <527B5EEC02000078001007BD@nat28.tlf.novell.com>


[-- Attachment #1.1: Type: text/plain, Size: 4255 bytes --]

On 11/07/13 03:35, Jan Beulich wrote:
>>>> On 06.11.13 at 21:08, Don Slutz <dslutz@verizon.com> 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.
Ok, will remove.
>
>>   {
>> -    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.
Opps, I did not what this reformatting, will just drop it.
>> +        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)?
Yes, I did.  I think it is better to use the value that is in the system map over the default.  It has changed:

dcs-xen-54:~/xen>grep " _text" /boot/System.map-*
/boot/System.map-2.6.18-128.el5:ffffffff80000000 A _text
/boot/System.map-3.6.11-5.fc17.x86_64:ffffffff81000000 T _text
/boot/System.map-3.8.11-100.fc17.x86_64:ffffffff81000000 T _text

But since it is a command line argument, if specified, should it be used instead?
>> @@ -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?
Opps, wrong split.  This (and the one 2 below changing to read_mem_word) should be in their own patch (or back in patch 8, with patch 9 before 8.  Without this change specifying an unaligned address can read across a page boundary which would not get he correct data (and can fault).
>> @@ -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?
>
This cleanup mostly likely should be just dropped (or made it's own patch).  The context is just one line short:

                 frame = read_stack_word(p, width);
                 if (xenctx.stack_trace) {
    ...

                 print_stack_word(read_stack_word(p, width), width);

And since read_stack_word(p, width) should always return the same data for the same address; the 2nd call is not needed.


>> @@ -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.
The 2nd line is needed is_kernel_text() changed to is_kernel_addr().
    -Don Slutz
> Jan
>


[-- Attachment #1.2: Type: text/html, Size: 6668 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2013-11-08  1:00 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06 20:08 [PATCH v2 00/12] xenctx: Many changes Don Slutz
2013-11-06 20:08 ` [PATCH v2 01/12] xenctx: Clean up stack trace when hypercall_page not in symbol table Don Slutz
2013-11-07  8:07   ` Jan Beulich
2013-11-07  8:22     ` Ian Campbell
2013-11-07  8:47       ` Jan Beulich
2013-11-07 12:36         ` Ian Campbell
2013-11-07 13:28           ` Don Slutz
2013-11-07 12:38   ` Ian Campbell
2013-11-06 20:08 ` [PATCH v2 02/12] xenctx: Add -2 (--two-pages) option to switch stack size to 8KiB Don Slutz
2013-11-07  8:04   ` Jan Beulich
2013-11-07 12:40     ` Ian Campbell
2013-11-07 15:24       ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 03/12] xenctx: Output ascii version of stack also Don Slutz
2013-11-07  8:09   ` Jan Beulich
2013-11-07 12:43     ` Ian Campbell
2013-11-07 13:17       ` Jan Beulich
2013-11-07 13:21         ` Jan Beulich
2013-11-08  0:12           ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 04/12] xenctx: Add stack address to dump, switch to 16 bytes per line Don Slutz
2013-11-07  8:12   ` Jan Beulich
2013-11-07 12:46     ` Ian Campbell
2013-11-08  0:13       ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 05/12] xenctx: Change print_symbol to do the space before Don Slutz
2013-11-07  8:13   ` Jan Beulich
2013-11-07 12:47   ` Ian Campbell
2013-11-06 20:08 ` [PATCH v2 06/12] xenctx: More info on failed to map page Don Slutz
2013-11-07 12:48   ` Ian Campbell
2013-11-06 20:08 ` [PATCH v2 07/12] xenctx: Add stack addr to call trace Don Slutz
2013-11-07 12:50   ` Ian Campbell
2013-11-07 14:34     ` Don Slutz
2013-11-07 14:44       ` Ian Campbell
2013-11-07 15:06         ` Don Slutz
2013-11-07 16:03           ` Ian Campbell
2013-11-07 18:13             ` Don Slutz
2013-11-08 10:15               ` Ian Campbell
2013-11-06 20:08 ` [PATCH v2 08/12] xenctx: Add -d <daddr> option to dump memory at daddr as a stack Don Slutz
2013-11-07  8:22   ` Jan Beulich
2013-11-08  0:21     ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 09/12] xenctx: Add -m <maddr> option to dump memory at maddr Don Slutz
2013-11-07  8:25   ` Jan Beulich
2013-11-08  0:24     ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 10/12] xenctx: change is_kernel_text() into is_kernel_addr() Don Slutz
2013-11-07  8:35   ` Jan Beulich
2013-11-08  0:51     ` Don Slutz [this message]
2013-11-08  8:40       ` Jan Beulich
2013-11-08  9:50         ` Ian Campbell
2013-11-08 13:50           ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 11/12] xenctx: Dump registers via hvm info if available Don Slutz
2013-11-06 20:35   ` Andrew Cooper
2013-11-07 18:56     ` Don Slutz
2013-11-08 10:13       ` Ian Campbell
2013-11-08 10:29         ` Andrew Cooper
2013-11-08 10:32           ` Ian Campbell
2013-11-07  8:38   ` Jan Beulich
2013-11-07 21:19     ` Don Slutz
2013-11-06 20:08 ` [PATCH v2 12/12] xenctx: Add optional fCPU Don Slutz
2013-11-07  8:40   ` Jan Beulich
2013-11-07 12:53     ` Ian Campbell
2013-11-07 21:24       ` Don Slutz
2013-11-08 11:29 ` [PATCH v2 00/12] xenctx: Many changes George Dunlap
2013-11-08 12:54   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527C359A.5090301@terremark.com \
    --to=dslutz@verizon.com \
    --cc=Don@CloudSwitch.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.