From nobody Fri May 17 11:28:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643800970; cv=none; d=zohomail.com; s=zohoarc; b=aGEIg5V65VTTgqCKIO6Y8Qj2f6pDDpzKLvVdgw0svnnrTNa0I+RmvLTffx01RQ8tBjj/DyVvhDdwkB+rQkEPQg1vygTwqquHu/Xy3hyhuU5wwo50lhmDABxAHwRY++1eeOi2EqyjdFe+HyS5PqyJtDLBZeHv4nmBuDPjzhqKoPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643800970; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=SDCBaptvTdJ6MaGIqN5dCST/Vb0ziTlxyPLO2sqP+W8=; b=kTr8c5SVS1Zynk32cCzj6R0owsZUPO9AqH1YqQsU3gWlGUp7Wdol4fwrEAODF2FDM5OPiESNyaSoH9IoFbwr/E4eJ/o3xf0ItE/Q0qPWEoEDctH/9W5tgHXbtE7QjLfvBFB0VfX2Ezakpgh2ILHO2/peiHZl+mV27h+9l5+GN2E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643800970611201.6414904768268; Wed, 2 Feb 2022 03:22:50 -0800 (PST) Received: from localhost ([::1]:46992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFDir-0001oO-4Y for importer@patchew.org; Wed, 02 Feb 2022 06:22:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFDcq-0000aE-K6 for qemu-devel@nongnu.org; Wed, 02 Feb 2022 06:16:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:31303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFDcl-0008Th-J2 for qemu-devel@nongnu.org; Wed, 02 Feb 2022 06:16:35 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-551-G3U6wVDwORGVvGn5CNQMlA-1; Wed, 02 Feb 2022 06:16:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 353471091DA3; Wed, 2 Feb 2022 11:16:09 +0000 (UTC) Received: from laptop.redhat.com (unknown [10.39.192.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D20410840C8; Wed, 2 Feb 2022 11:16:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643800573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDCBaptvTdJ6MaGIqN5dCST/Vb0ziTlxyPLO2sqP+W8=; b=bfb1ZtkcpVoDEa0bFC9mCvVI09Pq9cfMkRIMgXPcGyO17dQOdD+FzZY5zBfmDNIUONa5OI iWj60iGeumydsJK3mTWOnT5W+P7+k6ztRKfVOJ86+go1s2DcoXHfA7WwCyHkZnbl0IjTGv eZVk9bGX3ocTL0g5ZdXlylh4B+C653g= X-MC-Unique: G3U6wVDwORGVvGn5CNQMlA-1 From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, qemu-arm@nongnu.org, qemu-devel@nongnu.org, peter.maydell@linaro.org Subject: [PATCH] hw/arm/smmuv3: Fix device reset Date: Wed, 2 Feb 2022 12:16:02 +0100 Message-Id: <20220202111602.627429-1-eric.auger@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.086, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643800973467100001 Content-Type: text/plain; charset="utf-8" We currently miss a bunch of register resets in the device reset function. This sometimes prevents the guest from rebooting after a system_reset (with virtio-blk-pci). For instance, we may get the following errors: invalid STE smmuv3-iommu-memory-region-0-0 translation failed for iova=3D0x13a9d2000(SM= MU_EVT_C_BAD_STE) Invalid read at addr 0x13A9D2000, size 2, region '(null)', reason: rejected invalid STE smmuv3-iommu-memory-region-0-0 translation failed for iova=3D0x13a9d2000(SM= MU_EVT_C_BAD_STE) Invalid write at addr 0x13A9D2000, size 2, region '(null)', reason: rejected invalid STE Signed-off-by: Eric Auger Fixes: 10a83cb988 ("hw/arm/smmuv3: Skeleton") --- hw/arm/smmuv3.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 3b43368be0f..674623aabea 100644 --- a/hw/arm/smmuv3.c +++ b/hw/arm/smmuv3.c @@ -278,6 +278,12 @@ static void smmuv3_init_regs(SMMUv3State *s) s->features =3D 0; s->sid_split =3D 0; s->aidr =3D 0x1; + s->cr[0] =3D 0; + s->cr0ack =3D 0; + s->irq_ctrl =3D 0; + s->gerror =3D 0; + s->gerrorn =3D 0; + s->statusr =3D 0; } =20 static int smmu_get_ste(SMMUv3State *s, dma_addr_t addr, STE *buf, --=20 2.26.3