From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB808C47258 for ; Fri, 2 Feb 2024 08:35:47 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TOOo9rQ3; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0kxwgFn4; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0kxwgFn4; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TR8HQ44J9z3dTH for ; Fri, 2 Feb 2024 19:35:46 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TOOo9rQ3; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0kxwgFn4; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=TOOo9rQ3; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0kxwgFn4; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=suse.de (client-ip=195.135.223.131; helo=smtp-out2.suse.de; envelope-from=jroedel@suse.de; receiver=lists.ozlabs.org) X-Greylist: delayed 364 seconds by postgrey-1.37 at boromir; Fri, 02 Feb 2024 19:34:58 AEDT Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4TR8GV4kmtz3bnv for ; Fri, 2 Feb 2024 19:34:57 +1100 (AEDT) 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 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> 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> 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-Rspamd-Queue-Id: 789BB1F7B5 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gbatra@linux.vnet.ibm.com, tpearson@raptorengineering.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, aneesh.kumar@kernel.org, jgg@ziepe.ca, iommu@lists.linux.dev, npiggin@gmail.com, bgray@linux.ibm.com, naveen.n.rao@linux.ibm.com, vaibhav@linux.ibm.com, linuxppc-dev@lists.ozlabs.org, aik@amd.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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)