Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp320128ybg; Tue, 9 Jun 2020 01:09:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7i6+G2Du9C0h8AejwEdLpPLqoNvUdzxjZqCOIR+U5oyNDf2t8k8sVimEkWoPKftULVGj1 X-Received: by 2002:a17:906:19c8:: with SMTP id h8mr25470182ejd.512.1591690142759; Tue, 09 Jun 2020 01:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591690142; cv=none; d=google.com; s=arc-20160816; b=fey3vZ/AgSPtvnBhRWilUj2YOkGz/gvyo3gX31vD/AFvF2BWev+vTQwdnVWc++cJW0 B2Wg9seteSKINsHzIp+mt17yron4CtjykXN8KBG6BIV5OHjgO7sBWvXdyBSbOAWrV5dj Bs9D8c/6B5EBm4qz0HW0BMiwcQmiw4Rx5GvKCY1L10Nlts/d5rpYteF0Sn2hMh4EPrPX L3l5p+CvVEC+dqKzLDDNsOXcbwGO5kLtTNM4e+8Vjn81EwNpd4GcGTSIpX5HYSyIYIQZ syJDSLo2LexYtlzPU9DJrrKQIze08jIN9SK7ZC/bicAA75FXZn/+5PjxM5gFpauCa+qR sBfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=buxSSRCSumsJTsg99213lJZ9FvtOHN4yH82YGbSMEBw=; b=WFaUrwo+KZkDLxO1eMR1BbsEEC8cIrBrW0unwBfrfB6Ji1JDqaWp8tHnCWNl5Xmscd N8tZBJvLPi9+FyLbb9XQh3nueGCwaOtq5HXujM6DUYhLTPLWEB8S/mQbONSYh9mCQbfa abcoUVHyV/ZmkgLdHgZ3lcRqqKHZV2YaW359xxB0IUk0BjIvY5HloJo2/nvzahlVAWUb pj2xz6Zt1W8GFVoxnAz1WoHGTcuKkblznrCiTeLkMjtBKKCcewjEABnPaSyhzGovRkBC UrO5tu/tGrpdjXTmkVEkmyVqk/9rZihQ0VCxLzrcdrRU1gub546UYTg5XaFSiA6u0i0K 8SjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz26si10334097ejb.470.2020.06.09.01.08.38; Tue, 09 Jun 2020 01:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728005AbgFIIFc (ORCPT + 99 others); Tue, 9 Jun 2020 04:05:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:52248 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbgFIIFa (ORCPT ); Tue, 9 Jun 2020 04:05:30 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A007FAB76; Tue, 9 Jun 2020 08:05:32 +0000 (UTC) Date: Tue, 09 Jun 2020 10:05:26 +0200 Message-ID: From: Takashi Iwai To: Christoph Hellwig Cc: David Rientjes , "Alex Xu (Hello71)" , , , , , , , Pavel Machek , , , , Subject: Re: next-0519 on thinkpad x60: sound related? window manager crash In-Reply-To: <20200609054306.GA9606@lst.de> References: <20200520111136.GA3802@amd> <1591545088.74ii116nf2.none@localhost> <20200608061950.GA17476@lst.de> <1591624340.z01ejtod28.none@localhost> <20200609054306.GA9606@lst.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 09 Jun 2020 07:43:06 +0200, Christoph Hellwig wrote: > > On Mon, Jun 08, 2020 at 07:31:47PM -0700, David Rientjes wrote: > > On Mon, 8 Jun 2020, Alex Xu (Hello71) wrote: > > > > > Excerpts from Christoph Hellwig's message of June 8, 2020 2:19 am: > > > > Can you do a listing using gdb where this happens? > > > > > > > > gdb vmlinux > > > > > > > > l *(snd_pcm_hw_params+0x3f3) > > > > > > > > ? > > > > > > > > > > (gdb) l *(snd_pcm_hw_params+0x3f3) > > > 0xffffffff817efc85 is in snd_pcm_hw_params (.../linux/sound/core/pcm_native.c:749). > > > 744 while (runtime->boundary * 2 <= LONG_MAX - runtime->buffer_size) > > > 745 runtime->boundary *= 2; > > > 746 > > > 747 /* clear the buffer for avoiding possible kernel info leaks */ > > > 748 if (runtime->dma_area && !substream->ops->copy_user) > > > 749 memset(runtime->dma_area, 0, runtime->dma_bytes); > > > 750 > > > 751 snd_pcm_timer_resolution_change(substream); > > > 752 snd_pcm_set_state(substream, SNDRV_PCM_STATE_SETUP); > > > 753 > > > > > > > Working theory is that CONFIG_DMA_NONCOHERENT_MMAP getting set is causing > > the error_code in the page fault path. Debugging with Alex off-thread we > > found that dma_{alloc,free}_from_pool() are not getting called from the > > new code in dma_direct_{alloc,free}_pages() and he has not enabled > > mem_encrypt. > > While DMA_COHERENT_POOL absolutely should not select DMA_NONCOHERENT_MMAP > (and you should send your patch either way), I don't think it is going > to make a difference here, as DMA_NONCOHERENT_MMAP just means we > allows mmaps even for non-coherent devices, and we do not support > non-coherent devices on x86. > > >From the disassembly it seems like a vmalloc allocation is NULL, which > seems really weird as this patch shouldn't make a difference for them, > and I also only see a single places that allocates the field, and that > checks for an allocation failure. But the sound code is a little > hard to unwind sometimes. It's not clear which sound device being affected, but if it's HD-audio on x86, runtime->dma_area points to a vmapped buffer from SG-pages allocated by dma_alloc_coherent(). OTOH, if it's a USB-audio, runtime->dma_area is a buffer by vmalloc(). Takashi