Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp154382pxv; Wed, 30 Jun 2021 02:19:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD17ztUaaeHsa9kpLdShK4ISFrukyHElImNshunwAo+IxaFlUPfa/AhmOsrn0tu1GV5AOu X-Received: by 2002:a92:6610:: with SMTP id a16mr24736077ilc.124.1625044781226; Wed, 30 Jun 2021 02:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625044781; cv=none; d=google.com; s=arc-20160816; b=B4xPGU7U6VgJi0N/aDVXBx/oi2BvkM8B8d6jDTcH2UwhbNY4KwyxzwG3SrUhkFj+ZK cTPsM3og924MpL3fZkCsfL4dSAdLdH6bVp2AKkd69OtUD+K9IetKYw8Om/hfoDwYr001 LmKNozY7QOSkNLnPQ779r4BWIO4P2C7nJFr2ILlNzV3W7LDTQcs6PWyS3SJ2KS9YH8+q 9LUkIOA+Eq0lW4+FVmq9rBKzzzvQqdgRORbBPuwvNhqV64doGXe0uD+gq8/FqZdr91SF Mu0X07bsHxznt9NaIkr5BjyGj+Oljn1ecdy9blB6kUF3X4JSHGH0oxPgW4qjInSQDBTj fqLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SGxHKBuGZkCU1I+kyNcTwBrZAXyCdyYBNGIIT95dpcY=; b=uwR73A1M1ofSSkIXisYnqApgt+jJzCXSanGIv8lbOGx1go59Dyhq606+EzTMhoVQms jAHf4G5O3y6zpVxLm4IhVDtTV73vPDTX6Yn4QrnFjWYMTHRqADkoXxUvSxcgjprgNsIg A3u7wiZnrZHjWsZO3adFGyhG8643Lwn7eje8/Pls1ANbMxM/4aBb5nsCZEx+8QlSyIAf ZcJcPdA/Hmd2ylcCusp6TEaIJEgdhW0cWipsdh7nulCtL+QWk7nLmz/ptH7IwfL1q0IO SlCYgRTfWQ5MoNWVWwgNXrtCiUQJZn6Y6a/gEpxWmHx49iyIm8i1eKIYQv777jPlzavj hkRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PitW6imf; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si5109412ilg.119.2021.06.30.02.19.28; Wed, 30 Jun 2021 02:19:41 -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=@chromium.org header.s=google header.b=PitW6imf; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233736AbhF3JUT (ORCPT + 99 others); Wed, 30 Jun 2021 05:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233696AbhF3JUT (ORCPT ); Wed, 30 Jun 2021 05:20:19 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77189C061756 for ; Wed, 30 Jun 2021 02:17:50 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id c8so1840351pfp.5 for ; Wed, 30 Jun 2021 02:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SGxHKBuGZkCU1I+kyNcTwBrZAXyCdyYBNGIIT95dpcY=; b=PitW6imfDn0IzY3RG7JEiKUR+7Nsn4w2y1bEvPgW/HS2AbzJNtJNRONqnYjnNN01RO f4Cy3TS0FXR+ruq1aYhiZGEJMhWbD1l8vF9wU2uLP3NYm94onDiG0L+Sdwsda2NHyvii j6adVFIua9Ybkbk/RCb14aonwq2ISknAbeRG8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SGxHKBuGZkCU1I+kyNcTwBrZAXyCdyYBNGIIT95dpcY=; b=WXaP359Cj8nZDLoa8jVcQEItyyLx5ymhcH2Isiko9Zs6EWNuNt/BVvFhCv5B8qMALO jwndwVDiESEP5sNJvtip2Mvphg6keU3B5Z7IBiD3H51FHiBdlwb3od6OVcyrkRBaNLfa 7UlP+S8Bec62JAdfz9ISYZWh11t5LpQO/VWXBvnrM0qkc/HPt8z3RB8yQpud13zpHEM9 wlrs1wLpwcuc4vxKtKTDzaElVQzPaq08U0lET3s87HO2ZzLGW2ZCzfv5kqy88fs9y6Z1 XCBWAzH5xVGgbWZta5RsTC6SIl296NBQok3BHVXbbDK/bDp38tkmVFbVLwqb3rbjxAsx w2vw== X-Gm-Message-State: AOAM530QQlxwCpW9SGVDSTJIymoFLNnst/llSeqTPM9Q9BGCgOan/XLs 8VO9QOflR1/zQreL+sISgCINz6zrmJWftw== X-Received: by 2002:a63:3383:: with SMTP id z125mr907095pgz.26.1625044670021; Wed, 30 Jun 2021 02:17:50 -0700 (PDT) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com. [209.85.215.170]) by smtp.gmail.com with ESMTPSA id q18sm21015019pfj.178.2021.06.30.02.17.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Jun 2021 02:17:49 -0700 (PDT) Received: by mail-pg1-f170.google.com with SMTP id g22so1631491pgl.7 for ; Wed, 30 Jun 2021 02:17:49 -0700 (PDT) X-Received: by 2002:a6b:e013:: with SMTP id z19mr7163972iog.34.1625044658498; Wed, 30 Jun 2021 02:17:38 -0700 (PDT) MIME-Version: 1.0 References: <20210624155526.2775863-1-tientzu@chromium.org> <20210624155526.2775863-7-tientzu@chromium.org> In-Reply-To: From: Claire Chang Date: Wed, 30 Jun 2021 17:17:27 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing To: Nathan Chancellor Cc: Rob Herring , mpe@ellerman.id.au, Joerg Roedel , Will Deacon , Frank Rowand , Konrad Rzeszutek Wilk , boris.ostrovsky@oracle.com, jgross@suse.com, Christoph Hellwig , Marek Szyprowski , benh@kernel.crashing.org, paulus@samba.org, "list@263.net:IOMMU DRIVERS" , Stefano Stabellini , Robin Murphy , grant.likely@arm.com, xypron.glpk@gmx.de, Thierry Reding , mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, Greg KH , Saravana Kannan , "Rafael J . Wysocki" , heikki.krogerus@linux.intel.com, Andy Shevchenko , Randy Dunlap , Dan Williams , Bartosz Golaszewski , linux-devicetree , lkml , linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, Nicolas Boichat , Jim Quinlan , Tomasz Figa , bskeggs@redhat.com, Bjorn Helgaas , chris@chris-wilson.co.uk, Daniel Vetter , airlied@linux.ie, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com, Jianxiong Gao , joonas.lahtinen@linux.intel.com, linux-pci@vger.kernel.org, maarten.lankhorst@linux.intel.com, matthew.auld@intel.com, rodrigo.vivi@intel.com, thomas.hellstrom@linux.intel.com, Tom Lendacky , Qian Cai Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and > > use it to determine whether to bounce the data or not. This will be > > useful later to allow for different pools. > > > > Signed-off-by: Claire Chang > > Reviewed-by: Christoph Hellwig > > Tested-by: Stefano Stabellini > > Tested-by: Will Deacon > > Acked-by: Stefano Stabellini > > This patch as commit af452ec1b1a3 ("swiotlb: Use is_swiotlb_force_bounce > for swiotlb data bouncing") causes my Ryzen 3 4300G system to fail to > get to an X session consistently (although not every single time), > presumably due to a crash in the AMDGPU driver that I see in dmesg. > > I have attached logs at af452ec1b1a3 and f127c9556a8e and I am happy > to provide any further information, debug, or test patches as necessary. Are you using swiotlb=force? or the swiotlb_map is called because of !dma_capable? (https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/kernel/dma/direct.h#n93) `BUG: unable to handle page fault for address: 00000000003a8290` and the fact it crashed at `_raw_spin_lock_irqsave` look like the memory (maybe dev->dma_io_tlb_mem) was corrupted? The dev->dma_io_tlb_mem should be set here (https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/pci/probe.c#n2528) through device_initialize. I can't tell what happened from the logs, but maybe we could try KASAN to see if it provides more clue. Thanks, Claire > > Cheers, > Nathan