xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, David Vrabel <david.vrabel@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCHv1] CA-201372: x86: don't flush the whole cache when changing cachability
Date: Wed, 9 Mar 2016 14:36:37 +0000	[thread overview]
Message-ID: <56E034F5.5060704@citrix.com> (raw)
In-Reply-To: <56E03AAF02000078000DADB4@prv-mh.provo.novell.com>

On 09/03/16 14:01, Jan Beulich wrote:
>>>> On 08.03.16 at 19:44, <david.vrabel@citrix.com> wrote:
>> --- a/xen/arch/x86/flushtlb.c
>> +++ b/xen/arch/x86/flushtlb.c
>> @@ -140,7 +140,8 @@ unsigned int flush_area_local(const void *va, unsigned int flags)
>>          if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
>>              sz = 1UL << (order + PAGE_SHIFT);
>>  
>> -        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
>> +        if ( (!(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) ||
>> +              flags & FLUSH_VA_VALID) &&
> 
> The & wants to be parenthesized.

Style nit-picks really should come with a patch to CODING_STYLE.  The
existing code isn't consistent enough to deduce the preferred style.

>> --- a/xen/arch/x86/mm.c
>> +++ b/xen/arch/x86/mm.c
>> @@ -5641,7 +5641,7 @@ int map_pages_to_xen(
>>          flush_flags |= FLUSH_TLB_GLOBAL;       \
>>      if ( (flags & _PAGE_PRESENT) &&            \
>>           (((o_) ^ flags) & PAGE_CACHE_ATTRS) ) \
>> -        flush_flags |= FLUSH_CACHE;            \
>> +        flush_flags |= FLUSH_CACHE_BY_VA;      \
>>  } while (0)
> 
> No, that's too simple. You may flush by VA only if the MFN didn't
> change (or else you flush the wrong page).

Cachability changes goes through update_xen_mappings() which always uses
the same MFN -> virt mapping so the MFN never changes.

David

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

  reply	other threads:[~2016-03-09 14:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 18:44 [PATCHv1] CA-201372: x86: don't flush the whole cache when changing cachability David Vrabel
2016-03-09 13:32 ` David Vrabel
2016-03-09 14:01 ` Jan Beulich
2016-03-09 14:36   ` David Vrabel [this message]
2016-03-09 14:52     ` Jan Beulich
2016-03-09 15:23       ` Jan Beulich
2016-03-09 18:46         ` David Vrabel
2016-03-10  7:43           ` Jan Beulich

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=56E034F5.5060704@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).