All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Huaitong Han <huaitong.han@intel.com>, TimDeegan <tim@xen.org>,
	Xen-devel List <xen-devel@lists.xen.org>
Subject: Re: Xen PV PTE ABI (or lack thereof)
Date: Thu, 21 Jan 2016 15:10:32 +0000	[thread overview]
Message-ID: <56A0F4E8.2060402@citrix.com> (raw)
In-Reply-To: <56A0F17A02000078000C99EC@prv-mh.provo.novell.com>

On 21/01/16 13:55, Jan Beulich wrote:

>>>> I was intending to have CONFIG_PV_PTE_DEBUG as an EXPERT option,
>>>> disabled by default even in debug builds.
>>>>
>>>> There should not be an ABI difference between release and "normal" debug
>>>> builds.
>>> Well, I see your point, but as said above I'm not convinced
>>> disabling all that code is the right solution. In fact, what you
>>> propose is not far away from removing that code altogether.
>> The two bits are only used for specialised debugging.  They should be
>> relegated to people doing specific debugging, and not interfere with the
>> overwhelming majority of cases where Xen doesn't need to use any
>> software available PTE bits.
> Your repeated claim that _PAGE_GUEST_KERNEL is purely debugging only
> makes we wonder how you would mean to adjust adjust_guest_l1e() with
> that flag gone (most notably the last of its if()-s).

diff --git a/xen/arch/x86/mm.c
b/xen/arch/x86/mm.c                                                                                                                                      

index b81d1fd..46ef5ce
100644                                                                                                                                                           

---
a/xen/arch/x86/mm.c                                                                                                                                                                 

+++
b/xen/arch/x86/mm.c                                                                                                                                                                 

@@ -1060,10 +1060,11 @@
get_page_from_l4e(                                                                                                                                              

                  == (_PAGE_GUEST_KERNEL|_PAGE_GLOBAL)
)                     
\                                                                                                         

                 MEM_LOG("Global bit is set to kernel page
%lx",             
\                                                                                                         

                        
l1e_get_pfn((pl1e)));                               
\                                                                                                         

-            if ( !(l1e_get_flags((pl1e)) & _PAGE_USER)
)                    
\                                                                                                         

-                l1e_add_flags((pl1e),
(_PAGE_GUEST_KERNEL|_PAGE_USER));     
\                                                                                                         

-            if ( !(l1e_get_flags((pl1e)) & _PAGE_GUEST_KERNEL)
)            
\                                                                                                         

-                l1e_add_flags((pl1e),
(_PAGE_GLOBAL|_PAGE_USER));           
\                                                                                                         

+            if ( l1e_get_flags((pl1e)) & _PAGE_USER
)                       
\                                                                                                         

+                l1e_add_flags((pl1e),
_PAGE_GLOBAL);                        
\                                                                                                         

+           
else                                                            
\                                                                                                         

+                l1e_remove_flags((pl1e),
_PAGE_GLOBAL);                     
\                                                                                                         

+            l1e_add_flags((pl1e),
_PAGE_USER);                              
\                                                                                                         

        
}                                                                   
\                                                                                                         

     } while ( 0 )


_PAGE_GUEST_KERNEL isn't in the ABI, which means that the 2nd if() is
the only piece of code which validly sets it.

Read-modify-write operations already don't function correctly as
_PAGE_GUEST_KERNEL is a hidden saturating bit from the guests point of view.

~Andrew

  reply	other threads:[~2016-01-21 15:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-20 20:10 Xen PV PTE ABI (or lack thereof) Andrew Cooper
2016-01-21 11:07 ` Jan Beulich
2016-01-21 11:16   ` Andrew Cooper
2016-01-21 12:59     ` Jan Beulich
2016-01-21 13:17       ` Andrew Cooper
2016-01-21 13:55         ` Jan Beulich
2016-01-21 15:10           ` Andrew Cooper [this message]
2016-01-21 14:29         ` David Vrabel
2016-01-21 14:37           ` Andrew Cooper
2016-01-21 14:53             ` David Vrabel

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=56A0F4E8.2060402@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=huaitong.han@intel.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.