mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Campbell <ijc@hellion.org.uk>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	the arch/x86 maintainers <x86@kernel.org>
Subject: Re: [PATCH 35 of 36] x86: make pgd/pud/pmd/pte_none consistent
Date: Fri, 06 Feb 2009 15:29:10 +0000	[thread overview]
Message-ID: <1233934150.20597.26.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <ab45a6865df539a36a75.1233862277@abulafia.goop.org>

On Thu, 2009-02-05 at 11:31 -0800, Jeremy Fitzhardinge wrote:
> The _none test is done differently for every level of the pagetable.
> Standardize them by:
> 
>  1: Use the native_X_val to extract the raw entry, with no need to go
>     via paravirt_ops, diff -r 1d0646d0d319 arch/x86/include/asm/pgtable.h, and
>  2: Compare with 0 rather than using a boolean !, since they are actually values
>     and not booleans.

In a 32 bit Xen guest this one causes

        [    8.354898] 1 multicall(s) failed: cpu 1
        [    8.354921] Pid: 2213, comm: bootclean Not tainted 2.6.29-rc3-x86_32p-xenU-tip #135
        [    8.354937] Call Trace:
        [    8.354955]  [<c01036e3>] xen_mc_flush+0x133/0x1b0
        [    8.354971]  [<c0105d2a>] ? xen_force_evtchn_callback+0x1a/0x30
        [    8.354988]  [<c0105a60>] xen_flush_tlb_others+0xb0/0xd0
        [    8.355003]  [<c0126643>] flush_tlb_page+0x53/0xa0
        [    8.355018]  [<c0176a80>] do_wp_page+0x2a0/0x7c0
        [    8.355034]  [<c0238f0a>] ? notify_remote_via_irq+0x3a/0x70
        [    8.355049]  [<c0178950>] handle_mm_fault+0x7b0/0xa50
        [    8.355065]  [<c0131a3e>] ? wake_up_new_task+0x8e/0xb0
        [    8.355079]  [<c01337b5>] ? do_fork+0xe5/0x320
        [    8.355095]  [<c0121919>] do_page_fault+0xe9/0x240
        [    8.355109]  [<c0121830>] ? do_page_fault+0x0/0x240
        [    8.355125]  [<c032457a>] error_code+0x72/0x78
        [    8.355139]   call  1/1: op=2863311530 arg=[aaaaaaaa] result=-38	xen_flush_tlb_others+0x41/0xd0
        [    8.355161] ------------[ cut here ]------------
        [    8.355172] kernel BUG at /local/scratch/ianc/devel/kernels/paravirt/arch/x86/xen/multicalls.c:182!
        [    8.355189] invalid opcode: 0000 [#1] SMP 
        [    8.355207] last sysfs file: /sys/class/net/lo/operstate
        [    8.355218] Modules linked in:
        [    8.355230] 
        [    8.355239] Pid: 2213, comm: bootclean Not tainted (2.6.29-rc3-x86_32p-xenU-tip #135) 
        [    8.355254] EIP: 0061:[<c010374b>] EFLAGS: 00010002 CPU: 1
        [    8.355267] EIP is at xen_mc_flush+0x19b/0x1b0
        [    8.355278] EAX: 00000000 EBX: 00000000 ECX: c10cc060 EDX: 00000000
        [    8.355290] ESI: 00000000 EDI: 00000001 EBP: c4c61e70 ESP: c4c61e40
        [    8.355302]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0069
        [    8.355314] Process bootclean (pid: 2213, ti=c4c60000 task=c5ad3460 task.ti=c4c60000)
        [    8.355328] Stack:
        [    8.355336]  c0367d84 00000001 00000001 aaaaaaaa aaaaaaaa ffffffda c01059f1 c10cc060
        [    8.355372]  c10c0060 c4c7a6d4 bfabf790 bfabf790 c4c61e80 c0105a60 c4c7a6d4 c4c7a580
        [    8.355413]  c4c61ea0 c0126643 00000000 80000000 00000025 08428067 80000000 c4c
        
Didn't figure out why yet.

> 
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
> 
> ---
>  arch/x86/include/asm/pgtable.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -503,7 +503,7 @@
>  {
>  	/* Only check low word on 32-bit platforms, since it might be
>  	   out of sync with upper half. */
> -	return !(unsigned long)native_pmd_val(pmd);
> +	return (unsigned long)native_pmd_val(pmd) == 0;
>  }
>  
>  static inline unsigned long pmd_page_vaddr(pmd_t pmd)
> @@ -568,7 +568,7 @@
>  #if PAGETABLE_LEVELS > 2
>  static inline int pud_none(pud_t pud)
>  {
> -	return pud_val(pud) == 0;
> +	return native_pud_val(pud) == 0;
>  }
>  
>  static inline int pud_present(pud_t pud)
> @@ -643,7 +643,7 @@
>  
>  static inline int pgd_none(pgd_t pgd)
>  {
> -	return !pgd_val(pgd);
> +	return !native_pgd_val(pgd);
>  }
>  #endif	/* PAGETABLE_LEVELS > 3 */
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
-- 
Ian Campbell

I can resist anything but temptation.


  reply	other threads:[~2009-02-06 15:30 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 19:30 [PATCH 00 of 36] x86: clean up pte functions in pgtable*.h Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 01 of 36] x86: unify pte_none Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 02 of 36] x86: unify pte_same Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 03 of 36] x86: unify pte_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 04 of 36] x86: make _PAGE_HIDDEN conditional Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 05 of 36] x86: unify pte_hidden Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 06 of 36] x86: unify pud_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 07 of 36] x86: unify pgd_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 08 of 36] x86: unify pmd_present Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 09 of 36] x86: unify pmd_none Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 10 of 36] x86: unify pgd_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 11 of 36] x86: unify pud_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 12 of 36] x86: include pgtable_SIZE.h earlier Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 13 of 36] x86: unify pud_page Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 14 of 36] x86: unify pgd_page Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 15 of 36] x86: unify pud_index Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 16 of 36] x86: unify pud_offset Jeremy Fitzhardinge
