Bug #534

DMA KVA cache attributes incorrect

Added by Gordon Ross over 3 years ago. Updated over 2 years ago.

Status:Rejected Start date:2010-12-17
Priority:High Due date:
Assignee:- % Done:

0%

Category:kernel Spent time: -
Target version:-
Difficulty:Medium Tags:needs-triage

Description

http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=7001754
Related Bugs 6896869 , 6212057

The KVA mapping created by ddi_dma_mem_alloc() always gets WB/cached cached
attributes even when UC/uncached (DDI_STRICTORDER_ACC) or WC/writecombine
(DDI_MERGING_OK_ACC) are requested. On b151a, the KVA for a single page DMA
buffer that should be UC (KVA 0xffffff01d8828000 PA 0x110412000):

110412::report_maps
hat=ffffff01c707ee78 maps addr=ffffff01d8828000 ffffff01d8828000::vatopfn
level=0 htable=ffffff01d2f288a0 pte=110412363
level=1 htable=ffffff01c7377df0 pte=11b9fc027
level=2 htable=ffffff01c7377d60 pte=b85fb027
level=3 htable=ffffff01c7378ed0 pte=b85ff027
Virtual address 0xffffff01d8828000 maps pfn 0x110412 110412363::pte
pte=110412363: pfn=0x110412 nosync global write

ffffff01d8828000::vatopfn
level=0 htable=ffffff01d2f288a0 pte=110412363
level=1 htable=ffffff01c7377df0 pte=11b9fc027
level=2 htable=ffffff01c7377d60 pte=b85fb027
level=3 htable=ffffff01c7378ed0 pte=b85ff027
Virtual address 0xffffff01d8828000 maps pfn 0x110412

The PTE should say "uncached" (PT_NOCACHE not set). Note this is with
gfx_private::gfxp_fix_mem_cache_attrs() now a NOP.

Here's a single page DMA buffer (KVA 0xffffff01d8828000 PA 0x110412000)
with gfx_private::gfxp_fix_mem_cache_attrs() restored:

13bd36::report_maps
hat=ffffff01c707ee78 maps addr=ffffff01d8a8c000 ffffff01d8a8c000::vatopfn
level=0 htable=ffffff01d395d158 pte=13bd36373
level=1 htable=ffffff01c7377df0 pte=11c14c027
level=2 htable=ffffff01c7377d60 pte=b85fb027
level=3 htable=ffffff01c7378ed0 pte=b85ff027
Virtual address 0xffffff01d8a8c000 maps pfn 0x13bd36 13bd36373::pte
pte=13bd36373: pfn=0x13bd36 nosync global write uncached

ffffff01d8a8c000::vatopfn
level=0 htable=ffffff01d395d158 pte=13bd36373
level=1 htable=ffffff01c7377df0 pte=11c14c027
level=2 htable=ffffff01c7377d60 pte=b85fb027
level=3 htable=ffffff01c7378ed0 pte=b85ff027
Virtual address 0xffffff01d8a8c000 maps pfn 0x13bd36

Note the PTE has "uncached" (PT_NOCACHE set).


Related issues

related to illumos gate - Bug #1380: Xen DomU crashes in vfs_mountroot after image-update to /... Closed 2011-08-16
related to illumos gate - Bug #1402: fix for #534 causes dire performance regression Resolved 2011-08-23

History

Updated by Albert Lee over 3 years ago

  • Category set to kernel
  • Priority changed from Normal to High

This is a very serious problem. We need to determine if this affects write ordering for e.g. storage devices.

Updated by Eric Schrock almost 3 years ago

  • Status changed from New to Resolved
  • Difficulty set to Medium
  • Tags set to needs-triage

changeset: 13392:0ad5890414dc
tag: tip
user: Michael Tsymbalyuk <>
date: Thu Jun 23 11:00:11 2011 -0700

description:
534 DMA KVA cache attributes incorrect
Reviewed by: Garrett D'Amore <>
Reviewed by: Albert Lee <>
Approved by: Eric Schrock <>

Updated by Rich Lowe over 2 years ago

  • Status changed from Resolved to Rejected

Backed out by #1402 and, for the moment, decided invalid.

Also available in: Atom PDF