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.gnu.org (lists.gnu.org [209.51.188.17]) (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 DB431CCFA00 for ; Tue, 4 Nov 2025 08:56:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vGCph-00048b-I1; Tue, 04 Nov 2025 03:56:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vGCpW-00040Q-CE for qemu-arm@nongnu.org; Tue, 04 Nov 2025 03:55:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vGCpU-00073R-Fd for qemu-arm@nongnu.org; Tue, 04 Nov 2025 03:55:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762246550; h=from:from:reply-to:reply-to:subject:subject: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=HN62QGwthL8facCp3VPYNlRtyyweQYgUZyqjYbLgJVk=; b=Hn89BcOrBGk0uDUOvpJxHJvg93GTdMBpmzP5jHXtMwJ0deZJLrbyyVNtuHfO5L+XT8rhh4 J0Dyvw3Zwgn+pv2shOrwr5ANF4vk2Cqkji3XW5x/hhoovZ5Wom8812VT/C2z8h3rhFpqn1 qXAo7trKjMQMPJlWFNP7lD3k6aBZm7A= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-QHwpHzeoM-2_llM02QpHBw-1; Tue, 04 Nov 2025 03:55:49 -0500 X-MC-Unique: QHwpHzeoM-2_llM02QpHBw-1 X-Mimecast-MFC-AGG-ID: QHwpHzeoM-2_llM02QpHBw_1762246549 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-470fd92ad57so61063755e9.3 for ; Tue, 04 Nov 2025 00:55:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762246549; x=1762851349; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:reply-to:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HN62QGwthL8facCp3VPYNlRtyyweQYgUZyqjYbLgJVk=; b=wsORzSpfrJRkEhXPMz65aF2ISkk6wGFYO9H1oBHpH9SuB9wg8vnBRWgMB/KP6K1ltK U+mHKLGOpLjEIj4iFpV/MQgm+jh2mKsFrJRc0lMIIkWZ0xEk/ILEfv/T+lty6+Lfc/S9 1oM/BKw3VvLhpO8W8sJZVxHHZbMrqPP5uQYgff2gTRu7WJBQCXSZG+7Pj7zk5voI67HM NzZClHF5lBGeZ64214ZEctDLHX/D8U3cBweEIMxPDphi/wByQ5LQit8UrslAbCSuIH0/ OsN+rhj8nYlWHTojUdGUeuanOrKziOOuS7VuhfcDbTgwxPcZEuNJJrZLrKo1n4hrr4iM ca6w== X-Gm-Message-State: AOJu0YxDKGLJGLEbtt6fzy3W+jIf35GpHtd6kmLNvLzlKRFAEFMb9aTY Q6k5+LZG9RZYcHv+1pje6ecm6bsBxJKzdJ+8GvAer32rsj36mCgU5KRhmfoVevzEK/gQYgXzXGr kMKC88XC0ambWdjTjaolfeSbqR0s+A2BaUDyPmE0hJuE+GObfECWahw== X-Gm-Gg: ASbGnctDGnUqTOqx45JXf9A2e89SmYZnMjS9bD7VL4y4M/9le61Y47kHm95EGlObjZR 61hdMWxuC94aYORD0FPzxyly4GTpAIUCaRN1dWq+Ggf4JuSmJwer4ZBBL1gwdvLikQhHq2aNFjK ZQeh2z9nBYvE2PS+XCwGAHM5Cje/SF4GCve9JWnYeDGrO7IM433zqG9JpuCIep6PbtJiwq+RcHo ElNDsdQ7FG82ZjlrKjqWKr4ExX0k6poQ1aorfZ0NSJMR4iNheYXPOV4hVhq73egLaSpODrvDwYU VtGoCnrYGQuCCkG/jl0HoGQVADsf3zJFwGcocBpxf7xXmOxbRg9WxWQSrmxSP5+i2O15Onsuj0M yrwwatUwgv+L1KJleAo8XdaPWhLbHActE9gsAOPnOUEzPTw== X-Received: by 2002:a05:600c:3b13:b0:45d:5c71:769a with SMTP id 5b1f17b1804b1-4773089c52fmr133016625e9.26.1762246548617; Tue, 04 Nov 2025 00:55:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcS2niz5q7n38UG7b36aWFaAXXGFxK9u+bsbaWFxlhpVxtx4o48KibCE+hx/yFWkssgPfBWA== X-Received: by 2002:a05:600c:3b13:b0:45d:5c71:769a with SMTP id 5b1f17b1804b1-4773089c52fmr133016405e9.26.1762246548165; Tue, 04 Nov 2025 00:55:48 -0800 (PST) Received: from ?IPV6:2a01:e0a:f0e:9070:527b:9dff:feef:3874? ([2a01:e0a:f0e:9070:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-477563e25e1sm18275215e9.5.2025.11.04.00.55.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Nov 2025 00:55:47 -0800 (PST) Message-ID: Date: Tue, 4 Nov 2025 09:55:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 17/32] hw/arm/smmuv3-accel: Add support to issue invalidation cmd to host To: Nicolin Chen , Shameer Kolothum Cc: "qemu-arm@nongnu.org" , "qemu-devel@nongnu.org" , "peter.maydell@linaro.org" , Jason Gunthorpe , "ddutile@redhat.com" , "berrange@redhat.com" , Nathan Chen , Matt Ochs , "smostafa@google.com" , "wangzhou1@hisilicon.com" , "jiangkunkun@huawei.com" , "jonathan.cameron@huawei.com" , "zhangfei.gao@linaro.org" , "zhenzhong.duan@intel.com" , "yi.l.liu@intel.com" , Krishnakant Jaju References: <20251031105005.24618-1-skolothumtho@nvidia.com> <20251031105005.24618-18-skolothumtho@nvidia.com> From: Eric Auger In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: _kgT0rGSj5p226iwuYsV0wyLGDOMfEBvHzcmrl6qAxk_1762246549 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=eric.auger@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: eric.auger@redhat.com Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Hi, On 11/3/25 7:51 PM, Nicolin Chen wrote: > On Mon, Nov 03, 2025 at 10:17:20AM -0800, Shameer Kolothum wrote: >>>> The general >>>> idea is, we will pass the errp to accel functions and report or >>>> propagate from here. >>> But there is no "errp" in smmuv3_cmdq_consume() to propagate the these >>> local_errs further? It ends at the error_report_err(). >>> >>> If we only get local_err and print them, why not just print them inside the >>> _accel functions? >> Right, we don’t propagate error now. But in future it might come >> handy. I would personally keep the error propagation facility if possible. > smmuv3_cmdq_consume() is called in smmu_writel() only. Where do we > plan to propagate that in the future? > >> Also, this was added as per Eric's comment on RFC v3. >> >> https://lore.kernel.org/qemu-devel/41ceadf1-07de-4c8a-8935-d709ac7cf6bc@redhat.com/ > If only we have a top function that does error_report_err() in one > place.. Duplicating error_report_err(local_err) doesn't look clean > to me. > > Maybe smmu_writel() could do: > { > + Error *errp = NULL; > > switch (offset) { > case A_XXX: > smmuv3_cmdq_consume(..., errp); > + return MEMTX_OK; > - break; > ... > case A_YYY: > smmuv3_cmdq_consume(..., errp); > + return MEMTX_OK; > - break; > } > + error_report_err(errp); > + return MEMTX_OK; > } > > Any better idea, Eric? Can't we move local_err outside of case block and after the switch,  if (cmd_error) {    if (local_err) {       error_report_err(local_err);    } ../..   Eric   > > Nicolin >