From nobody Fri May 3 05:12: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=quarantine dis=none) header.from=me.com ARC-Seal: i=1; a=rsa-sha256; t=1623619049; cv=none; d=zohomail.com; s=zohoarc; b=YqC1KPs0AjwBra4klzjBnRbDQeN/uVbXHWE8lATEpbVMCKWvOgu5QDq3WU27zN4xmW9sw4BALBODTu5ObV2g0zZPJ9L9bpSlrungDVprFXKhyR36qvDR4xBhNspCo7K9XMXAPSZChwnTWjVb+kn14XehiKMgt/hkDWhy0MNTIFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623619049; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gkzEzR9JMEx0r3GztDkbytTr1BhXloZjlUExOBrQRNg=; b=NNozeSIlU8+2nUzvW7p4s+03WJxJJc8W8BzZ3brW7w0O6bFIdbuAKL1ESXGjhN1MgbzgByGuGvqzKSD5uFF82SMfJB5nD654A628VB+n3dNpAtxBn7BZymjoy33ydcfSOLrqiaZPMQWZrmCAVvl+IGBrxIwMGuuNpbDxf40F6nc= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623619049240207.01389901033485; Sun, 13 Jun 2021 14:17:29 -0700 (PDT) Received: from localhost ([::1]:48348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsXTz-0006tZ-Vl for importer@patchew.org; Sun, 13 Jun 2021 17:17:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXT2-0005Kj-HA for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:28 -0400 Received: from mr85p00im-ztdg06021101.me.com ([17.58.23.180]:54940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXT1-0001KP-1a for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:28 -0400 Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06021101.me.com (Postfix) with ESMTPSA id 8CAB5340267; Sun, 13 Jun 2021 21:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1623618986; bh=gkzEzR9JMEx0r3GztDkbytTr1BhXloZjlUExOBrQRNg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=VDLP3reFWo+7l+Ghhj54kZsnUx2S2TIn9nv2q5ZWZYNapJWj1FMMWthNWHM6vZuqy QQIaLmjexjSiveISXUqjG5JLghFilNebLIIZ5hNxhQJrclnEY13KlX2HbIdTtxolmy WxJhpeqwuTrjDvlA5JtaxgH4Rmvj/W/D8o+WRlXiAu93XPxK7/F+M844LNd4f3uOis 3K9qOcWRC0Vgq4GTPUVSOocq2ilDOei3QjEoKsTqMQPPjnKU7Ltc49lSlkm8efbSRQ xthQlupadGJEcksvdlgtoYr+hicdL5Jqgsbp7SA/CoC6uyH2QxdGVDvhQfpigPZyeE y9DjmCQmGAIRQ== From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe , richard.henderson@linaro.org Subject: [PATCH 1/4] mc146818rtc: Make PF independent of PIE Date: Sun, 13 Jun 2021 14:15:46 -0700 Message-Id: <20210613211549.18094-2-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210613211549.18094-1-thorpej@me.com> References: <20210613211549.18094-1-thorpej@me.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.391,18.0.761,17.0.607.475.0000000_definitions?= =?UTF-8?Q?=3D2021-06-13=5F09:2021-06-11=5F06,2021-06-13=5F09,2020-04-07?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=625 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106130151 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=17.58.23.180; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06021101.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 @me.com) Content-Type: text/plain; charset="utf-8" Make the PF flag behave like real hardware by always running the periodic timer without regard to the setting of the PIE bit, so that the PF will be set when the period expires even if an interrupt will not be raised. This behavior is documented on page 16 of the MC146818A advance information datasheet. Signed-off-by: Jason Thorpe --- hw/rtc/mc146818rtc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index 4fbafddb22..366b8f13de 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -155,10 +155,6 @@ static uint32_t rtc_periodic_clock_ticks(RTCState *s) { int period_code; =20 - if (!(s->cmos_data[RTC_REG_B] & REG_B_PIE)) { - return 0; - } - period_code =3D s->cmos_data[RTC_REG_A] & 0x0f; =20 return periodic_period_to_clock(period_code); --=20 2.30.2 From nobody Fri May 3 05:12: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=quarantine dis=none) header.from=me.com ARC-Seal: i=1; a=rsa-sha256; t=1623619140; cv=none; d=zohomail.com; s=zohoarc; b=Pu4jRCJHPTiKQskfFjHGXIU3Zqm9AGeAuvtaP7PXm6L4cRE8VZLqyOq8AaKvIX5HdNHNVJG8xCVHwnj6gp1kS3XWM1aFaYZNZhSpkymd6VS6kZVv7L4+klH7ygIYhNjRrhazgZF4DS+maRhOFgZcZpkUIx64wX9+TD9Ha5SaKSU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623619140; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SYeyreoJ2Lw38+CIeH/PXgqofHJhNw7AEVREYG0+pfo=; b=R0M4rKWQj40FbhWXyNO+AWpp20+1oLmseqHbEqj07CweiSguhm5FzWaaaD5ykvqDffmDL97EauQtQkIJDdTSa9nKiw+HrMVTcvNpJXiiQnK0iiDk8pzXQ+dDu1J5F74DSlbIk5l2y+gwfSFPPULT7x9vVBC25vyC4MATjz4PTZY= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623619140228965.8984072709449; Sun, 13 Jun 2021 14:19:00 -0700 (PDT) Received: from localhost ([::1]:52650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsXVT-0001KU-4g for importer@patchew.org; Sun, 13 Jun 2021 17:18:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXT7-0005cB-Mb for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:33 -0400 Received: from mr85p00im-ztdg06021101.me.com ([17.58.23.180]:55117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXT6-0001R4-3w for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:33 -0400 Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06021101.me.com (Postfix) with ESMTPSA id B625E340545; Sun, 13 Jun 2021 21:16:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1623618991; bh=SYeyreoJ2Lw38+CIeH/PXgqofHJhNw7AEVREYG0+pfo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=IcU7sJnPlsAfNKDh1BQo2Bw6NVaZmIdC4MPPVA3RzCy7WKxUohL+f/TojmV/m61ES aHU3cUUouofdJMN1MygGpk/r6CmdKvoA+P5S4GbL0+SQI23/AJ1Xbw9Loc7GmOQoJn RjBHvCGqRGWqH+LuL9WVnKbqm3sR0Vzir6Ey+pt+QU3nPYpb0DikH4HQOQz80vCdTN S0DJmMJqVV80VPQ0NL9xbhMfbGcn7JdPttxv/Q3yaRih4esA+uXD6WhazkuDGjsFIL Rl5sStCOnoh0qGiPIGCWvCW9tsyetBkehXW5pV0aAW3OfcpaKRGOU3haY6/rX88nN5 uDvJ20onJI/6g== From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe , richard.henderson@linaro.org Subject: [PATCH 2/4] alpha: Set minimum PCI device ID to 1 to match Clipper IRQ mappings. Date: Sun, 13 Jun 2021 14:15:47 -0700 Message-Id: <20210613211549.18094-3-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210613211549.18094-1-thorpej@me.com> References: <20210613211549.18094-1-thorpej@me.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.391,18.0.761,17.0.607.475.0000000_definitions?= =?UTF-8?Q?=3D2021-06-13=5F09:2021-06-11=5F06,2021-06-13=5F09,2020-04-07?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106130151 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=17.58.23.180; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06021101.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 @me.com) Content-Type: text/plain; charset="utf-8" Since we are emulating a Clipper device topology, we need to set the minimum PCI device ID to 1, as there is no IRQ mapping for a device at ID 0 (see sys_dp264.c:clipper_map_irq()). - Add a 'devfn_min' argument to typhoon_init(). Pass that argument along to pci_register_root_bus(). - In clipper_init(), pass PCI_DEVFN(1, 0) as the minimum PCI device ID/function. Signed-off-by: Jason Thorpe --- hw/alpha/alpha_sys.h | 2 +- hw/alpha/dp264.c | 5 +++-- hw/alpha/typhoon.c | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/alpha/alpha_sys.h b/hw/alpha/alpha_sys.h index e2c02e2bbe..4835b3d5ee 100644 --- a/hw/alpha/alpha_sys.h +++ b/hw/alpha/alpha_sys.h @@ -11,7 +11,7 @@ =20 =20 PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4], - pci_map_irq_fn); + pci_map_irq_fn, uint8_t devfn_min); =20 /* alpha_pci.c. */ extern const MemoryRegionOps alpha_pci_ignore_ops; diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 1017ecf330..ac97104464 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -76,9 +76,10 @@ static void clipper_init(MachineState *machine) cpus[0]->env.trap_arg1 =3D 0; cpus[0]->env.trap_arg2 =3D smp_cpus; =20 - /* Init the chipset. */ + /* Init the chipset. Because we're using CLIPPER IRQ mappings, + the minimum PCI device IdSel is 1. */ pci_bus =3D typhoon_init(machine->ram, &isa_bus, &rtc_irq, cpus, - clipper_pci_map_irq); + clipper_pci_map_irq, PCI_DEVFN(1, 0)); =20 /* Since we have an SRM-compatible PALcode, use the SRM epoch. */ mc146818_rtc_init(isa_bus, 1900, rtc_irq); diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 87020cbe0d..fa31a2f286 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -815,7 +815,8 @@ static void typhoon_alarm_timer(void *opaque) } =20 PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bus, qemu_irq *p_rtc_= irq, - AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq) + AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq, + uint8_t devfn_min) { MemoryRegion *addr_space =3D get_system_memory(); DeviceState *dev; @@ -885,7 +886,7 @@ PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_bu= s, qemu_irq *p_rtc_irq, b =3D pci_register_root_bus(dev, "pci", typhoon_set_irq, sys_map_irq, s, &s->pchip.reg_mem, &s->pchip.reg_io, - 0, 64, TYPE_PCI_BUS); + devfn_min, 64, TYPE_PCI_BUS); phb->bus =3D b; sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); =20 --=20 2.30.2 From nobody Fri May 3 05:12: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=quarantine dis=none) header.from=me.com ARC-Seal: i=1; a=rsa-sha256; t=1623619136; cv=none; d=zohomail.com; s=zohoarc; b=cCQURvUmFKkAb3vakIEmBQ8qntrYXaMl9izYjdaqWGiG/9NaN5gUfq24plwNQl7ekEXZoSiwgOZHLMYnvfLRyuO6k33VerlBjg1jGzMjpcfS8bh63vbsVpTggGiaCNomdJ5RW6gGkW5AR84z3T/+DVbp8JN2aah/m6lCnTOAmQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623619136; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Y20/OnA1InddzQnxJH5sFn3MzAD/qYzwhMkzYe+90t4=; b=RjsVP55pZgCYlr0DRSZzfNJGgqcakwO1rle3EBHCwhYB3puTnR7o20Xl2+sImg5WaEUl4wMg7H73psyCD+THIE+hVV2pHMf2gFTB1fTpDWJlCGQHlIadU8KriJ1gRHPUBQPdj2kj9XCWdSuLkkRmlSKj1EGaBHRDyVCZfJvJs4w= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623619136730875.3445311726344; Sun, 13 Jun 2021 14:18:56 -0700 (PDT) Received: from localhost ([::1]:52364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsXVO-00018i-Ow for importer@patchew.org; Sun, 13 Jun 2021 17:18:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXTA-0005np-Mw for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:36 -0400 Received: from mr85p00im-ztdg06021101.me.com ([17.58.23.180]:55210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXT8-0001SR-IE for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:36 -0400 Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06021101.me.com (Postfix) with ESMTPSA id EFCEE340137; Sun, 13 Jun 2021 21:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1623618993; bh=Y20/OnA1InddzQnxJH5sFn3MzAD/qYzwhMkzYe+90t4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=GXEL8YNL1D0tH8nbaqAGz991VDRFemY+TPjcAgGhfwFExoMeKdxThsWkFXR1qLqrv 6ifPiFm5p4BsUnXJjw5hTemIfKA7Fzd8Zx71dOxYJ7xa8m9/X0rL9mvl1UnGLy85Yz npgCdQWGguoSrlf3nazKJNtUtmt+gObKjfq+to/gPm5d5LN7fEekDHWzTekCuq6ojp jBU1n6ogX4qFd+a6rIQRZdMPAJ/3a2WoB21tDZ8DhhrA1OO8ExlzuakywxLbEeB/bg wW+KT4MRDK8kC6d59JgzvmCKtpocMJ23vLUNHV6PAH5zEt/AlPcGoBK7lkjbuhew/s 22bYiwdNviYRQ== From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe , richard.henderson@linaro.org Subject: [PATCH 3/4] alpha: Provide a PCI-ISA bridge device node for guest OS's that expect it Date: Sun, 13 Jun 2021 14:15:48 -0700 Message-Id: <20210613211549.18094-4-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210613211549.18094-1-thorpej@me.com> References: <20210613211549.18094-1-thorpej@me.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.391,18.0.761,17.0.607.475.0000000_definitions?= =?UTF-8?Q?=3D2021-06-13=5F09:2021-06-11=5F06,2021-06-13=5F09,2020-04-07?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106130151 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=17.58.23.180; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06021101.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 @me.com) Content-Type: text/plain; charset="utf-8" Provide a PCI device node at ID 7 for the PCI-ISA bridge. Even though Tsunami/Typhoon systems would have used a different chip (Cypress or ALI), for simplicity we model the Intel i82378, which was also used on several Alpha models. This is needed for some operating systems that only probe ISA devices if a PCI-ISA or PCI-EISA bridge is found. Signed-off-by: Jason Thorpe --- hw/alpha/typhoon.c | 111 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index fa31a2f286..de01828d23 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -919,11 +919,32 @@ PCIBus *typhoon_init(MemoryRegion *ram, ISABus **isa_= bus, qemu_irq *p_rtc_irq, /* Pchip1 PCI I/O, 0x802.FC00.0000, 32MB. */ /* Pchip1 PCI configuration, 0x802.FE00.0000, 16MB. */ =20 - /* Init the ISA bus. */ - /* ??? Technically there should be a cy82c693ub pci-isa bridge. */ + /* Init the PCI-ISA bridge. Technically, PCI-based Alphas shipped + with one of three different PCI-ISA bridges: + + - Intel i82378 SIO + - Cypress CY82c693UB + - ALI M1533 + + (An Intel i82375 PCI-EISA bridge was also used on some models.) + + For simplicity, we model an i82378 here, even though it wouldn't + have been on any Tsunami/Typhoon systems; it's close enough, and + we don't want to deal with modelling the CY82c693UB (which has + incompatible edge/level control registers, plus other peripherals + like IDE and USB) or the M1533 (which also has IDE and USB). + + Importantly, we need to provide a PCI device node for it, otherwise + some operating systems won't notice there's an ISA bus to configure. + + ??? We are using a private, stripped-down implementation of i82378 + so that we can handle the way the ISA interrupts are wired up on + Tsunami/Typhoon systems. */ { qemu_irq *isa_irqs; =20 + pci_create_simple(b, PCI_DEVFN(7, 0), "i82378-typhoon"); + *isa_bus =3D isa_bus_new(NULL, get_system_memory(), &s->pchip.reg_= io, &error_abort); isa_irqs =3D i8259_init(*isa_bus, @@ -954,10 +975,96 @@ static const TypeInfo typhoon_iommu_memory_region_inf= o =3D { .class_init =3D typhoon_iommu_memory_region_class_init, }; =20 +/* The following was copied from hw/isa/i82378.c and modified to provide + only the minimal PCI device node. */ + +/* + * QEMU Intel i82378 emulation (PCI to ISA bridge) + * + * Copyright (c) 2010-2011 Herv\xc3\xa9 Poussineau + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#include "migration/vmstate.h" + +#define TYPE_I82378 "i82378-typhoon" +#define I82378(obj) \ + OBJECT_CHECK(I82378State, (obj), TYPE_I82378) + +typedef struct I82378State { + PCIDevice parent_obj; +} I82378State; + +static const VMStateDescription vmstate_i82378 =3D { + .name =3D "pci-i82378-typhoon", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj, I82378State), + VMSTATE_END_OF_LIST() + }, +}; + +static void i82378_realize(PCIDevice *pci, Error **errp) +{ + uint8_t *pci_conf; + + pci_conf =3D pci->config; + pci_set_word(pci_conf + PCI_COMMAND, + PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); + pci_set_word(pci_conf + PCI_STATUS, + PCI_STATUS_DEVSEL_MEDIUM); + + pci_config_set_interrupt_pin(pci_conf, 1); /* interrupt pin 0 */ +} + +static void i82378_init(Object *obj) +{ +} + +static void i82378_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + DeviceClass *dc =3D DEVICE_CLASS(klass); + + k->realize =3D i82378_realize; + k->vendor_id =3D PCI_VENDOR_ID_INTEL; + k->device_id =3D PCI_DEVICE_ID_INTEL_82378; + k->revision =3D 0x03; + k->class_id =3D PCI_CLASS_BRIDGE_ISA; + dc->vmsd =3D &vmstate_i82378; + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); +} + +static const TypeInfo i82378_typhoon_type_info =3D { + .name =3D TYPE_I82378, + .parent =3D TYPE_PCI_DEVICE, + .instance_size =3D sizeof(I82378State), + .instance_init =3D i82378_init, + .class_init =3D i82378_class_init, + .interfaces =3D (InterfaceInfo[]) { + { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { }, + }, +}; + static void typhoon_register_types(void) { type_register_static(&typhoon_pcihost_info); type_register_static(&typhoon_iommu_memory_region_info); + type_register_static(&i82378_typhoon_type_info); } =20 type_init(typhoon_register_types) --=20 2.30.2 From nobody Fri May 3 05:12: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=quarantine dis=none) header.from=me.com ARC-Seal: i=1; a=rsa-sha256; t=1623619237; cv=none; d=zohomail.com; s=zohoarc; b=jVxDViLOESUiKLT7Ac29F3ck3utT1rXAgAQRCiHX4KRQjzaiAJWzo7s4GcklEN8V4KfOz0yvC82lD7aiEzSEnArJKMZtMjpd7SJ43Y2tzkRjJiuQ0x6BqL8aJhcSlvItfS63UdnPxM3bChZbOH6pqAw6YV6ZIwHNN9wPJRpYf1E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623619237; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CgFw72sanBOxSD07n3HOr1OZZb8QvrliCMzV2AN+9Kc=; b=i9RaIkxSm7Bi/nRNsvwR+ZGap006ywYYCnogxkL8xDUmbvVm3tG+XWysvV70TXsMGZRkSYkAyGUxZiRgiCmj2PvHjSBPTg8QxYXw9IbEqGJ27tUDBIcBhkOc17s+FsngWe5cwPAE0zGtvh9AKp7HnmCl0LCWMAgvuTIsnbKg50A= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623619237260728.3181120477043; Sun, 13 Jun 2021 14:20:37 -0700 (PDT) Received: from localhost ([::1]:56482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsXX2-0003w6-9G for importer@patchew.org; Sun, 13 Jun 2021 17:20:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXTE-0005ru-0L for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:40 -0400 Received: from mr85p00im-ztdg06021101.me.com ([17.58.23.180]:55288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsXTA-0001U9-W1 for qemu-devel@nongnu.org; Sun, 13 Jun 2021 17:16:39 -0400 Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06021101.me.com (Postfix) with ESMTPSA id 95BA33404D3; Sun, 13 Jun 2021 21:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1623618996; bh=CgFw72sanBOxSD07n3HOr1OZZb8QvrliCMzV2AN+9Kc=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=l3y37dnkcnWxRiH7QRGMMVf97ZA9A0kia+ncK3AOjqae84Cu6NvFWlVaG5Ey2hvDf NStIGMpeCjVnxBWFKTe5VFhB0vKBBtDKJgUrYUE6OE9TFIkyUk22a6N5Jg+cymvozY DqZEgctwm7cXbwWOb7yeN9izBqwy6rQfZQxUbSRDGtzucLl07asvGySqcolh4tx2ET ZvMVpLcc39Io4Nq3m5L4823YAOZrakjz7HUpOaReg1Gp58GJADv1MHUgsy33HX5kGg UB7oj8aZLcn9AOBUBf6zv2Noe0Q7acEIilrXqRh1A4k9aPMINfKl7IOcA0q+4MT/Eo kRIzQZQu5VWAg== From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe , richard.henderson@linaro.org Subject: [PATCH 4/4] alpha: Provide console information to the PALcode at start-up. Date: Sun, 13 Jun 2021 14:15:49 -0700 Message-Id: <20210613211549.18094-5-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210613211549.18094-1-thorpej@me.com> References: <20210613211549.18094-1-thorpej@me.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.391,18.0.761,17.0.607.475.0000000_definitions?= =?UTF-8?Q?=3D2021-06-13=5F09:2021-06-11=5F06,2021-06-13=5F09,2020-04-07?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 mlxlogscore=792 mlxscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106130151 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=17.58.23.180; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06021101.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 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 @me.com) Content-Type: text/plain; charset="utf-8" Redefine the a2 register passed by Qemu at start-up to also include some configuration flags, in addition to the CPU count, and define a flag to mirror the "-nographics" option. Signed-off-by: Jason Thorpe --- hw/alpha/dp264.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index ac97104464..d86dcb1d81 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -72,9 +72,20 @@ static void clipper_init(MachineState *machine) cpus[i] =3D ALPHA_CPU(cpu_create(machine->cpu_type)); } =20 + /* arg0 -> memory size + arg1 -> kernel entry point + arg2 -> config word + + Config word: bits 0-5 -> ncpus + bit 6 -> nographics option (for HWRPB CTB) + + See init_hwrpb() in the PALcode. */ + cpus[0]->env.trap_arg0 =3D ram_size; cpus[0]->env.trap_arg1 =3D 0; cpus[0]->env.trap_arg2 =3D smp_cpus; + if (!machine->enable_graphics) + cpus[0]->env.trap_arg2 |=3D (1 << 6); =20 /* Init the chipset. Because we're using CLIPPER IRQ mappings, the minimum PCI device IdSel is 1. */ --=20 2.30.2