2009-02-05 19:30 ` [PATCH 17 of 36] x86: unify pmd_page_vaddr Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 18 of 36] x86: unify pmd_page Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 19 of 36] x86: unify pmd_index Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 20 of 36] x86: unify pmd_offset Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 21 of 36] x86: remove redundant pfn_pmd definition Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 22 of 36] x86: unify pmd_pfn Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 23 " Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 24 of 36] x86: unify pte_index Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 25 of 36] x86: unify pte_offset_kernel Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 26 of 36] x86: unify pud_large Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 27 of 36] x86: unify pgd_bad Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 28 " Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 29 of 36] x86: unify pmd_bad Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 30 of 36] x86: unify pages_to_mb Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 31 of 36] x86: unify pud_none Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 32 of 36] x86: unify pgd_none Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 33 of 36] x86: unify io_remap_pfn_range Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 34 of 36] x86: add and use pgd/pud/pmd_flags Jeremy Fitzhardinge
2009-02-05 19:31 ` [PATCH 35 of 36] x86: make pgd/pud/pmd/pte_none consistent Jeremy Fitzhardinge
2009-02-06 15:29   ` Ian Campbell [this message]
2009-02-06 15:45     ` Ian Campbell
2009-02-06 17:43       ` Ian Campbell
2009-02-05 19:31 ` [PATCH 36 of 36] x86: make the X_bad functions consistent Jeremy Fitzhardinge
2009-02-05 20:25   ` Hugh Dickins
2009-02-05 20:39     ` Jeremy Fitzhardinge

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=1233934150.20597.26.camel@zakaz.uk.xensource.com \
    --to=ijc@hellion.org.uk \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®