Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp699018rdb; Fri, 2 Feb 2024 00:47:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFR9a2g9ymL82d+ePjbsQ29HwUnT+UVNzAfvMECzyKWoUyM5faE2HgZxndynOCHB+4zyn// X-Received: by 2002:a05:6808:f0d:b0:3bf:c3d3:887e with SMTP id m13-20020a0568080f0d00b003bfc3d3887emr340251oiw.11.1706863664350; Fri, 02 Feb 2024 00:47:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706863664; cv=pass; d=google.com; s=arc-20160816; b=LxK45o3cmE2OmnaWvGsubxy6DYx1cSFT64FRak/Zdc3QV0/3ESZ9hhubSaRdOkNDwy 9hEZR5ETTFdps8qvSNUzvj/esLMCXPnEAtgCvR2Qh/AcWUefzeB95E/++v6gpbptszwC I9xpge7lF4z31E4fwdtXfwJUGtHM4CTgrWZ/zufxY3dIe15WyORbiNFv+gDzRQN7rhzr 1ew/qnvVZcemevlRUdWRVDZohZmwyFPQH2iSgtsyAW4GtLn4blLuukWXxaxBJvPg7Jen g2WUuGmGzxOwl0NORQUTV1ut0Q9swka1xWYAPvsoU3mrlYmIkZ5k+jYLLIviDVomLZNz vnVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=KUddC1I+jw2IHlukgEBRe9GvjxAroUZ7wuAoEIiY7Dw=; fh=rdkiVT2vWnnRDLCrpd2rSLTX3sThDszrdWORAZUZ9Ek=; b=alp3Hs3OnWsWfX3nTAS7TNUgt5jXlk6K1uTRkvolqZqLmdfe6WCdQJ/miPbORAHXli QMMnthpskR4Q1F7ud+8nu0K1qnUUBOpU0r/83fO/lvrES88YlxsQ+tThwlHy6oZXBZ7a 4n1tLoWFWUfesFofC+NaQY3lL+s15suHTUCCABG0gthqCxEd/bZguBCJ6XtxwLBgNLLY C9IaMO54ygU5RkBFx2oyh9MBSQGyOrhtP6x24RJOWFmj+6H90iXE9yUc/k9Xq5Sne+L4 NdYzojW0WRJ6+zxIFBEGCma0tqd1DBxpqyk2mNWTES3rBK9D5UzQRa5KLWl2vje66FCs Qvbg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-49469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=1; AJvYcCUN46UTUAtUe3uikDMWeZwXPThtbAIOog0wwmbxMaPRdE8BzLArdXZuQWVnPigE0m+1BlBtqpCtIbDTJszntCZfeLf94j4kZmJCeUKxKg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id fh12-20020a056a00390c00b006ddc3620a09si1195871pfb.71.2024.02.02.00.47.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:47:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-49469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E9592B23A11 for ; Fri, 2 Feb 2024 08:29:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2C67B182CC; Fri, 2 Feb 2024 08:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TOOo9rQ3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="0kxwgFn4"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TOOo9rQ3"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="0kxwgFn4" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3712C18042 for ; Fri, 2 Feb 2024 08:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706862534; cv=none; b=ApLWfMkuaOCLUm3BuN+OkbyWiTN4FDVyQpecTMT74t6o9LmxGClQ8IicJCVmJWJnsxjA8YLJvDg2RATf2MCCyhK1a6GLy5OIzngg1mifcjLTzpOyGwo6Xq1nZFJe/c4nCiO8SdwPRfqPEEpQ20ZD1xDgxY0+HO+Cju6DDOWXWCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706862534; c=relaxed/simple; bh=26F7aeq5HhWyoPhZMrZiqHwekA/hhDjFM3DWXbhyaXo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f6nZDoBXTBk70MBtL3PmNV6ocP7weXBRulgnnt7ylE0qymj6TbdG4tW/TiPWj01pfP+cnzRmNl17/tXDcE6OWmSqO7uKHUkbEc53KfJbL/LoW1It0inOl4uS1rOAL0hw+j2aSdigXcgUgP2BAsBXbvRsntEvl6yfOZc8kc5Derc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TOOo9rQ3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=0kxwgFn4; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TOOo9rQ3; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=0kxwgFn4; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 789BB1F7B5; Fri, 2 Feb 2024 08:28:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706862529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUddC1I+jw2IHlukgEBRe9GvjxAroUZ7wuAoEIiY7Dw=; b=TOOo9rQ3411Cu7tO0NXyFJhhn6vwdhwE+NURq2A7BGcKTDbZIGevPEqVKgwQGkCxRFdh2x qOGGY6w4Ulyc8CBNO+l4J2Xw9djqY5Q+mPTUXUMJVgE/4pu44VSlVbDbbJZrD/Vy70uN0c EmmuIzp2O98ZZ4XYKFD6OAIwAfqsojk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706862529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUddC1I+jw2IHlukgEBRe9GvjxAroUZ7wuAoEIiY7Dw=; b=0kxwgFn4BF7Phlj0jdeUbWCxA0FtnIKVf9FqmHJPS498fCup49MaNCeCK4x6ZDLXX03lHi LEPynSdeoM61C7Cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706862529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUddC1I+jw2IHlukgEBRe9GvjxAroUZ7wuAoEIiY7Dw=; b=TOOo9rQ3411Cu7tO0NXyFJhhn6vwdhwE+NURq2A7BGcKTDbZIGevPEqVKgwQGkCxRFdh2x qOGGY6w4Ulyc8CBNO+l4J2Xw9djqY5Q+mPTUXUMJVgE/4pu44VSlVbDbbJZrD/Vy70uN0c EmmuIzp2O98ZZ4XYKFD6OAIwAfqsojk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706862529; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KUddC1I+jw2IHlukgEBRe9GvjxAroUZ7wuAoEIiY7Dw=; b=0kxwgFn4BF7Phlj0jdeUbWCxA0FtnIKVf9FqmHJPS498fCup49MaNCeCK4x6ZDLXX03lHi LEPynSdeoM61C7Cg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 127A913A58; Fri, 2 Feb 2024 08:28:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vhFYA8GnvGXjPgAAD6G6ig (envelope-from ); Fri, 02 Feb 2024 08:28:49 +0000 Date: Fri, 2 Feb 2024 09:28:43 +0100 From: Joerg Roedel To: Shivaprasad G Bhat Cc: iommu@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com, jgg@ziepe.ca, tpearson@raptorengineering.com, aik@amd.com, bgray@linux.ibm.com, gregkh@linuxfoundation.org, gbatra@linux.vnet.ibm.com, vaibhav@linux.ibm.com Subject: Re: [PATCH v2] powerpc: iommu: Bring back table group release_ownership() call Message-ID: References: <170628173462.3742.18330000394415935845.stgit@ltcd48-lp2.aus.stglab.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <170628173462.3742.18330000394415935845.stgit@ltcd48-lp2.aus.stglab.ibm.com> X-Spam-Level: Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=TOOo9rQ3; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=0kxwgFn4 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-6.51 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[100.00%]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWELVE(0.00)[16]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:url,suse.de:dkim,suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FREEMAIL_CC(0.00)[lists.linux.dev,lists.ozlabs.org,vger.kernel.org,ellerman.id.au,gmail.com,csgroup.eu,kernel.org,linux.ibm.com,ziepe.ca,raptorengineering.com,amd.com,linuxfoundation.org,linux.vnet.ibm.com]; RCVD_TLS_ALL(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from] X-Spam-Score: -6.51 X-Rspamd-Queue-Id: 789BB1F7B5 X-Spam-Flag: NO On Fri, Jan 26, 2024 at 09:09:18AM -0600, Shivaprasad G Bhat wrote: > The commit 2ad56efa80db ("powerpc/iommu: Setup a default domain and > remove set_platform_dma_ops") refactored the code removing the > set_platform_dma_ops(). It missed out the table group > release_ownership() call which would have got called otherwise > during the guest shutdown via vfio_group_detach_container(). On > PPC64, this particular call actually sets up the 32-bit TCE table, > and enables the 64-bit DMA bypass etc. Now after guest shutdown, > the subsequent host driver (e.g megaraid-sas) probe post unbind > from vfio-pci fails like, > > megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0x7fffffffffffffff, table unavailable > megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0xffffffff, table unavailable > megaraid_sas 0031:01:00.0: Failed to set DMA mask > megaraid_sas 0031:01:00.0: Failed from megasas_init_fw 6539 > > The patch brings back the call to table_group release_ownership() > call when switching back to PLATFORM domain from BLOCKED, while > also separates the domain_ops for both. > > Fixes: 2ad56efa80db ("powerpc/iommu: Setup a default domain and remove set_platform_dma_ops") > Signed-off-by: Shivaprasad G Bhat > --- > Changelog: > v1: https://lore.kernel.org/linux-iommu/170618451433.3805.9015493852395837391.stgit@ltcd48-lp2.aus.stglab.ibm.com/ > - Split the common attach_dev call to platform and blocked attach_dev > calls as suggested. > > arch/powerpc/kernel/iommu.c | 37 ++++++++++++++++++++++++++++--------- > 1 file changed, 28 insertions(+), 9 deletions(-) Applied, thanks. -- J?rg R?del jroedel@suse.de SUSE Software Solutions Germany GmbH Frankenstra?e 146 90461 N?rnberg Germany https://www.suse.com/ Gesch?ftsf?hrer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG N?rnberg)