Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp234782ybg; Tue, 9 Jun 2020 22:30:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4hV7a0/vO6bbr5nY1riSMPsTYrv1AZhbwsixM0eyx5dlNtG5U6DIdKhL0Bp+6y68AL53z X-Received: by 2002:a17:906:edb6:: with SMTP id sa22mr1783133ejb.393.1591767004743; Tue, 09 Jun 2020 22:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591767004; cv=none; d=google.com; s=arc-20160816; b=SqtiXmM4e9ceG7c0CaIBGvhsgXpM8n/F28Cl0NBP5wHSUNscnJOB+xSmEva6pR8EON dVSK0Tb3WjNngI//lWZO9DAarEOWdTjoxLwvGEitAyxzi9TdcSCJTguYGcSoB4kzPW3B i4RRlvWuuVufaiK5yvI4QSommBUfUdHI+as+RF7d8sQCVgxMje/6x4/ppt+RDD8dR2Tc MIoOh4S4ojgKfQ8LLemcFLoxL0LW4dcyNKRpRvUCkXQXPBTNWAHFlN5Nus41qDQ4xsEw fgbVA9burKMH/ojewCOC4zuiWl2/Nu19nk8UhPVqWQPzzK9BGyVYjul4t9kkAd0MZHuN vgPw== 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 :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=C73zglBEMDME+CuVXUOa9MjlW4GPGi1nqlramfoTPEc=; b=YpKzpZYlsXNpZHJYwde+4k3oNqsPnCvn7PJmjBUWv5uG0Z17KILY4zrUO5k7yCpVIA dtDJFlEK6QQ/uDxqkA1DM3d5/1PClawApdHb1E0WQmv+DMjlZMoX9lTqnSZbsYywq63T LQ1/AcMsEistG6E03Sqw9DVivWtyzmMuOdsqLkAzDM4gOnNatSfuu8N/qFewlkyFlMQG hUkS6z7wc9yq53RdL5EC68yGqelHcZoYZAzuK42t1QkEEOi898yp2ot0VIrP7303RdnF m3pzY3YCAYVtBXRLHGI7UoYv6VJwQtL3Tuh2u4iIraLaq18l7nLDaaQ76fOFbuY3bSKK lr6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=MP3qU7v9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r27si11655890edl.187.2020.06.09.22.29.41; Tue, 09 Jun 2020 22:30:04 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=MP3qU7v9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726095AbgFJF0t (ORCPT + 99 others); Wed, 10 Jun 2020 01:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbgFJF0s (ORCPT ); Wed, 10 Jun 2020 01:26:48 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D618EC05BD1E for ; Tue, 9 Jun 2020 22:26:47 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id x11so505806plv.9 for ; Tue, 09 Jun 2020 22:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=C73zglBEMDME+CuVXUOa9MjlW4GPGi1nqlramfoTPEc=; b=MP3qU7v9ubA5PsvIyBe22857HQx1uPmTikkmoVl/+DWB2/6bH8no5xBs8enWPSEGPs 5VcdODk+KczV28hHqzEfvUZ9628Dm+p8XahYiutGXrES6XFxDJynneRvSg0F3rvb1+2M gpI/0BLnny7aU41jjv7OEEX9p58UtD4D83Vf1l1XrCzmlDCtj75XfbALQvo/gCWgww9P CfGxx2FBKrdVlzmTwj/IUl3nBYswJ8Ej/TXeB0vJVCOAq6r3UfmnCvB+jBoHg767wI1m V9taJ7Fq3JajMl2YoPwgyQ8Et5Nm8i/eKBEnmbU/mOyeTY/+lEnzknBEOecFVgDjCPlp VLAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=C73zglBEMDME+CuVXUOa9MjlW4GPGi1nqlramfoTPEc=; b=RcVIAIezc+W0SIoPjC+TeWyqvSi4QXTZ0d8T7I+07PZLEaZ/ZHr5sICv8azoEQzmv4 iEBSyoDAUbtAEZm0iAT2n9vlrQ2tB0eps/JHgw+ydet5N9cqcljZrMxlWe332wK6V8Ao Tny8LrxvCmVsuEB+A3FIWFRzN/oluU4LYT7m7o6fPvpdcNQVR8jx1Dv5mfieustibH6o t8XSfH4kug/HZqSn6CSIwQFFYkfen0ReE9uk3eFerf810vI1akJ8KkotSzG1FgeIgmCV 6FMPeLsNF9S8HoJvhyaoH6YCPaaoko0pClgTR7DZIXLp299qIX/YmC2RWI817R4uulvy O9MA== X-Gm-Message-State: AOAM531kge33wDjs3ucDDE7fS6gqznUguMzL3SWJ55dxn6OtrAkhM3te JT2Nao9rJH2eF1Dc+/VXIax0vA== X-Received: by 2002:a17:902:aa92:: with SMTP id d18mr1602231plr.127.1591766807153; Tue, 09 Jun 2020 22:26:47 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id x2sm11477140pfj.142.2020.06.09.22.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 22:26:46 -0700 (PDT) Date: Tue, 9 Jun 2020 22:26:45 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Christoph Hellwig cc: "Alex Xu (Hello71)" , alsa-devel@alsa-project.org, bp@alien8.de, hch@infradead.org, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@redhat.com, Pavel Machek , perex@perex.cz, tglx@linutronix.de, tiwai@suse.com, x86@kernel.org Subject: Re: next-0519 on thinkpad x60: sound related? window manager crash In-Reply-To: <20200609054306.GA9606@lst.de> Message-ID: References: <20200520111136.GA3802@amd> <1591545088.74ii116nf2.none@localhost> <20200608061950.GA17476@lst.de> <1591624340.z01ejtod28.none@localhost> <20200609054306.GA9606@lst.de> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 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, 9 Jun 2020, Christoph Hellwig wrote: > > 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. > We haven't heard yet whether the disabling of DMA_NONCOHERENT_MMAP fixes Aaron's BUG(), and the patch included some other debugging hints that will be printed out in case it didn't, but I'll share what we figured out: In 5.7, his config didn't have DMA_DIRECT_REMAP or DMA_REMAP (it did have GENERIC_ALLOCATOR already). AMD_MEM_ENCRYPT is set. In Linus HEAD, AMD_MEM_ENCRYPT now selects DMA_COHERENT_POOL so it sets the two aforementioned options. We also figured out that dma_should_alloc_from_pool() is always false up until the BUG(). So what else changed? Only the selection of DMA_REMAP and DMA_NONCOHERENT_MMAP. The comment in the Kconfig about setting "an uncached bit in the pagetables" led me to believe it may be related to the splat he's seeing (reserved bit violation). So I suggested dropping DMA_NONCOHERENT_MMAP from his Kconfig for testing purposes. If this option should not implicitly be set for DMA_COHERENT_POOL, then I assume we need yet another Kconfig option since DMA_REMAP selected it before and DMA_COHERENT_POOL selects DMA_REMAP :) So do we want a DMA_REMAP_BUT_NO_DMA_NONCOHERENT_MMAP? Decouple DMA_REMAP from DMA_NONCOHERENT_MMAP and select the latter wherever the former was set (but not DMA_COHERENT_POOL)? Something else?