From nobody Sun Dec 22 02:19:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1727195226; cv=none; d=zohomail.com; s=zohoarc; b=Yp+5hDtO5yF91wzKtlNh4FvMXbYgJPiyetRm1tPlWq6PoTSz7g1AnN6HZ4Ohw7/cuiWo/6lyIuAvLJi7JuUdZZ3K6eWo4NMgKqO6yzD2vD41NHJgAq0871EN8e3ckcdfy0MDR99HrjyLPMgAZt3ZvhGzq519airjbW675SZQN4A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1727195226; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GLI4kKkgQKzQsFANk7z1TUU4nn0G0MAxu+0mTyaXmA8=; b=jzcKq2P+ToPtIEfT10jTUiWKq88ETNnh1YBdD3MjO2UBhiIlejWlgF/Zs0qn6X9SotAqikvDwHQerE0IntGGIee22pIpxZ0La+X7Z4eW0Jlnfx6OZMhOffrod/mkW+HiDJWlppohEzkCYkqEHDhFcFyTQ4iAvg8bKLZOfKU0adU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1727195226814135.9120791387952; Tue, 24 Sep 2024 09:27:06 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.803139.1213579 (Exim 4.92) (envelope-from ) id 1st8NG-0001E5-UK; Tue, 24 Sep 2024 16:26:50 +0000 Received: by outflank-mailman (output) from mailman id 803139.1213579; Tue, 24 Sep 2024 16:26:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8NG-0001Dy-QB; Tue, 24 Sep 2024 16:26:50 +0000 Received: by outflank-mailman (input) for mailman id 803139; Tue, 24 Sep 2024 16:26:50 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1st8LK-0005nz-MG for xen-devel@lists.xenproject.org; Tue, 24 Sep 2024 16:24:50 +0000 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [2607:f8b0:4864:20::b2d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 83bfcb5a-7a91-11ef-99a2-01e77a169b0f; Tue, 24 Sep 2024 18:24:47 +0200 (CEST) Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-e02c4983bfaso5148974276.2 for ; Tue, 24 Sep 2024 09:24:47 -0700 (PDT) Received: from gmail.com ([168.243.189.171]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-505a9efb4a3sm1023237e0c.3.2024.09.24.09.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:24:45 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 83bfcb5a-7a91-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727195085; x=1727799885; darn=lists.xenproject.org; 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=GLI4kKkgQKzQsFANk7z1TUU4nn0G0MAxu+0mTyaXmA8=; b=XrZn8pxFj/bTqPZk72wgMp6TvsE3r0zT/QoI/IG+ggrJEY0MSXaLLriF4/9vAxX6Qc YDqbikn7E5iYyOfJW5FKajz2Sl5K7N6oKzFFO7BemlxmsdrQ9D/DzhSW5slMTZe0M20i IZScQ2BcD0dKhb8M9SwD5/YPR4rqDh+jb/ncdiKYVQ6IGlt7Htpp9xfsQXsx+hNLA6GD hanvZRfOpxlJrBvrSEjasqlfEDn1+fzFZ8xr/hwg0rspVFU1/VTAMPHJH1KHOTSzWj5t A0HHCq7mnummuVYS4kelF+ga/pNZqZIfkNfHx1Hy8WwjpQViDGPIxHY0/uppV25+Fq+m RGJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727195085; x=1727799885; 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=GLI4kKkgQKzQsFANk7z1TUU4nn0G0MAxu+0mTyaXmA8=; b=Sbps4xGhoelGpCq8dA8aboUTwWqsV2B2HhpRisZC5Qq4/rPDPqHrs9beEp58ouv8o1 a9BVkMKCE0BzaiHdKM4L8H3wyU8gLoau4yGPmBOkTUQ19+bDiAWOVqgRYVOUsEMsnEO5 NtBouRvPRyt/e4qAqoaLNXRph6UCbOArnmneHzoSjKay3sKGxtYyvuHnfbuGJ6ybT06x FPJA+rOVnCVZuswr402DSUx5aR+LSmmqe0GFbRQ4oOt79TfviWGZdDAApPJa9sgC5eIj PMZIMNyBN0x0yZAKpKPCuJYxvC73tnqxwdEO4fxvNjtUcZNGbzY80qCPW3TZI9GqGiEY 6LDw== X-Gm-Message-State: AOJu0YzVEPXSlLRsUyB5m94rvSOVBHWQ/oCJKrQmUZYLS6k9O5Z88e4L MkzOU2LjxkaQPZ9K/+30+nBv97IIAVn5LHhQ98HMIaLXLMvAugDW6AVtZO8o X-Google-Smtp-Source: AGHT+IEYLv6/HzhBlE9NW/AuH+xm6fvDwlR+mdLkGxpus9cOgrYa/DTirHn+Hjd+Cm6b8Ug3fPZB6g== X-Received: by 2002:a25:d856:0:b0:e22:5db2:a947 with SMTP id 3f1490d57ef6-e225db2aa8emr7938369276.34.1727195085555; Tue, 24 Sep 2024 09:24:45 -0700 (PDT) From: "Edgar E. Iglesias" To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, julien@xen.org, bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com, dpsmith@apertussolutions.com, edgar.iglesias@amd.com Subject: [PATCH v1 6/6] xen/arm: dom0less: Add a background PCI ECAM mmio region Date: Tue, 24 Sep 2024 18:23:59 +0200 Message-ID: <20240924162359.1390487-7-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240924162359.1390487-1-edgar.iglesias@gmail.com> References: <20240924162359.1390487-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1727195228924116600 Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Add a background PCI ECAM mmio region always reading as all ones. This indicates to the OS that there are no PCI devices on the bus. Once the device-model's IOREQ client connects, the OS can rescan the bus and find PV and emulated devices. This avoids a race where domU's come up before the device models, causing domU to crash into a data-abort when accessing ECAM. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- xen/arch/arm/dom0less-build.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c index dab24fa9e2..bc5285e7fa 100644 --- a/xen/arch/arm/dom0less-build.c +++ b/xen/arch/arm/dom0less-build.c @@ -1015,6 +1015,16 @@ static int __init construct_domU(struct domain *d, kinfo.virtio_pci.mem.base =3D GUEST_VIRTIO_PCI_MEM_BASE; kinfo.virtio_pci.pf_mem.base =3D GUEST_VIRTIO_PCI_PREFETCH_MEM= _BASE; } + + /* + * Register a background PCI ECAM region returning ~0. This indica= tes + * to the OS that there are no PCI devices on the bus. Once an IOR= EQ + * client connects, the OS can rescan the bus and find devices. + */ + register_mmio_bg_handler(d, true, &mmio_read_const_writes_ignored, + kinfo.virtio_pci.ecam.base, + GUEST_VIRTIO_PCI_ECAM_SIZE, + (void *) ULONG_MAX); } =20 rc =3D dt_property_read_string(node, "xen,enhanced", &dom0less_enhance= d); --=20 2.43.0