[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] xen-swiotlb: 32-bit coherent DMA mask rejected on PV dom0 since 6.6 (CONFIG_SWIOTLB_DYNAMIC), aacraid probe fails


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Anton Markov <akmarkov45@xxxxxxxxx>
  • Date: Wed, 16 Sep 2026 15:21:18 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=YqO0WlKHE0+GoRcBS3yjBKiqahNfqfB6FZoicxS9Bcc=; fh=quJY5mN2l4ZorNvEoO9ngNXalhEvTdq/+W8CvHWhECs=; b=KVBX49kgvaxlxdfeydCiW2QN5+ps+0cmBgehP44CKnotl7PQuQVAyU2nn9RUIv6jeX 1Bi2hJAjAPVBruRbn8agIb6OAgNPntl/ns1Vk3otCq9PSAj53qun6oZi93Nppeyd+nGa h4tl+/frnFzxflWOpZ49u2Ft2QRe+pfbDRBzSbswZoNYoBqjzOprOFzAD8ayps0CEYoF HAyP5mWNKBUeFxIO68KKWoErf9b58G0pqWxwk0ASOFznjF5TEsvGgoadzBiaXeA/rjFw 4c9PrSJiCrBqlzzHCutAG+/1b3mPoNjya400IRxL4kHFylUUU+UaCqxWYrg9AoS75KnD 6L6w==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1789561290; cv=none; d=google.com; s=arc-20260327; b=sbV7ADaxucQb4sRmPcMlBnKif/QCtRruu25YEJGazIFkAXlGDcjKJlSG9ovNfVyYRz jopCB36+xEyBZkSGhyB2dMCj2ZQ1ZUcS4cNb0YR1Zes0BnEb7IuA19NndOJN4tWkrvU7 AGjiKNGLJUh1LHEsX21lewcJvZR2eo7kicO62qCFJOmLE59Evg7Zdp36njdhJ1nYDY9J +M523mgwxASzPk36is55WET0M/ITDKaQ1j3tpkBWqXN1dAM+djdB1ZGRqqf29AcfimOr Z4mX85j1UJ5m6JWYtESjg6HTpPZbFII6cmZjs2ncd6h4UrEcuapSFOh15zb9/O/dsLWF /GBg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Type:To:Subject:Message-ID:Date:From:MIME-Version"
  • Delivery-date: Wed, 16 Sep 2026 12:21:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hello,


I'm hitting a regression on a PV dom0 where a driver that requests a 32-bit coherent DMA mask fails to probe. Bare metal with the same kernel is fine.


Environment:

Xen: 4.21.2-pre

dom0: Ubuntu 24.04, linux-image-6.8.0-139-generic (Ubuntu stock, CONFIG_SWIOTLB_DYNAMIC=y)

dom0 mode: PV

Hardware: Supermicro X10DRW-i (BIOS 2.0, 12/17/2015), 2x Xeon E5-2670 v3, 128 GB RAM

Controller: 81:00.0 RAID bus controller [0104]: Adaptec Series 8 12G SAS/PCIe 3 [9005:028d] (rev 01)


Xen command line (no dom0_mem, so dom0 gets all host memory):

placeholder ucode=scan dom0_max_vcpus=4-48 dom0_vcpus_pin=0 force-ept=1 ept=no-ad,no-pml hap_1gb=0 hap_2mb=0 altp2m=1 hpet=legacy-replacement smt=1 spec-ctrl=no gnttab_max_frames=512 cpufreq=xen:performance max_cstate=1 sched=credit sched-gran=cpu apicv=0 sched_credit2_max_cpus_runqueue=48 credit2_runqueue=cpu credit2_load_window_shift=33 credit2_load_precision_shift=18 sched_credit_tslice_ms=5 sched_ratelimit_us=500 hvm-freeze-on-pause=adaptive no-real-mode edd=off


Symptom (dmesg):


aacraid 0000:81:00.0: PCI 32 B consistent dma mask set failed

aacraid: probe of 0000:81:00.0 failed with error -5


The controller is present in lspci, the driver loads, but dma_set_coherent_mask(DMA_BIT_MASK(32)) is refused, so the disks never appear. Booting the same kernel without Xen works.


What probably goes wrong:


Since v6.6, xen_swiotlb_dma_supported() checks


xen_phys_to_dma(hwdev, default_swiotlb_limit()) <= mask


With CONFIG_SWIOTLB_DYNAMIC=y, default_swiotlb_limit() returns io_tlb_default_mem.phys_limit, which swiotlb_init_remap() sets to virt_to_phys(high_memory - 1) because Xen passes SWIOTLB_ANY (ad96ce3252db, used by swiotlb-xen since 05ee774122bd). On a PV dom0 that pseudo-physical address translates to a machine frame that, on any host with RAM above 4 GB, is above the 32-bit mask, so every 32-bit coherent mask request is rejected.


Before v6.6 the check used the end of the actual default pool, which xen_swiotlb_fixup() places below 4 GB, so 32-bit masks always passed. The coherent allocation itself would still succeed via xen_swiotlb_alloc_coherent() / xen_create_contiguous_region(); only the capability check is wrong.


This looks like the same root cause as the unanswered report from July 2024 (megaraid_sas, 63-bit mask, "Failed to set DMA mask"):

https://lkml.iu.edu/hypermail/linux/kernel/2407.3/08254.html

That report already confirmed CONFIG_SWIOTLB_DYNAMIC=n makes the problem go away. The 32-bit-mask case here is deterministic on any >4 GB host, so it should be easy to reproduce.


A minimal change that restores the previous behaviour, e.g.


return xen_phys_to_dma(hwdev, io_tlb_default_mem.defpool.end - 1) <= mask;


probably isn't the right fix for dynamic pools in general, but I wanted to flag where the check went wrong. Happy to test patches on this hardware.


Thanks.


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.