From patchwork Wed Apr 26 16:19:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Bulekov X-Patchwork-Id: 13224748 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 A868EC77B78 for ; Wed, 26 Apr 2023 16:21:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prht5-0000qw-Bp; Wed, 26 Apr 2023 12:21:00 -0400 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 1prht1-0000pu-3i for qemu-devel@nongnu.org; Wed, 26 Apr 2023 12:20:55 -0400 Received: from esa13.hc2706-39.iphmx.com ([216.71.137.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prhsy-0005pS-Jn for qemu-devel@nongnu.org; Wed, 26 Apr 2023 12:20:54 -0400 X-IronPort-RemoteIP: 209.85.222.197 X-IronPort-MID: 274887218 X-IronPort-Reputation: None X-IronPort-Listener: OutgoingMail X-IronPort-SenderGroup: RELAY_GSUITE X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:s32PR6BEe7p8rBVW/5Dhw5YqxClBgxIJ4kV8jS/XYbTApDh33zwDx mUeDDuFPv6KNGKkf9wiOom09EgH6J7Rn4BkTANkpHpgcSl2pJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH2dOCn9SImvU2xbuKUIPbePSxsThNTRi4kiBZy88Y0mYctitWia++3k YqaT/b3ZRn0ilaYDkpOs/jY8E814qyo0N8llgdWic5j7Qe2e0Y9Ucp3yZGZdxPQXoRSF+imc OfPpJnRErTxpkpF5nuNy94XQ2VTKlLgFVHmZkl+AsBOtiN/Shkaic7XAha9hXB/0F1ll/gpo DlEWAfZpQ0BZ8Ugk8xEO/VU/r0X0QSrN9YrLFDm2fF/wXEqfFPj39VKFWcYF7YF2c9QP3weq sEWAw4kO0Xra+KemNpXS8Fpj8UnadDoZcYR4yA/iz7eCvkiTNbIRKCiCd1whm9hwJATW6yEP YxAOGUHgBfoOnWjPn8eDII4kP2AjGS5fjFFwL6QjfBovziDk1YogNABNvLSQp+YV+8IgH2Gt 1vE0lTeKDo2M/m2nG/tHnWEw7WncTnAcJsfEaD9+vN0jVm7wGsVBxsLE1yhrpGEZlWWXtteL wkN+XNro/FjqwqkSd7yWxD+q3mB1vIBZ+dt/yQBwFnl4sLpD8yxVjhsouJpADD+iPILeA== IronPort-HdrOrdr: A9a23:VfV79qOYir+728BcTv+jsMiBIKoaSvp037BL7TEVdfUxSKalfq +V8sjzpSWYtN9vYgBZpTntAsm9qArnhOdICOoqTNWftWvd11dARbsKheCP/9SKIUzDH4BmpM RdmxYSMqyVMbDH4PyKhjVRrLsbsb66zJw= X-Talos-CUID: 9a23:felHj2DPrRD65Bj6EyZ71GoNPO4PSWD+5VDuPh/nNGhCdpTAHA== X-Talos-MUID: 9a23:FdQ9YgRtX0mrjolKRXTrvHJwJu01/Z+wGXkPvKUhkeKoMglZbmI= Received: from mail-qk1-f197.google.com ([209.85.222.197]) by ob1.hc2706-39.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 26 Apr 2023 12:20:28 -0400 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-74dfe945c74so480491985a.3 for ; Wed, 26 Apr 2023 09:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bu.edu; s=s1gsbu; t=1682526026; x=1685118026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=68oaiYGL7UhG3W5jva6oSZ0GIeZDrcn2k6P7uHwGxlY=; b=GPwkKqfMeRvTFAZrgPKv8bMlXpyYlBayJKhJzqHG5BIK6OrTDro8JzVteKvvXlbHlt EB1n295qx5imnztk8ou4Fs8FjAciy1VcAZ0QKbqM9ylsYRwHRoTEA/LrN4gKPtbWJzyS /AAyO8lrDZXNWjv7e5HfeEHZK+fAGyxkYLRi1z+CX1nSRs3mxHrce6l6ojymGhFJbJE5 m+xi9uE85yrD8cOvUGr4Rl1ZY2KwfLFIqzUM5Y4moyGWbwqU/L4CZXXOnxd019jCQUpJ Xq1YccGNS8kFpEWQEfu3fvzbX/FdpGPqsGl2XcGCl25+Z9EOtAdUWUuXR53XumLyaLUa Hi6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682526026; x=1685118026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=68oaiYGL7UhG3W5jva6oSZ0GIeZDrcn2k6P7uHwGxlY=; b=fVyZSzRvkZAw5RXr3e+udrMgglTgxZMdhtQT1L5mLz37Sn+IO5M42rz9sP7i/wy8qn euGCYjTlqp/xSqGrZeG+N2UZosUGJ4DfS/Gw5A4ehwVdXEmmY35UmCmkhcyNxtxtdEIl Ri1/tXjC+92lhOU31/58pv3eTOyPfqjcn5xxTGgvMqssGYDNJL9j4jKJymdstpv8yL8+ TuhzNoOpi4FjL8gDk06n1YPCTxTC/V2l50bvd/BkG/iLGUA+KE1tmu4zwyHwQMkJgTz5 qBeDKr/Krrs/FW0mmT1jVNgG+GdiEVgmQiFo9qY7nvHrzz8QokoSM3fd33L9Pn9hGw/r ZItQ== X-Gm-Message-State: AAQBX9dARgfI99DZlmTQgBkNdqTECQUlwa6ibAVMspI564CSKNzyNq6t gZqriAOt1wNsVb2W3K0NIkwdnHITfbjccIZQ6qaIqKRlEaBPA3jQF+KGB78bWi442CT9ShKWhCs gEim1IWy1168y9SI3KoaENgqBKfjBx6g7FYbFIpGW62M= X-Received: by 2002:a05:622a:170b:b0:3ef:2fbd:90ba with SMTP id h11-20020a05622a170b00b003ef2fbd90bamr36987139qtk.43.1682526026314; Wed, 26 Apr 2023 09:20:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZQ8VKoo+uzlCju2hLXsNgUukt/YuhPXMH+1U2lg+TgXrBGRCGZoz4tHhYIZMqzVz3YbCwMlg== X-Received: by 2002:a05:622a:170b:b0:3ef:2fbd:90ba with SMTP id h11-20020a05622a170b00b003ef2fbd90bamr36987110qtk.43.1682526026089; Wed, 26 Apr 2023 09:20:26 -0700 (PDT) Received: from mozz.bu.edu (mozz.bu.edu. [128.197.127.33]) by smtp.gmail.com with ESMTPSA id l13-20020a05622a050d00b003ef38277445sm5432332qtx.16.2023.04.26.09.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 09:20:25 -0700 (PDT) From: Alexander Bulekov To: qemu-devel@nongnu.org Cc: Alexander Bulekov , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mauro Matteo Cascella , Peter Xu , Jason Wang , David Hildenbrand , Gerd Hoffmann , Thomas Huth , Laurent Vivier , Bandan Das , "Edgar E . Iglesias" , Darren Kenny , Bin Meng , Paolo Bonzini , "Michael S . Tsirkin" , Marcel Apfelbaum , =?utf-8?q?Daniel_P_=2E_Berra?= =?utf-8?q?ng=C3=A9?= , Eduardo Habkost , Jon Maloy , Siqi Chen , Michael Tokarev , =?utf-8?q?Herv=C3=A9_Poussineau?= , qemu-ppc@nongnu.org (open list:PReP) Subject: [PATCH v9 8/8] raven: disable reentrancy detection for iomem Date: Wed, 26 Apr 2023 12:19:51 -0400 Message-Id: <20230426161951.2948996-9-alxndr@bu.edu> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230426161951.2948996-1-alxndr@bu.edu> References: <20230426161951.2948996-1-alxndr@bu.edu> MIME-Version: 1.0 X-CES-GSUITE_AUTH: bf3aNvsZpxl8 Received-SPF: pass client-ip=216.71.137.83; envelope-from=alxndr@bu.edu; helo=esa13.hc2706-39.iphmx.com X-Spam_score_int: -7 X-Spam_score: -0.8 X-Spam_bar: / X-Spam_report: (-0.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HK_RANDOM_ENVFROM=0.266, HK_RANDOM_FROM=0.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org As the code is designed for re-entrant calls from raven_io_ops to pci-conf, mark raven_io_ops as reentrancy-safe. Signed-off-by: Alexander Bulekov Reviewed-by: Thomas Huth --- hw/pci-host/raven.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 072ffe3c5e..9a11ac4b2b 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -294,6 +294,13 @@ static void raven_pcihost_initfn(Object *obj) memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000); address_space_init(&s->pci_io_as, &s->pci_io, "raven-io"); + /* + * Raven's raven_io_ops use the address-space API to access pci-conf-idx + * (which is also owned by the raven device). As such, mark the + * pci_io_non_contiguous as re-entrancy safe. + */ + s->pci_io_non_contiguous.disable_reentrancy_guard = true; + /* CPU address space */ memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, &s->pci_io);