From patchwork Fri Feb 9 11:56:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551137 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 71CAFC48297 for ; Fri, 9 Feb 2024 11:58:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVD-0003f5-Ht; Fri, 09 Feb 2024 06:57:08 -0500 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 1rYPUz-0003bE-Ph for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:55 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUw-0002P6-KB for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:52 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 0FF27CE1F9D; Fri, 9 Feb 2024 11:56:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18388C433F1; Fri, 9 Feb 2024 11:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479798; bh=vx4xC5M+DPAKkeJWujimrHUf61MEn29t9idgCCP1zPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N4ZblExNuDZJhKpQIJGESiddkx/7X51FtNzpxYOHv/AbDRFjd+0fdYFsuGtHumO4U QMaZJP6BPx5vN5nJV2NtPgPo+WEqmBct9nOn0ewzmlmkEAhCP36LpdXZ9wztql3DNB +m8Shi3mRp066IICeFvC1juogIobWwgPYrmDvFpiFLU93sFr9ohroiauwuxbF5q62f 81dLRn4Rqx+imoy73rQ5afTGNXnWfVHkUkd3Q9oaTl78OTHunQtEuFpNcpNAFxe5T4 w+PoUEIDer2L7ng+M790LBJXF3nv0dD/pJHzfmfgyPtO2mmSSCMaqPe0TJHeEUem1X hTWpjmeonxIGw== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 01/12] disas/hppa: Add disassembly for qemu specific instructions Date: Fri, 9 Feb 2024 12:56:22 +0100 Message-ID: <20240209115633.55823-2-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Add disassembly of opcodes for "HALT QEMU", "RESET QEMU" and "RESTORE SHR" (restore shadow registers). Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- disas/hppa.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/disas/hppa.c b/disas/hppa.c index cce4f4aa37..22dce9b41b 100644 --- a/disas/hppa.c +++ b/disas/hppa.c @@ -1609,6 +1609,10 @@ static const struct pa_opcode pa_opcodes[] = { "call", 0xe800a000, 0xffe0e000, "nW", pa10, FLAG_STRICT}, { "ret", 0xe840d000, 0xfffffffd, "n", pa20, FLAG_STRICT}, +/* Opcodes assigned to QEMU, used by SeaBIOS firmware and Linux kernel */ +{ "HALT QEMU", 0xfffdead0, 0xfffffffd, "n", pa10, FLAG_STRICT}, +{ "RESET QEMU", 0xfffdead1, 0xfffffffd, "n", pa10, FLAG_STRICT}, +{ "RESTORE SHR",0xfffdead2, 0xfffffffd, "n", pa10, FLAG_STRICT}, }; #define NUMOPCODES ((sizeof pa_opcodes)/(sizeof pa_opcodes[0])) From patchwork Fri Feb 9 11:56:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551138 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 DCEF6C48297 for ; Fri, 9 Feb 2024 11:58:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPUv-0003WV-Bt; Fri, 09 Feb 2024 06:56:49 -0500 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 1rYPUu-0003W1-3Q for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:48 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUq-0002PC-Sp for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:47 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B5491CE2000; Fri, 9 Feb 2024 11:56:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC059C433C7; Fri, 9 Feb 2024 11:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479800; bh=yfn4iPnMteb635NlkU5X8otEObA+V9Fefvd6+Q28lcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MlDt4E/dwqmzpvjqCvW1o70nWR+UrktGovsn8AfEY2bqULhc2mT8/riBycK/YjBdt EnOGN5I4YaTBObMdRFEIj3dFcyRN65UYrsBR0mo3dLxhQYtsgbR/085/utX3L8cXPZ LMeCK2xCHOovuBy8RHAQsT/M2lJpGavAnro8LZpGTgJeO4eVcEKq/fXFJttuO8yKRZ l1D9GuwAQ6KjlfmJglks9csWEYfGmr2HkLDJrb6eXcd9oOw94OLEr4GFmah2vi+xf2 WCrO1yV3RGxz0phXwo9jSgtBUiV5nSPUUWjRY+WshsuGGRTiaPbhy8uvM6061UnRaQ 3bCULtBxrnE7w== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 02/12] target/hppa: Add "diag 0x101" for console output support Date: Fri, 9 Feb 2024 12:56:23 +0100 Message-ID: <20240209115633.55823-3-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller For debugging purposes at the early stage of the bootup process, the SeaBIOS-hppa firmware sometimes needs to output characters to the serial console. Note that the serial console is the default output method for parisc machines. At this stage PCI busses and other devices haven't been initialized yet. So, SeaBIOS-hppa will not be able to find the correct I/O ports for the serial ports yet. Instead, add an emulation for the "diag 0x101" opcode to assist here. Without any other dependencies, SeaBIOS-hppa can then load the character to be printed in register %r26 and issue the diag assembly instruction. The qemu diag_console_output() helper function will then print that character to the first serial port. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/helper.h | 1 + target/hppa/sys_helper.c | 36 ++++++++++++++++++++++++++++++++++++ target/hppa/translate.c | 6 ++++++ 3 files changed, 43 insertions(+) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 20698f68ed..1bdbcd8f98 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -103,4 +103,5 @@ DEF_HELPER_FLAGS_1(ptlbe, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(lpa, TCG_CALL_NO_WG, tl, env, tl) DEF_HELPER_FLAGS_1(change_prot_id, TCG_CALL_NO_RWG, void, env) DEF_HELPER_1(diag_btlb, void, env) +DEF_HELPER_1(diag_console_output, void, env) #endif diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index a59245eed3..4a31748342 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -23,6 +23,8 @@ #include "exec/helper-proto.h" #include "qemu/timer.h" #include "sysemu/runstate.h" +#include "sysemu/sysemu.h" +#include "chardev/char-fe.h" void HELPER(write_interval_timer)(CPUHPPAState *env, target_ulong val) { @@ -109,3 +111,37 @@ void HELPER(rfi_r)(CPUHPPAState *env) helper_getshadowregs(env); helper_rfi(env); } + +#ifndef CONFIG_USER_ONLY +/* + * diag_console_output() is a helper function used during the initial bootup + * process of the SeaBIOS-hppa firmware. During the bootup phase, addresses of + * serial ports on e.g. PCI busses are unknown and most other devices haven't + * been initialized and configured yet. With help of a simple "diag" assembler + * instruction and an ASCII character code in register %r26 firmware can easily + * print debug output without any dependencies to the first serial port and use + * that as serial console. + */ +void HELPER(diag_console_output)(CPUHPPAState *env) +{ + CharBackend *serial_backend; + Chardev *serial_port; + unsigned char c; + + /* find first serial port */ + serial_port = serial_hd(0); + if (!serial_port) { + return; + } + + /* get serial_backend for the serial port */ + serial_backend = serial_port->be; + if (!serial_backend || + !qemu_chr_fe_backend_connected(serial_backend)) { + return; + } + + c = (unsigned char)env->gr[26]; + qemu_chr_fe_write(serial_backend, &c, sizeof(c)); +} +#endif diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 08d09d50d7..53ec57ee86 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4411,6 +4411,12 @@ static bool trans_diag(DisasContext *ctx, arg_diag *a) gen_helper_diag_btlb(tcg_env); return nullify_end(ctx); } + if (a->i == 0x101) { + /* print char in %r26 to first serial console, used by SeaBIOS-hppa */ + nullify_over(ctx); + gen_helper_diag_console_output(tcg_env); + return nullify_end(ctx); + } #endif qemu_log_mask(LOG_UNIMP, "DIAG opcode 0x%04x ignored\n", a->i); return true; From patchwork Fri Feb 9 11:56:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551134 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 B67EAC4828F for ; Fri, 9 Feb 2024 11:57:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPUy-0003Yc-3H; Fri, 09 Feb 2024 06:56:52 -0500 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 1rYPUt-0003Vg-OX for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:47 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUr-0002PO-7S for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:47 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id EE13D62063; Fri, 9 Feb 2024 11:56:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B2ABC433F1; Fri, 9 Feb 2024 11:56:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479801; bh=eKd3LfJAQ+UZw+rrOrT83UdSOdoxCGW0LqJcz2pG0sA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HHRYkUSAHdrIKhs5JC4/f+pbOd6j+d+WG1S6qp7JXZuuQP6tf9ojDGbtudlzWWao3 58UVQ30VqVIqeKCNknDCs/AkHMtGG+qB/ZTiVwVxHotZeEiSgayR4IOlgUF0l4n0UF U0RUJDoTZ+vRdhtp8mq9m9DWL4TZfUEqSzYpwEsNzB40yRF2L2OMRdj0pnMBcsKqjd c8Eb80nFwrxLR2H3UeT8UzCIiCJIyIEeUhwxBM7VG1E1LbM2kwDhlmqR4KelRxkDe+ j2T/5qNomd9ZbIM9b5Xzsu+rYfxKv/0rgQ0TDU+UVGqGSB6JDFc5ZOj2Ni7O3zOtR7 XETb00ObNoQ4Q== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 03/12] hw/pci-host/astro: Avoid aborting on access failure Date: Fri, 9 Feb 2024 12:56:24 +0100 Message-ID: <20240209115633.55823-4-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Instead of stopping the emulation, report a MEMTX_DECODE_ERROR if the OS tries to access non-existent registers. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- hw/pci-host/astro.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index 37d271118c..96d655f5fb 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -122,10 +122,6 @@ static MemTxResult elroy_chip_read_with_attrs(void *opaque, hwaddr addr, case 0x0800: /* IOSAPIC_REG_SELECT */ val = s->iosapic_reg_select; break; - case 0x0808: - val = UINT64_MAX; /* XXX: tbc. */ - g_assert_not_reached(); - break; case 0x0810: /* IOSAPIC_REG_WINDOW */ switch (s->iosapic_reg_select) { case 0x01: /* IOSAPIC_REG_VERSION */ @@ -135,15 +131,15 @@ static MemTxResult elroy_chip_read_with_attrs(void *opaque, hwaddr addr, if (s->iosapic_reg_select < ARRAY_SIZE(s->iosapic_reg)) { val = s->iosapic_reg[s->iosapic_reg_select]; } else { - trace_iosapic_reg_read(s->iosapic_reg_select, size, val); - g_assert_not_reached(); + val = 0; + ret = MEMTX_DECODE_ERROR; } } trace_iosapic_reg_read(s->iosapic_reg_select, size, val); break; default: - trace_elroy_read(addr, size, val); - g_assert_not_reached(); + val = 0; + ret = MEMTX_DECODE_ERROR; } trace_elroy_read(addr, size, val); @@ -191,7 +187,7 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr, if (s->iosapic_reg_select < ARRAY_SIZE(s->iosapic_reg)) { s->iosapic_reg[s->iosapic_reg_select] = val; } else { - g_assert_not_reached(); + return MEMTX_DECODE_ERROR; } break; case 0x0840: /* IOSAPIC_REG_EOI */ @@ -204,7 +200,7 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr, } break; default: - g_assert_not_reached(); + return MEMTX_DECODE_ERROR; } return MEMTX_OK; } @@ -594,8 +590,8 @@ static MemTxResult astro_chip_read_with_attrs(void *opaque, hwaddr addr, #undef EMPTY_PORT default: - trace_astro_chip_read(addr, size, val); - g_assert_not_reached(); + val = 0; + ret = MEMTX_DECODE_ERROR; } /* for 32-bit accesses mask return value */ @@ -610,6 +606,7 @@ static MemTxResult astro_chip_write_with_attrs(void *opaque, hwaddr addr, uint64_t val, unsigned size, MemTxAttrs attrs) { + MemTxResult ret = MEMTX_OK; AstroState *s = opaque; trace_astro_chip_write(addr, size, val); @@ -686,11 +683,9 @@ static MemTxResult astro_chip_write_with_attrs(void *opaque, hwaddr addr, #undef EMPTY_PORT default: - /* Controlled by astro_chip_mem_valid above. */ - trace_astro_chip_write(addr, size, val); - g_assert_not_reached(); + ret = MEMTX_DECODE_ERROR; } - return MEMTX_OK; + return ret; } static const MemoryRegionOps astro_chip_ops = { From patchwork Fri Feb 9 11:56:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551140 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 3EE0AC4828F for ; Fri, 9 Feb 2024 11:58:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPUu-0003WH-FS; Fri, 09 Feb 2024 06:56:48 -0500 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 1rYPUs-0003UH-K6 for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:46 -0500 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUq-0002PW-TJ for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:46 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9CC2562037; Fri, 9 Feb 2024 11:56:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A524C433C7; Fri, 9 Feb 2024 11:56:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479803; bh=ubbnHP6CQJX6H46ApufgbUTl/GyRa/bvBIBXu8fglok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWl0fC8vR6X5eG6pH7xkNpXuXhEWMGNxNN0N0GkRNnIkDvZixdFDSNNX1C6uY8ib6 u/MA+dl4cQ/VksTeWlOZFs8HfdBqvCOIXIsNnqMM/Y60RlfBs8o2j/qOSyqTDcPfzh IppCwu5zrH9GqMgd45xlfBj8N73mPYBN+Y2E5pT/ekHorycSWPpd49n56GFsAdOndM HVR8CXnATEgZarJHHu5yuqRQ+fdEuUk08gh5K/9LECqG6H4AdsCmKQ/Caw2m8XFuE4 g/9l9SinprOsQIAkIBTm6QUfhFNCWGjkWAymLgyx9Q2FaLoKxW5lOPLR/HkfpmqpbS CxTdKAHj53IOw== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 04/12] hw/pci-host/astro: Implement Hard Fail and Soft Fail mode Date: Fri, 9 Feb 2024 12:56:25 +0100 Message-ID: <20240209115633.55823-5-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller The Astro/Elroy chip can work in either Hard-Fail or Soft-Fail mode. Hard fail means the system bus will send an HPMC (=crash) to the processor, soft fail means the system bus will ignore timeouts of MMIO-reads or MMIO-writes and return -1ULL. The HF mode is controlled by a bit in the status register and is usually programmed by the OS. Return the corresponing values based on the current value of that bit. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- hw/pci-host/astro.c | 21 +++++++++++++++------ include/hw/pci-host/astro.h | 2 ++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/astro.c b/hw/pci-host/astro.c index 96d655f5fb..e3e589ceac 100644 --- a/hw/pci-host/astro.c +++ b/hw/pci-host/astro.c @@ -131,15 +131,21 @@ static MemTxResult elroy_chip_read_with_attrs(void *opaque, hwaddr addr, if (s->iosapic_reg_select < ARRAY_SIZE(s->iosapic_reg)) { val = s->iosapic_reg[s->iosapic_reg_select]; } else { - val = 0; - ret = MEMTX_DECODE_ERROR; + goto check_hf; } } trace_iosapic_reg_read(s->iosapic_reg_select, size, val); break; default: - val = 0; - ret = MEMTX_DECODE_ERROR; + check_hf: + if (s->status_control & HF_ENABLE) { + val = 0; + ret = MEMTX_DECODE_ERROR; + } else { + /* return -1ULL if HardFail is disabled */ + val = ~0; + ret = MEMTX_OK; + } } trace_elroy_read(addr, size, val); @@ -187,7 +193,7 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr, if (s->iosapic_reg_select < ARRAY_SIZE(s->iosapic_reg)) { s->iosapic_reg[s->iosapic_reg_select] = val; } else { - return MEMTX_DECODE_ERROR; + goto check_hf; } break; case 0x0840: /* IOSAPIC_REG_EOI */ @@ -200,7 +206,10 @@ static MemTxResult elroy_chip_write_with_attrs(void *opaque, hwaddr addr, } break; default: - return MEMTX_DECODE_ERROR; + check_hf: + if (s->status_control & HF_ENABLE) { + return MEMTX_DECODE_ERROR; + } } return MEMTX_OK; } diff --git a/include/hw/pci-host/astro.h b/include/hw/pci-host/astro.h index f63fd220f3..e2966917cd 100644 --- a/include/hw/pci-host/astro.h +++ b/include/hw/pci-host/astro.h @@ -27,6 +27,8 @@ OBJECT_DECLARE_SIMPLE_TYPE(ElroyState, ELROY_PCI_HOST_BRIDGE) #define IOS_DIST_BASE_ADDR 0xfffee00000ULL #define IOS_DIST_BASE_SIZE 0x10000ULL +#define HF_ENABLE 0x40 /* enable HF mode (default is -1 mode) */ + struct AstroState; struct ElroyState { From patchwork Fri Feb 9 11:56:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551141 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 17CF5C4828F for ; Fri, 9 Feb 2024 11:58:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPUu-0003WN-Qm; Fri, 09 Feb 2024 06:56:48 -0500 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 1rYPUt-0003Vx-Vg for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:47 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUs-0002Pn-AU for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:47 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 503B062072; Fri, 9 Feb 2024 11:56:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD2D1C43390; Fri, 9 Feb 2024 11:56:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479805; bh=FaxA3mFrSxmY5kTESFNBYrTItNp7faYaL5jQs64YYHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRbq8kaNvvEcEq9U9ggHBchdZSYN9OkAa6pBJm9LGkUAaYcsC90sWYTodFTaNkUfH F3wKiC93IGW2oEH4ERZByVJglhP8XL8ltZ2Ktnt6zJbm9MYl7HFrB8zJnxTcTj6RIq IlijTNusHeDJH5fS3xLsE2RYhOkwIDPHXgVXdxdy8EpqLQRTG+VAhqR6FGNwTKKESz MZ9ML7hIlzkOOA9MIHTqO9f+fLjxbHzbb5ahR6CCJpeT9sJ+8px1utMyzVVP6Mo47u EV8gmDdluLcPPiCaKi2EuVMZ1HbaJ2e7XNtU9/GX28HbaN+ib4t67eSQHx5+REZPpF vMBDr1HEFANMA== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 05/12] lasi: allow access to LAN MAC address registers Date: Fri, 9 Feb 2024 12:56:26 +0100 Message-ID: <20240209115633.55823-6-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -72 X-Spam_score: -7.3 X-Spam_bar: ------- X-Spam_report: (-7.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Firmware and qemu reads and writes the MAC address for the LASI LAN via registers in LASI. Allow those accesses and return zero even if LASI LAN isn't enabled to avoid HPMCs (=crashes). Signed-off-by: Helge Deller --- hw/misc/lasi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/misc/lasi.c b/hw/misc/lasi.c index 003f5b5ed8..9cfa5bb316 100644 --- a/hw/misc/lasi.c +++ b/hw/misc/lasi.c @@ -38,6 +38,7 @@ static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, case LASI_LPT: case LASI_UART: case LASI_LAN: + case LASI_LAN + 12: /* LASI LAN MAC */ case LASI_RTC: case LASI_PCR ... LASI_AMR: @@ -78,6 +79,7 @@ static MemTxResult lasi_chip_read_with_attrs(void *opaque, hwaddr addr, case LASI_LPT: case LASI_UART: case LASI_LAN: + case LASI_LAN + 12: val = 0; break; case LASI_RTC: From patchwork Fri Feb 9 11:56:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551139 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 40106C4828F for ; Fri, 9 Feb 2024 11:58:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPV5-0003db-QG; Fri, 09 Feb 2024 06:56:59 -0500 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 1rYPV1-0003by-KV for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:55 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUx-0002RC-Hy for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:54 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8B939CE2005; Fri, 9 Feb 2024 11:56:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BDF6C433C7; Fri, 9 Feb 2024 11:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479806; bh=pgNJchBQDIBYjxxSFSCpASqiLdg+D2giuu+TbQVVM78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSdeAehM98EJwcZIYBpXhiB2Brkg3n18TXLII5ZPzugtyhGqSSU4d+ADUNb0UYNwE VajWA5QrFboVK5zQpz/eC3Onitgruv71AzmwmYsV46vhBzBpy0lX8zD+8SeC5b0TsG zEyOiI1Vi+ArjBHjCtokG7LDCzXbWOre40ILA+9G2M4clpEeN7htHY/MtndHy4GTBy dVL7OjCT9vPPvWvlWJuX+3XunR6nQ2lRU/eT36p7vSJzg3lkr5uTff27ds9/VbauG7 czn9/AHX+qpCdvXoyDGlnwcF+1lnXWnUlm4hd+MVJGmuUcVvF11zDj74dtGthEmAjz ocQyFjLRjfl+A== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 06/12] target/hppa: Implement do_transaction_failed handler for I/O errors Date: Fri, 9 Feb 2024 12:56:27 +0100 Message-ID: <20240209115633.55823-7-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Add the do_transaction_failed() handler to tigger a HPMC to the CPU in case of I/O transaction errors. This is a preparation commit. We still lack implementation for some registers, so do not yet enable sending HPMCs. Having this hunk here now nevertheless helps for the further development, so that it can easily be enabled later on. Signed-off-by: Helge Deller --- target/hppa/cpu.c | 1 + target/hppa/cpu.h | 5 +++++ target/hppa/mem_helper.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 5f87c1b12a..afe73d4474 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -191,6 +191,7 @@ static const TCGCPUOps hppa_tcg_ops = { .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .do_interrupt = hppa_cpu_do_interrupt, .do_unaligned_access = hppa_cpu_do_unaligned_access, + .do_transaction_failed = hppa_cpu_do_transaction_failed, #endif /* !CONFIG_USER_ONLY */ }; diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 7a181e8f33..a92dc352cb 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -381,6 +381,11 @@ bool hppa_cpu_exec_interrupt(CPUState *cpu, int int_req); int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx, int type, hwaddr *pphys, int *pprot, HPPATLBEntry **tlb_entry); +void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr); extern const MemoryRegionOps hppa_io_eir_ops; extern const VMStateDescription vmstate_hppa_cpu; void hppa_cpu_alarm_timer(void *); diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 629a9d90ef..676c0b3003 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -353,6 +353,25 @@ raise_exception_with_ior(CPUHPPAState *env, int excp, uintptr_t retaddr, cpu_loop_exit_restore(cs, retaddr); } +void hppa_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, + vaddr addr, unsigned size, + MMUAccessType access_type, + int mmu_idx, MemTxAttrs attrs, + MemTxResult response, uintptr_t retaddr) +{ + CPUHPPAState *env = cpu_env(cs); + + qemu_log_mask(LOG_GUEST_ERROR, "HPMC at " TARGET_FMT_lx ":" TARGET_FMT_lx + " while accessing I/O at %#08" HWADDR_PRIx "\n", + env->iasq_f, env->iaoq_f, physaddr); + + /* FIXME: Enable HPMC exceptions when firmware has clean device probing */ + if (0) { + raise_exception_with_ior(env, EXCP_HPMC, retaddr, addr, + MMU_IDX_MMU_DISABLED(mmu_idx)); + } +} + bool hppa_cpu_tlb_fill(CPUState *cs, vaddr addr, int size, MMUAccessType type, int mmu_idx, bool probe, uintptr_t retaddr) From patchwork Fri Feb 9 11:56:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551135 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 5217BC48297 for ; Fri, 9 Feb 2024 11:57:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPV5-0003de-QO; Fri, 09 Feb 2024 06:57:01 -0500 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 1rYPV1-0003bv-KY for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:55 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPUx-0002RN-Ms for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:54 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 13345CE2007; Fri, 9 Feb 2024 11:56:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B7A8C43394; Fri, 9 Feb 2024 11:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479808; bh=vqjS4Tn8JsTETJjKAhscWBmZAWUWeDAIiHK9Uvc1mpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fqsfhCy0CmsJqv9zC6GfjOd92wjHzUHxao524QtRJE81BT+VAakC5oCn1+MSEbZMU 5uGtmkxiriqJehqvbMw3y3ql78xYjAFo0lWHftXidfvSFGmMYz9+qOOGc4fa5BOAOx 6+8esWd8yRi7FdknbjFQCNatNrPCGpMingN2KbHDA41QFWtX9EI7YmjI8M1HRgFFgE ice6woecg3JuWEKsxv80paNSp90FUkeUlTnRCsqTnADQXF8MiaaHv0mXPfVueTpqde jB89dj6/Abn6X/LgaL2Wguar9CaB1Nsx75lyBqYspz6plWR9E1B9qhGUGnljSOVlcM 2PyIFd/lkWouw== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 07/12] lasi: Add reset I/O ports for LASI audio and FDC Date: Fri, 9 Feb 2024 12:56:28 +0100 Message-ID: <20240209115633.55823-8-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Linux writes zeroes at bootup into the default ports for LASI audio and LASI floppy controller to reset those devices. Allow writing to those registers to avoid HPMCs. Signed-off-by: Helge Deller --- hw/misc/lasi.c | 11 +++++++++++ include/hw/misc/lasi.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/hw/misc/lasi.c b/hw/misc/lasi.c index 9cfa5bb316..970fc98b5c 100644 --- a/hw/misc/lasi.c +++ b/hw/misc/lasi.c @@ -36,10 +36,13 @@ static bool lasi_chip_mem_valid(void *opaque, hwaddr addr, case LASI_IAR: case LASI_LPT: + case LASI_AUDIO: + case LASI_AUDIO + 4: case LASI_UART: case LASI_LAN: case LASI_LAN + 12: /* LASI LAN MAC */ case LASI_RTC: + case LASI_FDC: case LASI_PCR ... LASI_AMR: ret = true; @@ -80,6 +83,7 @@ static MemTxResult lasi_chip_read_with_attrs(void *opaque, hwaddr addr, case LASI_UART: case LASI_LAN: case LASI_LAN + 12: + case LASI_FDC: val = 0; break; case LASI_RTC: @@ -145,12 +149,19 @@ static MemTxResult lasi_chip_write_with_attrs(void *opaque, hwaddr addr, case LASI_LPT: /* XXX: reset parallel port */ break; + case LASI_AUDIO: + case LASI_AUDIO + 4: + /* XXX: reset audio port */ + break; case LASI_UART: /* XXX: reset serial port */ break; case LASI_LAN: /* XXX: reset LAN card */ break; + case LASI_FDC: + /* XXX: reset Floppy controller */ + break; case LASI_RTC: s->rtc_ref = val - time(NULL); break; diff --git a/include/hw/misc/lasi.h b/include/hw/misc/lasi.h index 0a8c7352be..f01c0f680a 100644 --- a/include/hw/misc/lasi.h +++ b/include/hw/misc/lasi.h @@ -26,9 +26,11 @@ OBJECT_DECLARE_SIMPLE_TYPE(LasiState, LASI_CHIP) #define LASI_IAR 0x10 #define LASI_LPT 0x02000 +#define LASI_AUDIO 0x04000 #define LASI_UART 0x05000 #define LASI_LAN 0x07000 #define LASI_RTC 0x09000 +#define LASI_FDC 0x0A000 #define LASI_PCR 0x0C000 /* LASI Power Control register */ #define LASI_ERRLOG 0x0C004 /* LASI Error Logging register */ From patchwork Fri Feb 9 11:56:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551144 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 CCDF5C48BC0 for ; Fri, 9 Feb 2024 11:58:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVH-0003hr-7H; Fri, 09 Feb 2024 06:57:11 -0500 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 1rYPV3-0003dV-V7 for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:59 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPV1-0002Re-CK for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:56 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B80FFCE200D; Fri, 9 Feb 2024 11:56:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BED17C433C7; Fri, 9 Feb 2024 11:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479810; bh=QEDKIdARto+ZCseIU47VCEGfs+CMVMZ3Lv39zKgePHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=brqT05GkcBmw0v/ZI20VPXfrrPyzVHHDcO1CGTouqIFaUfH9f7riT/vbPIJHpjCN1 UVWT2Srt/PmAAyfrnPmap9vW5sWe3oCvwAFdFVDCbnInh8SS04nVXZhhj/gsfX7+Ap e3nVQvib9W+xnvySO1CA6rIwMpnNVk4+3Ogo9MARXOoZd+7cRv/Qz6Dzd/IJxS/U1T 9xsuA6XHs0Nky+2YHjeX6yyFp7PT90ZBPx1QhtWLlvW964gQNjzDwurJ44wTGasqsu o+D1sc6eLr1CrX4whxw05DNUT9PLK6E2O/ePSfGStv4MwhXrtWcjLT+epc3j94RpTI QsbRgaRrH7lNA== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 08/12] target/hppa: Allow read-access to PSW with rsm 0, reg instruction Date: Fri, 9 Feb 2024 12:56:29 +0100 Message-ID: <20240209115633.55823-9-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller HP-UX 11 and HP ODE tools use the "rsm 0,%reg" instruction in not priviledged code paths to get the current PSW flags. The constant 0 means that no bits of the PSW shall be reset, so this is effectively a read-only access to the PSW. Allow this read-only access even for not privileged code. Signed-off-by: Helge Deller Acked-by: Richard Henderson --- target/hppa/translate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 53ec57ee86..01f3188656 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2156,10 +2156,16 @@ static bool trans_ldsid(DisasContext *ctx, arg_ldsid *a) static bool trans_rsm(DisasContext *ctx, arg_rsm *a) { +#ifdef CONFIG_USER_ONLY CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); -#ifndef CONFIG_USER_ONLY +#else TCGv_i64 tmp; + /* HP-UX 11i and HP ODE use rsm for read-access to PSW */ + if (a->i) { + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + } + nullify_over(ctx); tmp = tcg_temp_new_i64(); From patchwork Fri Feb 9 11:56:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551142 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 447F2C4829E for ; Fri, 9 Feb 2024 11:58:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVH-0003hy-Uw; Fri, 09 Feb 2024 06:57:12 -0500 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 1rYPV5-0003e9-VD for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:57:01 -0500 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPV2-0002Rr-2L for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:58 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 68812CE1FFD; Fri, 9 Feb 2024 11:56:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EFF5C43390; Fri, 9 Feb 2024 11:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479811; bh=bMGiugQoc2DhmTSqm+CZs/LiSubHUzCkUMZHroTlcng=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lycUpyNz4vAwK5BLzO6/naFOOw5BNHMv5BWVRm/4lR7ubxWBwAdkEm2ZPM+HzLTaD +7cE4oh0zRVlJup5LeoKdwd3npZWiZKia3d2s8SyM+p1j549zEpBeoAyDxaEuG2hjk T14l5iZ1yWZFKb5ERrrzWtCtKSLhA/dWRM3mYk+vZUJLlcNMwvnHaO5jkU5NGfBpxm aSERUc02+d689vW62bHRosqQCBulJs7g8cVQ4sG28NivwQ5KxRaYpplMnHpBZL1Ty9 qomhfiu3jO06QjXDvHP/i1xaoLNGg4yO4wmkk+NBRyCBU8rS6MGGhQR+sH/CXhkr8e LJ3dUvNFzCRNA== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 09/12] target/hppa: PDC_BTLB_INFO uses 32-bit ints Date: Fri, 9 Feb 2024 12:56:30 +0100 Message-ID: <20240209115633.55823-10-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2604:1380:40e1:4800::1; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller The BTLB helper function stores the BTLB info (four 32-bit ints) into the memory of the guest. They are only available when emulating a 32-bit CPU in the guest, so use "uint32_t" instead of "target_ulong" here. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson --- target/hppa/mem_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 676c0b3003..66b8fa7d72 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -684,7 +684,7 @@ void HELPER(diag_btlb)(CPUHPPAState *env) case 0: /* return BTLB parameters */ qemu_log_mask(CPU_LOG_MMU, "PDC_BLOCK_TLB: PDC_BTLB_INFO\n"); - vaddr = probe_access(env, env->gr[24], 4 * sizeof(target_ulong), + vaddr = probe_access(env, env->gr[24], 4 * sizeof(uint32_t), MMU_DATA_STORE, mmu_idx, ra); if (vaddr == NULL) { env->gr[28] = -10; /* invalid argument */ From patchwork Fri Feb 9 11:56:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551143 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 20A5BC48297 for ; Fri, 9 Feb 2024 11:58:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVH-0003i0-Vd; Fri, 09 Feb 2024 06:57:12 -0500 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 1rYPV5-0003eA-VM for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:57:01 -0500 Received: from sin.source.kernel.org ([145.40.73.55]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPV3-0002SA-LV for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:59 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 4412DCE2016; Fri, 9 Feb 2024 11:56:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F320C43399; Fri, 9 Feb 2024 11:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479813; bh=WnjkRHA+PxnhJ2hwB5R3kLTKfKDbD/nEu0xgZtuTRoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sSvYS7CpRyQx8urWRkaI3kYCu3Skel/4K0kfm6bYQ3/JvQbhfLpkVkmKGng2Qsrp1 cEmHMIRGPX/zsWnAeqcQFluyEUnHj4HsWSw3kTfcF4aydasN0WB74HJ/2kmf8qnQIh 6uhvVZ1sAXeMh4cw0+VoMj5BCjuD8JN/YhzOqUwj5177tEdkH2J3p75jEAiO3XTxBV f7vBZ2zNnpWE/6QPNO4i/v5DB/iPUk1Fpt0mw2D+JsTGwe193LV144DaQRlGSZ51kK 7bpMenM+vkNDql6K1SWypxKMoPaDvkhP981XzrUKvsQ56CmsxQOyVzdkPpzjuuKpyV gLDwCY2TrCdHg== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/12] hw/net/tulip: add chip status register values Date: Fri, 9 Feb 2024 12:56:31 +0100 Message-ID: <20240209115633.55823-11-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=145.40.73.55; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Sven Schnelle Netbsd isn't able to detect a link on the emulated tulip card. That's because netbsd reads the Chip Status Register of the Phy (address 0x14). The default phy data in the qemu tulip driver is all zero, which means no link is established and autonegotation isn't complete. Therefore set the register to 0x3b40, which means: Link is up, Autonegotation complete, Full Duplex, 100MBit/s Link speed. Also clear the mask because this register is read only. Signed-off-by: Sven Schnelle Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Helge Deller --- hw/net/tulip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/tulip.c b/hw/net/tulip.c index 6d4fb06dad..1f2ef20977 100644 --- a/hw/net/tulip.c +++ b/hw/net/tulip.c @@ -421,7 +421,7 @@ static uint16_t tulip_mdi_default[] = { /* MDI Registers 8 - 15 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, /* MDI Registers 16 - 31 */ - 0x0003, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0003, 0x0000, 0x0001, 0x0000, 0x3b40, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; @@ -429,7 +429,7 @@ static uint16_t tulip_mdi_default[] = { static const uint16_t tulip_mdi_mask[] = { 0x0000, 0xffff, 0xffff, 0xffff, 0xc01f, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0fff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0x0fff, 0x0000, 0xffff, 0xffff, 0x0000, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; From patchwork Fri Feb 9 11:56:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551145 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 F1944C4829F for ; Fri, 9 Feb 2024 11:58:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVL-0003lg-61; Fri, 09 Feb 2024 06:57:15 -0500 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 1rYPV5-0003eB-VV for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:57:01 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPV2-0002SO-8y for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:56:58 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 80F346208D; Fri, 9 Feb 2024 11:56:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE736C433C7; Fri, 9 Feb 2024 11:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479815; bh=/Smd6TlhJ7ils6p1rE0hxNHghyQlnq/f2lHer5smscw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CxS4vvEZ3QLqN4fKSSXR53yJ4IKgq8zMMSQpU1uahDZ36XcZ7/HjcmJ9RdoPpxs0P MPflSsomeg47bTTju/kzsyLmElqITveryHaroNejY1m6OeqeVrdlcS4J7DIbGdOq1p j83o030ltAACUwYELWytXy3ho+0bcJPbCKYeRNpBa0OqijjPSOE4HOf2m3Nc6bvl/7 z/iBq5tVSWyZGROw1+c9LKoBuCi2eb9NLlqFB9nevsVy5or2e9ZG+uml7AG+J3Gmsy jjyqJwlW755ogPCWgHsITGRdYhJvRgx6hRbuavNFiHcbb3/CxynDA44OggMNMTW5lw F8ghC+ldT9HDw== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 11/12] target/hppa: Update SeaBIOS-hppa to version 16 Date: Fri, 9 Feb 2024 12:56:32 +0100 Message-ID: <20240209115633.55823-12-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=139.178.84.217; envelope-from=deller@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -72 X-Spam_score: -7.3 X-Spam_bar: ------- X-Spam_report: (-7.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller SeaBIOS-hppa version 16 news & enhancements: - Initial 64-bit firmware release - Added fault handler to catch and report firmware bugs - Use Qemu's builtin_console_out() via diag 0x101 - parisc-qemu-install Makefile target to install firmware in qemu - Added -fw_cfg opt/OS64,string=3 option Fixes: - Avoid crash when booting without SCSI controller - Avoid possible crashes while detecting LASI LAN & graphics - Don't check layers in PDC_MEM_MAP_HPA, fixes NetBSD - Ensure cache definition does not trigger endless loops - Mark B160L as 32-bit machine in inventory Signed-off-by: Helge Deller Acked-by: Richard Henderson --- roms/seabios-hppa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roms/seabios-hppa b/roms/seabios-hppa index e4eac85880..03774edaad 160000 --- a/roms/seabios-hppa +++ b/roms/seabios-hppa @@ -1 +1 @@ -Subproject commit e4eac85880e8677f96d8b9e94de9f2eec9c0751f +Subproject commit 03774edaad3bfae090ac96ca5450353c641637d1 From patchwork Fri Feb 9 11:56:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13551159 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 3814EC4829B for ; Fri, 9 Feb 2024 11:59:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYPVI-0003ij-Nl; Fri, 09 Feb 2024 06:57:12 -0500 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 1rYPV9-0003et-Qd for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:57:05 -0500 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYPV6-0002Sk-3q for qemu-devel@nongnu.org; Fri, 09 Feb 2024 06:57:02 -0500 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 96FF1CE201A; Fri, 9 Feb 2024 11:56:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DD43C433F1; Fri, 9 Feb 2024 11:56:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707479816; bh=dmm23UrfgEksNR5qCPqYN6vj7hcWMO7WB2mC/roSAbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZJp3TM4ZyrKxsxiFl1wroxTbhZJr8Z4Izc4nyo+S9F+un2LG2Sp7q/aFbEiqrXf4m N2H8bk3skzZ61V9oTm6fC0zuihy3bShPfdQrS6qV92J9jSGKFSqEOvTPza52FbM5nl A0u1yQm5g94GCP/knwrMa4a9UxTHxcUSkzCXa/2PPIz9lhqGDis9ZeAH1S2oPb8wWq cazoyP8CZ3JVz4uJgPYpJpWChzFmgsMEGikch5Ybx9anxs88of/+56MPfqw7xCRIre TXE/HrkyT4KUyVk2fhpiATj20hSS6U+IUj1Ufqwm4FdITlbrng0PKPDqvjuwssSyY2 ReLLp1WyHKCaQ== From: deller@kernel.org To: qemu-devel@nongnu.org Cc: Sven Schnelle , Helge Deller , Richard Henderson , Jason Wang Subject: [PATCH v2 12/12] hw/hppa/machine: Load 64-bit firmware on 64-bit machines Date: Fri, 9 Feb 2024 12:56:33 +0100 Message-ID: <20240209115633.55823-13-deller@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209115633.55823-1-deller@kernel.org> References: <20240209115633.55823-1-deller@kernel.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2604:1380:40e1:4800::1; envelope-from=deller@kernel.org; helo=sin.source.kernel.org X-Spam_score_int: -45 X-Spam_score: -4.6 X-Spam_bar: ---- X-Spam_report: (-4.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.213, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Helge Deller Load the 64-bit SeaBIOS-hppa firmware by default when running on a 64-bit machine. This will enable us to later support more than 4GB of RAM and is required that the OS (or PALO bootloader) will start or install a 64-bit kernel instead of a 32-bit kernel. Note that SeaBIOS-hppa v16 provides the "-fw_cfg opt/OS64,string=3" option with which the user can control what the firmware shall report back to the OS: Support of 32-bit OS, support of a 64-bit OS, or support for both (default). Signed-off-by: Helge Deller Acked-by: Richard Henderson --- hw/hppa/machine.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index eb78c46ff1..a47baa572d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -333,6 +333,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; + const char *firmware = machine->firmware; MachineClass *mc = MACHINE_GET_CLASS(machine); DeviceState *dev; PCIDevice *pci_dev; @@ -408,9 +409,13 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, /* Load firmware. Given that this is not "real" firmware, but one explicitly written for the emulation, we might as - well load it directly from an ELF image. */ - firmware_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, - machine->firmware ?: "hppa-firmware.img"); + well load it directly from an ELF image. Load the 64-bit + firmware on 64-bit machines by default if not specified + on command line. */ + if (!firmware) { + firmware = lasi_dev ? "hppa-firmware.img" : "hppa-firmware64.img"; + } + firmware_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware); if (firmware_filename == NULL) { error_report("no firmware provided"); exit(1);