All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: avoid playing with directmap when self-snoop can be relied upon
@ 2020-10-20 13:51 Jan Beulich
  2020-10-21 15:23 ` Roger Pau Monné
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2020-10-20 13:51 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

The set of systems affected by XSA-345 would have been smaller is we had
this in place already: When the processor is capable of dealing with
mismatched cacheability, there's no extra work we need to carry out.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -795,6 +795,9 @@ static int update_xen_mappings(unsigned
     unsigned long xen_va =
         XEN_VIRT_START + ((mfn - PFN_DOWN(xen_phys_start)) << PAGE_SHIFT);
 
+    if ( boot_cpu_has(X86_FEATURE_XEN_SELFSNOOP) )
+        return 0;
+
     if ( unlikely(alias) && cacheattr )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, 0);
     if ( !err )
@@ -802,6 +805,7 @@ static int update_xen_mappings(unsigned
                      PAGE_HYPERVISOR | cacheattr_to_pte_flags(cacheattr));
     if ( unlikely(alias) && !cacheattr && !err )
         err = map_pages_to_xen(xen_va, _mfn(mfn), 1, PAGE_HYPERVISOR);
+
     return err;
 }
 


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

* Re: [PATCH] x86/mm: avoid playing with directmap when self-snoop can be relied upon
  2020-10-20 13:51 [PATCH] x86/mm: avoid playing with directmap when self-snoop can be relied upon Jan Beulich
@ 2020-10-21 15:23 ` Roger Pau Monné
  2020-10-22  7:29   ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monné @ 2020-10-21 15:23 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Andrew Cooper, Wei Liu

On Tue, Oct 20, 2020 at 03:51:18PM +0200, Jan Beulich wrote:
> The set of systems affected by XSA-345 would have been smaller is we had
> this in place already: When the processor is capable of dealing with
> mismatched cacheability, there's no extra work we need to carry out.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

I guess it's not worth using the alternative framework to patch this
up at boot in order to avoid the call in the first place?

Thanks, Roger.


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

* Re: [PATCH] x86/mm: avoid playing with directmap when self-snoop can be relied upon
  2020-10-21 15:23 ` Roger Pau Monné
@ 2020-10-22  7:29   ` Jan Beulich
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2020-10-22  7:29 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel, Andrew Cooper, Wei Liu

On 21.10.2020 17:23, Roger Pau Monné wrote:
> On Tue, Oct 20, 2020 at 03:51:18PM +0200, Jan Beulich wrote:
>> The set of systems affected by XSA-345 would have been smaller is we had
>> this in place already: When the processor is capable of dealing with
>> mismatched cacheability, there's no extra work we need to carry out.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

> I guess it's not worth using the alternative framework to patch this
> up at boot in order to avoid the call in the first place?

It being non-trivial (afaict) in cases like this one makes me
think that the price to do so would be higher than the gain
to be had. But I might be wrong ...

Jan


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

end of thread, other threads:[~2020-10-22  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 13:51 [PATCH] x86/mm: avoid playing with directmap when self-snoop can be relied upon Jan Beulich
2020-10-21 15:23 ` Roger Pau Monné
2020-10-22  7:29   ` Jan Beulich

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.