All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pae: tlbflush linear page table updates
@ 2005-08-08 14:51 Gerd Knorr
  2005-08-08 16:52 ` Keir Fraser
  0 siblings, 1 reply; 24+ messages in thread
From: Gerd Knorr @ 2005-08-08 14:51 UTC (permalink / raw)
  To: xen-devel

  Hi,

On l3 page dir updates (and related linear page table updates)
we'll have to flush the tlb to make sure the linear page access
goes to the correct pages ...

  Gerd

--- xen/arch/x86/mm.c~	2005-08-08 12:50:32.000000000 +0200
+++ xen/arch/x86/mm.c	2005-08-08 16:24:30.814980475 +0200
@@ -737,6 +737,7 @@ static int create_pae_xen_mappings(l3_pg
             l2e_from_pfn(l3e_get_pfn(pl3e[i]), __PAGE_HYPERVISOR) :
             l2e_empty();
     unmap_domain_page(pl2e);
+    flush_tlb_all();
 
     return 1;
 }

^ permalink raw reply	[flat|nested] 24+ messages in thread
* RE: [patch] pae: tlbflush linear page table updates
@ 2005-08-12  9:02 Tian, Kevin
  2005-08-12  9:17 ` Keir Fraser
  0 siblings, 1 reply; 24+ messages in thread
From: Tian, Kevin @ 2005-08-12  9:02 UTC (permalink / raw)
  To: Keir Fraser, Gerd Knorr; +Cc: xen-devel

>From: xen-devel-bounces@lists.xensource.com
>[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Keir Fraser
>Sent: Wednesday, August 10, 2005 9:12 PM
>On 10 Aug 2005, at 14:01, Gerd Knorr wrote:
>
>>> Sure?  The patch below fixes it for me.
>>
>> Uhm, well, it doesn't really fix it.
>>
>>> The tlbflush stuff is red herring btw, the real difference is
>>> optimization.  Build with "optimize=n" boot fine, others don't.
>>
>> While looking into this I've noticed the bug comes and goes away
>> with the optimization level.  Building with -O1 works fine,
>> building with -O2 breaks (both with the patch mailed applied).
>>
>> There might be something wrong with the inline assembler ...
>
>See the fix I just this minute checked in :-)
>
>Hopefully it should fix all these weirdnesses....
>
>  -- Keir

Is similar fix also required by __put_user_64?

#define __put_user_u64(x, addr, retval, errret)                 \
	...
	: "=r"(retval)                                  \
    : "A" (x), "r" (addr), "i"(errret), "0"(retval))

I'm not sure exact rules for compiler to choose registers. But once
compiler optimizes retval or addr to reuse eax/edx under some condition,
user will also see either incorrect return value, or incorrect content
written to incorrect address. Can we assume such optimization never
happen?

Thanks,
Kevin

^ permalink raw reply	[flat|nested] 24+ messages in thread
* RE: [patch] pae: tlbflush linear page table updates
@ 2005-08-12  9:17 Tian, Kevin
  0 siblings, 0 replies; 24+ messages in thread
From: Tian, Kevin @ 2005-08-12  9:17 UTC (permalink / raw)
  To: Keir Fraser; +Cc: Gerd Knorr, xen-devel

>From: Keir Fraser [mailto:Keir.Fraser@cl.cam.ac.uk]
>
>The compiler will never alias inputs. In this case it is forced to
>alias the output constraint with input retval, and so the output cannot
>alias with any other input (which would be an error).
>
>  -- Keir

Yes, this is reasonable policy. ;-)
Thanks,
Kevin

^ permalink raw reply	[flat|nested] 24+ messages in thread
* RE: [patch] pae: tlbflush linear page table updates
@ 2005-08-12  9:37 Tian, Kevin
  2005-08-12  9:56 ` Andi Kleen
  0 siblings, 1 reply; 24+ messages in thread
From: Tian, Kevin @ 2005-08-12  9:37 UTC (permalink / raw)
  To: ak, Keir Fraser; +Cc: Gerd Knorr, xen-devel

>-----Original Message-----
>From: ak@suse.de [mailto:ak@suse.de]
>Sent: Friday, August 12, 2005 5:21 PM
>Keir Fraser <Keir.Fraser@cl.cam.ac.uk> writes:
>>
>> The compiler will never alias inputs. In this case it is forced to
>> alias the output constraint with input retval, and so the output
>> cannot alias with any other input (which would be an error).
>
>Actually it will sometimes. That is what the "early clobber" (&)
>prevents. Perhaps it should be used here.
>
>-Andi

"early clobber" is good to prevent output alias as input, if that output
may be clobbered before input is used. However there seems no point to
simply alias among inputs. Or else, the only way I can see is that
compiler insert some extra lines in the middle of inline asm... Any
benefit for this likelihood?

Thanks,
Kevin

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2005-08-12 10:18 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-08 14:51 [patch] pae: tlbflush linear page table updates Gerd Knorr
2005-08-08 16:52 ` Keir Fraser
2005-08-09  7:54   ` Gerd Knorr
2005-08-09  8:06     ` Keir Fraser
2005-08-09 10:53       ` Keir Fraser
2005-08-09 13:52         ` Gerd Knorr
2005-08-09 15:44           ` Gerd Knorr
2005-08-09 16:14             ` Keir Fraser
2005-08-10 10:22               ` Gerd Knorr
2005-08-10 10:28                 ` Gerd Knorr
2005-08-10 10:54                   ` Keir Fraser
2005-08-10 12:33                     ` Gerd Knorr
2005-08-10 13:01                       ` Gerd Knorr
2005-08-10 13:11                         ` Keir Fraser
2005-08-10 13:57                           ` Gerd Knorr
2005-08-10 10:53                 ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12  9:02 Tian, Kevin
2005-08-12  9:17 ` Keir Fraser
2005-08-12  9:20   ` Andi Kleen
2005-08-12  9:49     ` Keir Fraser
2005-08-12  9:17 Tian, Kevin
2005-08-12  9:37 Tian, Kevin
2005-08-12  9:56 ` Andi Kleen
2005-08-12 10:18   ` Keir Fraser

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.