From patchwork Thu Jun 3 03:53:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=Vjpnaic0; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwX7z6C5Rz9sVb for ; Thu, 3 Jun 2021 13:54:06 +1000 (AEST) Received: from localhost ([::1]:41718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeQl-0008By-CA for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:54:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQM-0008Bi-Kt for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:38 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQK-0004TV-JO for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692414; bh=EbNMzVw3vepneA/DE3G4SKL1cFt4MHiKmcOsX+NpZNM=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Vjpnaic0qpvTTZsmx41Lf7zkrkNBcyKaK9u32LwcGudAdd7uN+/z4zDaOpW6Rjg19 jUffq3l2j26jfugwa5dgdNxRyOLssu4KYSxnIGNAie96AnRMWk9iVx3gC4JqhhlkGG cyhFQPuspjT7PpAVotzsmi8dCUrl0lTqbh83SqXihzU3HR6IYKhhEZdvBCOCRJuUGi /khwqaMmDyDYsX0MNvhdnE0gVK2JfPxsSScMNgJKHGyKjsw/15rvlzDw1mBjdqP8fQ r+RNHjsgdbBAhT2QWDWvCpWwgVuO18GhYTyFl+hKxBF1nyMIHbhFphY9CkiMfG4JZv 1cV5l3GCELzzQ== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 89F394A0101; Thu, 3 Jun 2021 03:53:33 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 1/8] Make qemu-palcode build environment standalone. NFC. Date: Wed, 2 Jun 2021 20:53:10 -0700 Message-Id: <20210603035317.6814-2-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Don't include system headers. Instead, provide standalone definitions and declarations of types needed and functions used by the PALcode that are compatible with the standard Alpha / GCC ABI. Signed-off-by: Jason Thorpe Reviewed-by: Richard Henderson --- init.c | 2 -- memcpy.c | 2 +- memset.c | 2 +- printf.c | 4 +--- protos.h | 30 +++++++++++++++++++++++++----- 5 files changed, 28 insertions(+), 12 deletions(-) diff --git a/init.c b/init.c index b53bab6..429a9ad 100644 --- a/init.c +++ b/init.c @@ -18,8 +18,6 @@ along with this program; see the file COPYING. If not see . */ -#include -#include #include "hwrpb.h" #include "osf.h" #include "ioport.h" diff --git a/memcpy.c b/memcpy.c index b6bbb74..9e1e913 100644 --- a/memcpy.c +++ b/memcpy.c @@ -8,7 +8,7 @@ * This is a reasonably optimized memcpy() routine. */ -#include +#include "protos.h" /* * Note that the C code is written to be optimized into good assembly. However, diff --git a/memset.c b/memset.c index e8481dc..f9b0a6d 100644 --- a/memset.c +++ b/memset.c @@ -19,7 +19,7 @@ . */ -#include +#include "protos.h" void *memset(void *optr, int ival, unsigned long size) { diff --git a/printf.c b/printf.c index 469b82c..0e1e128 100644 --- a/printf.c +++ b/printf.c @@ -18,10 +18,8 @@ along with this program; see the file COPYING. If not see . */ -#include -#include -#include #include "console.h" +#include "protos.h" static int print_buf_pad(char *buf, int buflen, char *p, int width, int pad) { diff --git a/protos.h b/protos.h index 3ed1381..0d90be8 100644 --- a/protos.h +++ b/protos.h @@ -21,11 +21,31 @@ #ifndef PROTOS_H #define PROTOS_H 1 -#include -#include -#include -#include - +/* Stand-alone definitions for various types, compatible with + the Alpha Linux ABI and GCC. This eliminates dependencies + on external headers. */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long uint64_t; +typedef unsigned long size_t; + +#define bool _Bool +#define true 1 +#define false 0 + +#define offsetof(type, member) __builtin_offsetof(type, member) + +typedef __builtin_va_list va_list; +#define va_start(ap, last) __builtin_va_start((ap), (last)) +#define va_arg __builtin_va_arg +#define va_end(ap) __builtin_va_end(ap) + +#define NULL ((void *)0) + +extern void *memset(void *, int, size_t); +extern void *memcpy(void *, const void *, size_t); +extern size_t strlen(const char *); /* * Call_Pal functions. From patchwork Thu Jun 3 03:53:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=GjjVLkgx; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwX7z70v1z9sW7 for ; Thu, 3 Jun 2021 13:54:07 +1000 (AEST) Received: from localhost ([::1]:41800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeQn-0008Fd-Jg for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQO-0008Ce-Hc for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:40 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49083) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQL-0004Ul-Pg for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692415; bh=6fuwTOnKe3pbhQJSv2OGto/xrzO5sDNh7V4OdjwtqrU=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=GjjVLkgx5e+maDveOF0m1mfyL4iGAuey8Xv/r4Zq+msGohZDpcZPsfDtYxvPMSqTJ n4Q/XlfWkq/eVxRoodgoFa/mzE3INW6ZRB8HPTEX0r7b20Yp+jkgPj7YoJjSEP0tFp 1vFSOLYsxxJ/5YJFgq8wi9dMv/pd9UghG/G7ReJ+QdD9mwvunmK3A3Snj8ftTl2qkT Drvbu9tUKwPVLUua6HgtjMIANdTnybxF5zrLSZ72KrQzIYC3zf8zmCCGVf4EEqTP+o 9+bcGARR/m+QuaGpSpxTiycMYlcpHeXHZbt8pHhGIhtx1SZ6eFeVpKSwqOi3eX/gXR g1vsyjNETb3Tg== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 263434A02ED; Thu, 3 Jun 2021 03:53:35 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 2/8] Fix delivery of unaligned access exceptions. Date: Wed, 2 Jun 2021 20:53:11 -0700 Message-Id: <20210603035317.6814-3-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=890 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" In the unaligned access exception vector, actually pass the return PC in the exception frame. This is required in order for unaligned access fixup handlers in the operating system to work. Signed-off-by: Jason Thorpe Reviewed-by: Richard Henderson --- pal.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pal.S b/pal.S index 64941a8..015a829 100644 --- a/pal.S +++ b/pal.S @@ -278,7 +278,7 @@ Pal_Unalign: blbs p6, MchkBugCheck addq p6, 4, p6 // increment past the faulting insn - STACK_FRAME p0, p1, p2, 1 + STACK_FRAME p0, p6, p2, 1 mfpr p0, ptEntUna mfpr $gp, ptKgp From patchwork Thu Jun 3 03:53:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=nbgawdWd; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwXBg3sHRz9sVb for ; Thu, 3 Jun 2021 13:56:27 +1000 (AEST) Received: from localhost ([::1]:49914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeT3-0005El-I0 for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:56:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQO-0008C9-AL for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:40 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQM-0004W1-D8 for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692417; bh=FAkF1k+wfmz9Tc1lkkvl9YzkzESvXUgL0M6Q3SDhe3M=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=nbgawdWdGmMu4zqEmZxvCZPeuQN9j7ZoTgO2Rb3C/8t1ltGBxO6GARQbm3a97Hmcc b+nX6eOftJBkxHqu6xtW//ChGXzaRvDUexG2vuWzZsVuQKGViYYU7d3WXbQQMVXo9F 4Shxe+g6ISzeZZea3plKcfzi7hP+xC6tC32fLybZV0gosIAnvAQOrySzsrMlef5BD+ TJ31Xx2hmkhwo3wCfZINsdumLBa6thMa2b8ITHfX73I+d8ajofhuO1rB3ZUJvIB1JT THEH6JhYyhHxCHrJTw6tD+v/KmNqcrC8/djK/BoUXhrexMVa8iGnbYsNsc/TL1zWBK wu4Jz2QMXSN6w== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 11BB24A02FA; Thu, 3 Jun 2021 03:53:37 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 3/8] Fix initialization of the hwrpb.hwrpb.cpuid field. Date: Wed, 2 Jun 2021 20:53:12 -0700 Message-Id: <20210603035317.6814-4-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Initialize the hwrpb.hwrpb.cpuid field with the primary CPU ID, not the processor type, as per the architecture specification. Some operating systems check and assert this. Improve a couple of comments. Signed-off-by: Jason Thorpe Reviewed-by: Richard Henderson --- init.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/init.c b/init.c index 429a9ad..b3919b6 100644 --- a/init.c +++ b/init.c @@ -141,6 +141,7 @@ init_hwrpb (unsigned long memsize, unsigned long cpus) unsigned long pal_pages; unsigned long amask; unsigned long i; + unsigned long proc_type = EV4_CPU; hwrpb.hwrpb.phys_addr = PA(&hwrpb); @@ -162,12 +163,12 @@ init_hwrpb (unsigned long memsize, unsigned long cpus) switch (__builtin_alpha_implver()) { case 0: /* EV4 */ - hwrpb.hwrpb.cpuid = EV4_CPU; + proc_type = EV4_CPU; hwrpb.hwrpb.max_asn = 63; break; case 1: /* EV5 */ - hwrpb.hwrpb.cpuid + proc_type = ((amask & 0x101) == 0x101 ? PCA56_CPU /* MAX+BWX */ : amask & 1 ? EV56_CPU /* BWX */ : EV5_CPU); @@ -175,11 +176,16 @@ init_hwrpb (unsigned long memsize, unsigned long cpus) break; case 2: /* EV6 */ - hwrpb.hwrpb.cpuid = (amask & 4 ? EV67_CPU : EV6_CPU); /* CIX */ + proc_type = (amask & 4 ? EV67_CPU : EV6_CPU); /* CIX */ hwrpb.hwrpb.max_asn = 255; break; } + /* This field is the WHAMI of the primary CPU. Just initialize + this to 0; CPU #0 is always the primary on real Alpha systems + (except for the TurboLaser). */ + hwrpb.hwrpb.cpuid = 0; + hwrpb.hwrpb.pagesize = PAGE_SIZE; hwrpb.hwrpb.pa_bits = 40; hwrpb.hwrpb.sys_type = SYS_TYPE; @@ -187,9 +193,18 @@ init_hwrpb (unsigned long memsize, unsigned long cpus) hwrpb.hwrpb.sys_revision = SYS_REVISION; for (i = 0; i < cpus; ++i) { - /* ??? Look up these bits. Snagging the value examined by the kernel. */ + /* Set the following PCS flags: + (bit 2) Processor Available + (bit 3) Processor Present + (bit 6) PALcode Valid + (bit 7) PALcode Memory Valid + (bit 8) PALcode Loaded + + ??? We really should be intializing the PALcode memory and + scratch space fields if we're setting PMV, or not set PMV, + but Linux checks for it, so... */ hwrpb.processor[i].flags = 0x1cc; - hwrpb.processor[i].type = hwrpb.hwrpb.cpuid; + hwrpb.processor[i].type = proc_type; } hwrpb.hwrpb.intr_freq = HZ * 4096; @@ -257,8 +272,8 @@ init_i8259 (void) outb(0x04, PORT_PIC1_DATA); /* ICW3: slave control INTC2 */ outb(0x01, PORT_PIC1_DATA); /* ICW4 */ - /* Initialize level triggers. The CY82C693UB that's on real alpha - hardware doesn't have this; this is a PIIX extension. However, + /* Initialize level triggers. The CY82C693UB that's on some real alpha + systems controls these differently; we assume a PIIX here. However, QEMU doesn't implement regular level triggers. */ outb(0xff, PORT_PIC2_ELCR); outb(0xff, PORT_PIC1_ELCR); From patchwork Thu Jun 3 03:53:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=fQg1Ahea; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwXDv44v7z9sVb for ; Thu, 3 Jun 2021 13:58:23 +1000 (AEST) Received: from localhost ([::1]:56704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeUv-0001Pk-5o for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:58:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQQ-0008H4-99 for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:42 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQO-0004Y6-Nl for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692419; bh=hxX3lW6G5H4ooVs5K1Wg9MuwXQMZOQOBKRZ+VQtVT+I=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=fQg1AheaLdCnzMAs+MysgIrU5JY8UVq+CUT/+el49UaMYUmsbEVtuV5G9Nj3iZiwU dWapvpX6LcnTcWpxYoxSmujDAZNYQNww4Q0h57NqKjeeh71cod5qAGYWQsu7f1VjwM 6/PLRbthVNM/O/HT5ew4FcepYrwvxMd9Jca81zI+NME1a+OJZFYt0Ujk6HCidcZAfZ i5M2Ur/8fDDkZngl/cba/4azq4uQZ0REgQMFmml/jdnVTH2qaXkrPsSBKwsLwhrbWu xHDpR63TAdHF1jVChBILfEYERngCvmzyL2h3QCYVF20h1CVBU+XeMD7M8V5Vi2pN+M 70DocpeSJ9l1Q== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 761F04A03E7; Thu, 3 Jun 2021 03:53:39 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 4/8] Make some PCI macros available to other files. NFC. Date: Wed, 2 Jun 2021 20:53:13 -0700 Message-Id: <20210603035317.6814-5-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=755 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Move PCI_DEVFN(), PCI_BUS(), PCI_SLOT(), and PCI_FUNC() to pci.h. Signed-off-by: Jason Thorpe Reviewed-by: Richard Henderson --- pci.c | 4 ---- pci.h | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pci.c b/pci.c index 87a101c..ba05adb 100644 --- a/pci.c +++ b/pci.c @@ -31,10 +31,6 @@ #include "pci_regs.h" -#define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) -#define PCI_BUS(devfn) ((devfn) >> 8) -#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) -#define PCI_FUNC(devfn) ((devfn) & 0x07) #define PCI_SLOT_MAX 32 #define PCI_FUNC_MAX 8 #define PCI_REGION_ROM 6 diff --git a/pci.h b/pci.h index b751c6f..b4a4f80 100644 --- a/pci.h +++ b/pci.h @@ -60,6 +60,11 @@ extern void pci_config_maskw(int bdf, int addr, uint16_t off, uint16_t on); extern int pci_next(int bdf, int *pmax); +#define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) +#define PCI_BUS(devfn) ((devfn) >> 8) +#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) +#define PCI_FUNC(devfn) ((devfn) & 0x07) + #define foreachpci(BDF, MAX) \ for (MAX = 0x0100, BDF = pci_next(0, &MAX); \ BDF >= 0; \ From patchwork Thu Jun 3 03:53:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486967 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=W2njIIcL; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwXGN0H71z9sVb for ; Thu, 3 Jun 2021 13:59:39 +1000 (AEST) Received: from localhost ([::1]:59258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeW8-000380-8W for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:59:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQS-0008Nl-1Y for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:44 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQQ-0004ZW-Cx for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692421; bh=51QABy2AfwMyeOxLab936/CmhWU0ZyM9ggOJL3COhfI=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=W2njIIcLwWsrFf92ETkTGxDUe5fOZ6ZYNZZyoWI+57jewF/pqftfIPHfwP2+WUNKH u5qegVMSZ0d1fq48kQiDdlNLN8G9DI24y7Bc4FWqhxQ7Mo2lyn8l+KFs8OcRpy3cIX tFFsu4uQ3+A6n1pIebwFv4lKS3t6Uw0TC6EkBu7H/vAtdj3lB3+OL3yKqPFwG5zB/W rJIQSbHLqodNM0EFcJSgCH9Nsj6fTeJnM4bZ+J3QHAiXvZA7yGPfeim6bccjWiyXen 6XZ/vRql2Y2grq19kGYeabsSAOF4f72eYs8a++iEtBcm4Up1WymqXBOApWIDg86Guc DcKUWP8aGbYnQ== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id EA1574A011E; Thu, 3 Jun 2021 03:53:40 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 5/8] Fix incorrect initialization of PCI BARs. Date: Wed, 2 Jun 2021 20:53:14 -0700 Message-Id: <20210603035317.6814-6-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=827 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Only program a BAR as a 64-bit MEM BAR if it really is a 64-bit MEM BAR. Fixes an issue with the CMD646 IDE controller under NetBSD. Improve some debug/info messages. Signed-off-by: Jason Thorpe --- pci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pci.c b/pci.c index ba05adb..5e9c906 100644 --- a/pci.c +++ b/pci.c @@ -84,7 +84,7 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t *p_mem_base) device_id = pci_config_readw(bdf, PCI_DEVICE_ID); class_id = pci_config_readw(bdf, PCI_CLASS_DEVICE); - printf("PCI: %02x:%02x:%x class %04x id %04x:%04x\r\n", + printf("PCI: %d:%d:%d class %04x id %04x:%04x\r\n", PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf), class_id, vendor_id, device_id); @@ -118,9 +118,10 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t *p_mem_base) *p_base = addr + size; pci_config_writel(bdf, ofs, addr); - printf("PCI: region %d: %08x\r\n", region, addr); + printf("PCI: region %d (BAR %02x): %08x\r\n", region, ofs, addr); - if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK) + if ((old & PCI_BASE_ADDRESS_SPACE_IO) == 0 && + (old & PCI_BASE_ADDRESS_MEM_TYPE_MASK) == PCI_BASE_ADDRESS_MEM_TYPE_64) { pci_config_writel(bdf, ofs + 4, 0); From patchwork Thu Jun 3 03:53:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=tNb2S57/; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwXBj0yvcz9sW7 for ; Thu, 3 Jun 2021 13:56:29 +1000 (AEST) Received: from localhost ([::1]:50088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeT5-0005LS-5I for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:56:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53160) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQT-0008Sn-E6 for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:45 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQR-0004aL-Pg for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692422; bh=g4xseUSRgegy/fPbrLkM7LQ3J7y2LeXL13E9V4Q/uwA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=tNb2S57/nJDHiQFhcLwjs8tXa3mhOJJT2OFdbvQ1Rhp7peaOdnHTkcsof5QClgblV fwNeul2QdSsEby8Y8Lv8+7B8rgOym1gGAN7dGuP5j5NMNSC59cNHiBB7W5A+Dgmg2U /No7LlFYt4pfujR9jdlY4T/MaRPt+zLoUGp344kKgJJwqmQRmsjhWY9H2RMAYYhO1K PkY1PdmVhilpeYmHafONydJNCu8nuuvF2qwRy46iT8RRyY06YOrPZMRwc7GRcyP6Pc xOQW0Lkk8eLCbfw6PIBNTqfLb6VgN1xkNASih9TPa0A3kua7zuAOhI1KgVH6egunSv yl15vQQUl+zKA== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 7623E4A02ED; Thu, 3 Jun 2021 03:53:42 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 6/8] Provide interrupt mapping information in PCI config registers. Date: Wed, 2 Jun 2021 20:53:15 -0700 Message-Id: <20210603035317.6814-7-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=849 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use system-specific information to program the interrupt line register with the interrupt mappings, which is what the SRM console does on real hardware; some operating systems (e.g. NetBSD) use this information rather than having interrupt mappings tables for every possible system variation. Signed-off-by: Jason Thorpe --- pci.c | 20 +++++++++++++++++++- sys-clipper.h | 27 +++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/pci.c b/pci.c index 5e9c906..e3cab26 100644 --- a/pci.c +++ b/pci.c @@ -29,6 +29,7 @@ #include "protos.h" #include "pci.h" #include "pci_regs.h" +#include SYSTEM_H #define PCI_SLOT_MAX 32 @@ -132,7 +133,24 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t *p_mem_base) pci_config_maskw(bdf, PCI_COMMAND, 0, PCI_COMMAND_IO | PCI_COMMAND_MEMORY); - /* Map the interrupt. */ + /* Map the interrupt and program the IRQ into the line register. + Some operating systems rely on the Console providing this information + in order to avoid having mapping tables for every possible system + variation. */ + + const uint8_t pin = pci_config_readb(bdf, PCI_INTERRUPT_PIN); + const uint8_t slot = PCI_SLOT(bdf); + const int irq = MAP_PCI_INTERRUPT(slot, pin, class_id); + + if (irq == -1) + { + /* No interrupt mapping. */ + pci_config_writeb(bdf, PCI_INTERRUPT_LINE, 0xff); + } + else + { + pci_config_writeb(bdf, PCI_INTERRUPT_LINE, irq); + } } void diff --git a/sys-clipper.h b/sys-clipper.h index 31094ff..4f563bf 100644 --- a/sys-clipper.h +++ b/sys-clipper.h @@ -27,4 +27,31 @@ #define SYS_VARIATION (5 << 10) #define SYS_REVISION 0 +#ifndef __ASSEMBLER__ + +#define MAP_PCI_INTERRUPT(SLOT, PIN, CLASS_ID) \ +({ \ + int IRQ; \ + \ + if (CLASS_ID == 0x0601) \ + { \ + /* PCI-ISA bridge is hard-wired to IRQ 55 on real \ + hardware, and comes in at a different SCB vector; \ + force the line register to -1. */ \ + IRQ = -1; \ + } \ + else if (PIN >= 1 && PIN <= 4) \ + { \ + /* See hw/alpha/dp264.c:clipper_pci_map_irq() */ \ + IRQ = (SLOT + 1) * 4 + (PIN - 1); \ + } \ + else \ + { \ + IRQ = -1; \ + } \ + IRQ; \ +}) + +#endif /* ! __ASSEMBLER__ */ + #endif From patchwork Thu Jun 3 03:53:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=yJk2SRHm; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwXBh5xJlz9sVb for ; Thu, 3 Jun 2021 13:56:28 +1000 (AEST) Received: from localhost ([::1]:49996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeT4-0005Hx-Rv for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:56:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQV-00009h-QV for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:47 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49334) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQT-0004cF-KS for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692424; bh=7sctv2SUHw3h8CDnfDZqs/enyZL8iCa0g+y8p5P8n4k=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=yJk2SRHmQwn4QkFVo2zF9NxnCDITsozzT2NbA+1Vxet0ZZjwBtZVOJs4hu2bD4mLh 4KYCNLk6C9TNGRUqYKhniYDWArp/idhpPhHpb6/iUlptGWuxvTYxteFmgjQOYf+9z4 rmqAYJTtYHx4Qxn7fvVKG3VBM6gZZPITY5kzC2F6F8VqNdRSr6F8gEVBSKQNraYjD6 n82GHiQD0VZhia8wwaAjnVSW/gqW2QgN/zwNRqxOpSnwUHIdUauQNYwV27UsO5873y wufKxob2BcLR5LizSsrWq0rI3FrGizYdgiJtOCX+I5L6UZjXgejDIWcsa3GDvLOjr8 aFmO7uupdc64g== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 1A1FA4A0368; Thu, 3 Jun 2021 03:53:44 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 7/8] Provide a Console Terminal Block in the HWRPB. Date: Wed, 2 Jun 2021 20:53:16 -0700 Message-Id: <20210603035317.6814-8-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Provide a Console Terminal Block in the HWRPB so that operating systems that depend on it can correctly initialize the console device. In addition to defining and filling out the structures, there are a couple of other key changes: - 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. - We need to initialize the HWRPB *after* initializing VGA, so that we'll know if a VGA device is present and in which slot for filling out the CTB. Signed-off-by: Jason Thorpe --- hwrpb.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ init.c | 32 +++++++++++++++++++++++++++++--- protos.h | 2 ++ vgaio.c | 2 ++ 4 files changed, 87 insertions(+), 3 deletions(-) diff --git a/hwrpb.h b/hwrpb.h index 2166bad..1531e68 100644 --- a/hwrpb.h +++ b/hwrpb.h @@ -146,6 +146,60 @@ struct crb_struct { struct vf_map_struct map[1]; }; +struct ctb_struct { + unsigned long type; + unsigned long unit; + unsigned long res0; + unsigned long len; + unsigned long ipl; + unsigned long tintr_vec; + unsigned long rintr_vec; + unsigned long term_type; + unsigned long keybd_type; + unsigned long keybd_trans; + unsigned long keybd_map; + unsigned long keybd_state; + unsigned long keybd_last; + unsigned long font_us; + unsigned long font_mcs; + unsigned long font_width; + unsigned long font_height; + unsigned long mon_width; + unsigned long mon_height; + unsigned long dpi; + unsigned long planes; + unsigned long cur_width; + unsigned long cur_height; + unsigned long head_cnt; + unsigned long opwindow; + unsigned long head_offset; + unsigned long putchar; + unsigned long io_state; + unsigned long listen_state; + unsigned long xaddr; + unsigned long turboslot; + unsigned long server_off; + unsigned long line_off; + unsigned char csd; +}; + +#define CTB_NONE 0x00 +#define CTB_PRINTERPORT 0x02 +#define CTB_GRAPHICS 0x03 +#define CTB_TYPE4 0x04 + +/* + * Format of the Console Terminal Block Type 4 `turboslot' field: + * + * 63 40 39 32 31 24 23 16 15 8 7 0 + * | reserved | channel | hose | bus type | bus | slot | + */ + +#define CTB_TURBOSLOT_TYPE_TC 0 /* TURBOchannel */ +#define CTB_TURBOSLOT_TYPE_ISA 1 /* ISA */ +#define CTB_TURBOSLOT_TYPE_EISA 2 /* EISA */ +#define CTB_TURBOSLOT_TYPE_PCI 3 /* PCI */ + struct memclust_struct { unsigned long start_pfn; unsigned long numpages; diff --git a/init.c b/init.c index b3919b6..aee5cef 100644 --- a/init.c +++ b/init.c @@ -36,11 +36,20 @@ #define HZ 1024 +/* Upon entry, register a2 contains configuration information from the VM: + + bits 0-5 -- ncpus + bit 6 -- "nographics" option (used to initialize CTB) */ + +#define CONFIG_NCPUS(x) ((x) & 63) +#define CONFIG_NOGRAPHICS(x) ((x) & (1ull << 6)) + struct hwrpb_combine { struct hwrpb_struct hwrpb; struct percpu_struct processor[4]; struct memdesc_struct md; struct memclust_struct mc[2]; + struct ctb_struct ctb; struct crb_struct crb; struct procdesc_struct proc_dispatch; struct procdesc_struct proc_fixup; @@ -59,6 +68,8 @@ struct hwrpb_combine hwrpb __attribute__((aligned(PAGE_SIZE))); void *last_alloc; bool have_vga; +unsigned int pci_vga_bus; +unsigned int pci_vga_dev; static void * alloc (unsigned long size, unsigned long align) @@ -136,12 +147,13 @@ init_page_table(void) } static void -init_hwrpb (unsigned long memsize, unsigned long cpus) +init_hwrpb (unsigned long memsize, unsigned long config) { unsigned long pal_pages; unsigned long amask; unsigned long i; unsigned long proc_type = EV4_CPU; + unsigned long cpus = CONFIG_NCPUS(config); hwrpb.hwrpb.phys_addr = PA(&hwrpb); @@ -226,6 +238,19 @@ init_hwrpb (unsigned long memsize, unsigned long cpus) hwrpb.mc[1].start_pfn = pal_pages; hwrpb.mc[1].numpages = (memsize >> PAGE_SHIFT) - pal_pages; + hwrpb.hwrpb.ctbt_offset = offsetof(struct hwrpb_combine, ctb); + hwrpb.hwrpb.ctb_size = sizeof(hwrpb.ctb); + if (have_vga && !CONFIG_NOGRAPHICS(config)) + { + hwrpb.ctb.term_type = CTB_GRAPHICS; + hwrpb.ctb.turboslot = (CTB_TURBOSLOT_TYPE_PCI << 16) | + (pci_vga_bus << 8) | pci_vga_dev; + } + else + { + hwrpb.ctb.term_type = CTB_PRINTERPORT; + } + hwrpb.hwrpb.crb_offset = offsetof(struct hwrpb_combine, crb); hwrpb.crb.dispatch_va = &hwrpb.proc_dispatch; hwrpb.crb.dispatch_pa = PA(&hwrpb.proc_dispatch); @@ -300,18 +325,19 @@ swppal(void *entry, void *pcb) } void -do_start(unsigned long memsize, void (*kernel_entry)(void), unsigned long cpus) +do_start(unsigned long memsize, void (*kernel_entry)(void), + unsigned long config) { last_alloc = _end; init_page_table(); - init_hwrpb(memsize, cpus); init_pcb(); init_i8259(); uart_init(); ps2port_setup(); pci_setup(); vgahw_init(); + init_hwrpb(memsize, config); swppal(kernel_entry ? kernel_entry : do_console, &pcb); } diff --git a/protos.h b/protos.h index 0d90be8..44ad233 100644 --- a/protos.h +++ b/protos.h @@ -222,6 +222,8 @@ extern unsigned long crb_fixup(unsigned long vptptr, unsigned long hwrpb); */ extern bool have_vga; +extern unsigned int pci_vga_bus; +extern unsigned int pci_vga_dev; extern void do_console(void); extern void entInt(void); diff --git a/vgaio.c b/vgaio.c index 2dd7eb7..1fb0d52 100644 --- a/vgaio.c +++ b/vgaio.c @@ -570,6 +570,8 @@ vgahw_init(void) found: have_vga = 1; + pci_vga_bus = PCI_BUS(bdf); + pci_vga_dev = PCI_SLOT(bdf); vmode_g = find_vga_entry(3); From patchwork Thu Jun 3 03:53:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Thorpe X-Patchwork-Id: 1486962 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=me.com header.i=@me.com header.a=rsa-sha256 header.s=1a1hai header.b=pC2CKGug; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FwX891z0Vz9sVb for ; Thu, 3 Jun 2021 13:54:17 +1000 (AEST) Received: from localhost ([::1]:42560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loeQx-0000Kk-7u for incoming@patchwork.ozlabs.org; Wed, 02 Jun 2021 23:54:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQW-0000DX-PQ for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:48 -0400 Received: from mr85p00im-ztdg06011101.me.com ([17.58.23.185]:49386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loeQV-0004cu-0Q for qemu-devel@nongnu.org; Wed, 02 Jun 2021 23:53:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1622692426; bh=/n4salk8eA40cBPApIq39FMgOsuRQeGTuhkECctA9h8=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=pC2CKGugJ2xtWPJDr+fLtxirls/Cz6y/uHD9ZYays7aaN3XfFCyRbkWgWSZ2O0KQy duUWGCXBAE8WVuMN8n15zY+vPKt2DV/7OmBZc2XLM+se/SMdJv1xH/czWjOQiNT910 BTlAIlMxTPkvz4mDufqJxoW7Zwh7LRb9xo1IDtPaKdZyVFM+/vD9nS562eQl5ymrBi IuK3xN8Ng+3dtK1xqzbjjcCeXmIEUNhBHsdM2f6asEbPWpGQKHMXgtTN5gccTEp+Bn nPmpIkUix6s15H/nZc/Tkq7vixrfJzw6S8H8b7mt7gGr9dsZhTLfL9yXs84mzgAdKD G0cxaO2vtwkqQ== Received: from the-ripe-vessel.ktnet (c-67-180-181-196.hsd1.ca.comcast.net [67.180.181.196]) by mr85p00im-ztdg06011101.me.com (Postfix) with ESMTPSA id 919624A0327; Thu, 3 Jun 2021 03:53:45 +0000 (UTC) From: Jason Thorpe To: qemu-devel@nongnu.org Cc: Jason Thorpe Subject: [PATCH 8/8] Fixes for seconday CPU start-up. Date: Wed, 2 Jun 2021 20:53:17 -0700 Message-Id: <20210603035317.6814-9-thorpej@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210603035317.6814-1-thorpej@me.com> References: <20210603035317.6814-1-thorpej@me.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E391=2C18=2E0?= =?utf-8?q?=2E761=2C17=2E0=2E607=2E475=2E0000000_definitions=3D2021-06-03=5F?= =?utf-8?q?01=3A2021-06-02=5F03=2C2021-06-03=5F01=2C2020-04-07=5F01_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=786 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2106030024 Received-SPF: pass client-ip=17.58.23.185; envelope-from=thorpej@me.com; helo=mr85p00im-ztdg06011101.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_H2=-0.001, 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Changes to make secondary CPU start-up work on NetBSD, which depends on some specific behavior in the architecture specification: - Change the internal swppal() function to take the new VPTPTR and Procedure Value as explicit arguments. Adapt do_start() to the new the new swppal() signature. - In do_start_wait(), extract the new VPTPTR and PV from the relevant HWRPB fields, which will have been initialized by the OS, and pass them to swppal(). - In the SWPPAL PAL call, get the value to stuff into PV (r27) from a4 (r20), and add a comment describing why this implementation detail is allowed by the architecture specification. Signed-off-by: Jason Thorpe Reviewed-by: Richard Henderson --- init.c | 25 ++++++++++++++++--------- pal.S | 13 ++++++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/init.c b/init.c index aee5cef..bfe4d96 100644 --- a/init.c +++ b/init.c @@ -313,14 +313,16 @@ init_i8259 (void) } static void __attribute__((noreturn)) -swppal(void *entry, void *pcb) +swppal(void *entry, void *pcb, unsigned long vptptr, unsigned long pv) { register int variant __asm__("$16") = 2; /* OSF/1 PALcode */ register void *pc __asm__("$17") = entry; register unsigned long pa_pcb __asm__("$18") = PA(pcb); - register unsigned long vptptr __asm__("$19") = VPTPTR; + register unsigned long newvptptr __asm__("$19") = vptptr; + register unsigned long newpv __asm__("$20") = pv; - asm("call_pal 0x0a" : : "r"(variant), "r"(pc), "r"(pa_pcb), "r"(vptptr)); + asm("call_pal 0x0a" : : + "r"(variant), "r"(pc), "r"(pa_pcb), "r"(newvptptr), "r"(newpv)); __builtin_unreachable (); } @@ -339,7 +341,9 @@ do_start(unsigned long memsize, void (*kernel_entry)(void), vgahw_init(); init_hwrpb(memsize, config); - swppal(kernel_entry ? kernel_entry : do_console, &pcb); + void *new_pc = kernel_entry ? kernel_entry : do_console; + + swppal(new_pc, &pcb, VPTPTR, (unsigned long)new_pc); } void @@ -354,14 +358,16 @@ do_start_wait(unsigned long cpuid) { /* ??? The only message I know of is "START\r\n". I can't be bothered to verify more than 4 characters. */ - /* ??? The Linux kernel fills in, but does not require, - CPU_restart_data. It just sets that to the same address - as CPU_restart itself. Our swppal *does* put the PC into - $26 and $27, the latter of which the kernel does rely upon. */ + + /* Use use a private extension to SWPPAL to get the + CPU_restart_data into $27. Linux fills it in, but does + not require it. Other operating systems, however, do use + CPU_restart_data as part of secondary CPU start-up. */ unsigned int len = hwrpb.processor[cpuid].ipc_buffer[0]; unsigned int msg = hwrpb.processor[cpuid].ipc_buffer[1]; void *CPU_restart = hwrpb.hwrpb.CPU_restart; + unsigned long CPU_restart_data = hwrpb.hwrpb.CPU_restart_data; __sync_synchronize(); hwrpb.hwrpb.rxrdy = 0; @@ -369,7 +375,8 @@ do_start_wait(unsigned long cpuid) { /* Set bootstrap in progress */ hwrpb.processor[cpuid].flags |= 1; - swppal(CPU_restart, hwrpb.processor[cpuid].hwpcb); + swppal(CPU_restart, hwrpb.processor[cpuid].hwpcb, + hwrpb.hwrpb.vptb, CPU_restart_data); } } } diff --git a/pal.S b/pal.S index 015a829..7e3a62c 100644 --- a/pal.S +++ b/pal.S @@ -566,6 +566,8 @@ ENDFN CallPal_Cserve_Cont * r17 (a1) = New PC * r18 (a2) = New PCB * r19 (a3) = New VptPtr + * r20 (a4) = New Procedure Value (to place into $27) + * (Non-standard; See note below.) * * OUTPUT PARAMETERS: * @@ -574,10 +576,15 @@ ENDFN CallPal_Cserve_Cont * 1 - Unknown PALcode variant * 2 - Known PALcode variant, but PALcode not loaded * - * r26 (ra) = r27 (pv) = New PC + * r26 (ra) = New PC + * r27 (pv) = From r20 * Note that this is non-architected, but is relied on by * the usage of SwpPal within our own console code in order - * to simplify its use within C code. + * to simplify its use within C code. We can get away with + * the extra non-standard argument (in $20) because as + * architected, all registers except SP and R0 are + * UNPREDICTABLE; therefore private internal usage is + * fine. * */ ORG_CALL_PAL_PRIV(0x0A) @@ -624,7 +631,7 @@ CallPal_SwpPal_Cont: mtpr $31, qemu_tbia // Flush TLB for new PTBR mov a1, $26 - mov a1, $27 + mov a4, $27 hw_ret (a1) ENDFN CallPal_SwpPal_Cont .previous