Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2268938pxj; Sun, 16 May 2021 20:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGwIIZv9o/tZQWPsIu9N8NmUayrTx0pIuZ5MoF8lxF/WLCbjB2uheZ9AMlHZiPzmvt1pS8 X-Received: by 2002:a17:906:4089:: with SMTP id u9mr6788468ejj.18.1621222930586; Sun, 16 May 2021 20:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621222930; cv=none; d=google.com; s=arc-20160816; b=bxslHdkbmZpC5QfXC2WexmNhJuwjrNREmFYRTt7TeVB5opnTS2Din0JlH9rokhzBkd 18Qv+svGZS/LxxCSigLRG1W9cPINnRMfx1B7kg4xV83SgjnLwyEMONzcyqt4fmR/nMBo JiNCrJARerfO7vU2Pxe8PjlQlWt5cqN37Y+o0dNM+ExL0qF2yBpqunJHSgKZSYk5kWN0 AazAPyI97fE81PsGz+8hKKAJnwucLyqTyWQvzEDS0q8jUQ2pR4iO0FaRwcBunpRJtCYg wuYKZVwjs45lNy+HhS++mAITtXWvoJO24ObXE/2iSW/IX+UOLVN0SjMKaqZE3NIN4x4p 0ODw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=IRYK85pjaCe70JTFrf3RPUb3TFcbjloy7yk4cunWzMQ=; b=0DZMiKicwnCFmMuxUXJ/Hjk/nrnnWLMx1uBdWmr7Z08g0cb5srtScwPenjqMnsf1L/ p0pZmHb51zSk6+pIlRYCTnGc0Tcl9c4zA55Xcve8sFU1NkL0ZMN/RnNmUzjDP/T+rNMR WKpsUuDqC9Q0kZZZ2N/VnYyFjJ45/+r4zyUddT+jaXPooHZ6phDRa2dOGOrcS6e752bs +LV1DimD2LbAEMiwkEvNbS595aW36x3/lfkp8U982Om0cXW29oWu3T0xe7UYWAkfxlrI NsS+8GkGTM3RJRGmXrw4dpvnTPLY068wP9C4Bl907Twc3cn6rbhmvs/j1dojxPVIYvwl 8mgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cVpJuIfZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a42si14932817edf.319.2021.05.16.20.41.47; Sun, 16 May 2021 20:42:10 -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=@kernel.org header.s=k20201202 header.b=cVpJuIfZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233863AbhEQCvZ (ORCPT + 99 others); Sun, 16 May 2021 22:51:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:51794 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229661AbhEQCvZ (ORCPT ); Sun, 16 May 2021 22:51:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5EBAB61185; Mon, 17 May 2021 02:50:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621219809; bh=X5ngr4Uil22+BzVfrBo4TeLtOT8gxEtRZ54sQyy4Mm0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cVpJuIfZ67ZtRqeV5waou19NoOp3QzFmmCi87p8kkGFQ7g1/Id2iFmXqUmPJkjO7X Wx+DuUgPpwzBHGr438yjb/s9CPCYSaPxCSObPL9Ri+lc66kw1dhUzrtc+JPIapA/uE BsGv4Tpbgym1cPaY6Rj8bF5ipPXgILPTDKTN2JGFcWUujBQbCKoudvq7yI5Tu4FOAS 13ry/UYgQGkPnawO6XpGe7HpEcYhVs+331fkXuDXVgOC5pv8ZtdLkKSiuV2gjeQm15 0AyAh6mgt5pA6HLfkmJ51ij0CIc9m1ObrhPNvu0XJGz3ZlFJzNj3vUXUKg9z5ebVtu pH69lDz8c/yqw== Date: Sun, 16 May 2021 22:50:08 -0400 From: Sasha Levin To: Lu Baolu Cc: Wolfgang =?iso-8859-1?Q?M=FCller?= , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Ashok Raj , Joerg Roedel Subject: Re: [PATCH 5.10 392/530] iommu/vt-d: Preset Access/Dirty bits for IOVA over FL Message-ID: References: <20210512144819.664462530@linuxfoundation.org> <20210512144832.660153884@linuxfoundation.org> <20210515132855.4bn7ve2ozvdhpnj4@nabokov.fritz.box> <5d9b2c1a-f2f4-a9db-a14b-b6a31da59f54@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5d9b2c1a-f2f4-a9db-a14b-b6a31da59f54@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 17, 2021 at 10:38:42AM +0800, Lu Baolu wrote: >Hi Wolfgang, > >On 5/15/21 9:28 PM, Wolfgang M?ller wrote: >>Hi! >> >>First of all, apologies if this is the wrong place to post a problem >>report. I figured since I was going to reference a particular commit >>anyway I might as well reply to the patch series that (seemed to have) >>introduced the problem. >> >>>From: Lu Baolu >>> >>>[ Upstream commit a8ce9ebbecdfda3322bbcece6b3b25888217f8e3 ] >>> >>>The Access/Dirty bits in the first level page table entry will be set >>>whenever a page table entry was used for address translation or write >>>permission was successfully translated. This is always true when using >>>the first-level page table for kernel IOVA. Instead of wasting hardware >>>cycles to update the certain bits, it's better to set them up at the >>>beginning. >> >>This commit seems to trigger a kernel panic very early in boot for me in >>5.10.37 (36 is fine): > >It seems due to the back-ported patch: > >- if (!sg) { >- sg_res = nr_pages; >- pteval = ((phys_addr_t)phys_pfn << VTD_PAGE_SHIFT) | attr; >+ if (domain->domain.type == IOMMU_DOMAIN_DMA) { >+ attr |= DMA_FL_PTE_ACCESS; >+ if (prot & DMA_PTE_WRITE) >+ attr |= DMA_FL_PTE_DIRTY; >+ } > } > >+ pteval = ((phys_addr_t)phys_pfn << VTD_PAGE_SHIFT) | attr; > >Greg, do you want me to rework this patch, or submit an incremental fix? Could you send a reworked patch please? -- Thanks, Sasha