From patchwork Tue May 9 18:24:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 13236080 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 589FAC7EE22 for ; Tue, 9 May 2023 18:29:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 880B510E191; Tue, 9 May 2023 18:29:46 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id A465E10E191 for ; Tue, 9 May 2023 18:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1683656982; i=deller@gmx.de; bh=GiWI3Edh7sWglYAYGfC4soQTRvcJh05ZXPMtNAs7CPo=; h=X-UI-Sender-Class:Date:From:To:Subject; b=mdIBE5Ysybm1WhiIDRAwHD2YByI9KCNrLSR6RfYoceMM/DQHmDOF0GaJpc14l7mJu o/XYr8Kfl6Y21zvjKOacFnasExCiXQIZcKzeQNP5Bu4mcjGnJumbMHihuiXtoZQPo8 gftqW9Kub2EFBCVZ+O2197afu2ISu5iRtlDK+9mWz48KY+evbo6Qkhk/aFW07+9uPo 7E8COG7BX4WT/+OSTc1q4xBtTLlnUjMNLdobXf631bwDZ1FbquqSrcV/xG5LMIMAfu SAKk+xkQVO/bJOMuHt4otu2oubCUt5WOWWKEDk0xJPkHtB10luf+ylIBqFfwLWPQg5 i6TP3kHHJMXoA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from p100 ([94.134.153.17]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MNbkp-1pY3EN0BHH-00P93o; Tue, 09 May 2023 20:24:28 +0200 Date: Tue, 9 May 2023 20:24:26 +0200 From: Helge Deller To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-parisc@vger.kernel.org Subject: [PATCH v2] console/parisc: Fix STI console on 64-bit only machines Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Provags-ID: V03:K1:MdiJgZwW+w4XLsQvnDIcAS/cQOITDS/Fpg79dBvIw3uUj3Aomu6 CUNlne8ygvlwkIEGYXstDGt4Aq5qNZHroPjjkV0Y6tAJq6FjhYSItx8kHMuopRjNa2GwaJO kXEfhSBL+3KhTwtBkEaJ/9ebAeHIA2ITxzCx8n8novgLtN0d4zlKC8giv1EnCRplKLQeu79 25nL6qXGQRNNijyvqCxGA== UI-OutboundReport: notjunk:1;M01:P0:PqQ4GiWJ2fw=;FktPBVbOVtgnu6TBOMcute6oij/ 4wIC5u0YIMcfKgUgCdkcO3WVSH574perVvkra/BmuHBd8CdGTpO1bq7Dr/AT3PKrfxtJtA+To oR4OmaA9DdhMzPoUT9syRSnP91Zc1jA/wf0+f1p2X1Itb+c87EvEVsJDQPOSVHuu/dB+8vmWr lgkGY+47Z/RQtmGZAQKsYRb+wlVzUSzc5Xg5sqoq/yo2PL9wOwRMWNutAIPz9TTykcCbHeJwM jokqIwntjkLUzyr2IjS+MHYN6NBiM8K3FeIhShDkxU6rBt5GleJg5GT4yxpHNKaEE8/WGBm+P YV/jVsjLpGQvM+i2vzi13w4P1zfDTsjL7zguc0ysXn8B7j47dPSrT6f0Ucg8Ud36RCmfUiNTv NHEpUlVB8gM30GNFMTDGJR/zyr4LN9kZGZ+WH/HOIKBX9n1BtP4m7A8qebbwLKweQiveQ5lV/ +xr0Pi5evKSKNmj8Zef65GvvDkhi0BFfw6Pk3GnFFt6MIfiDm8G1lvRhNSjgUs9iSFf3PiI0m fJGHlRR0SOaDSrVz6m7DSodWGTK/muVPt+iF4bZl4RXIHRga1MoBvqz9XAttKeV6MfUCTmdd5 JGD4NMr6j2B0i9zXfjcU+U+6uHErwZsmZzviJfw1ZHYwMMvR6n8WOIpSuJa1pY2IQi/9MzZ/M 3HIWThtjBjS1BUCnTSSUjokW/Apki5hk+eWcSOSQRKgy2LCtN1YYj0jV/RjEswhMxXoIBiCUA DTDeWZ3QIFeJaY6MlUpDRIFKv2p/BqaCQJjBnvjTEitSjiOGv56ljOChOViStVBpgW43UNyTA q9GovSvJ2+fEMKp4UgBR7qTYAEJpu6F1bKjB5cPpaF9EDbzJlGFV+4dOJvUemHSbYfajhSI1L KOhvykEke4502h/TjqfjH8eeEMbUMl7ypgjWH5KdHzhIEb3Nfg86iDs+usmx12de7zB2rQEJq Zu4WhW4guW/fS8TQSdL7ZL69RBI= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix the STI console to be able to execute either the 64-bit STI ROM code or the 32-bit STI ROM code. This is necessary on 64-bit only machines (e.g. C8000 workstation) which otherwise won't show the STI text console on HP graphic cards like Visualize-FX5/FX10/FXe. When calling 32-bit code from a 64-bit kernel one may need to copy contents on the CPU stack from high memory down below the 4GB limit. Signed-off-by: Helge Deller --- v2: Forward-ported to apply cleanly on drm-misc-next git tree diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h index 2b4fad8328e8..269b9a159f01 100644 --- a/arch/parisc/include/asm/pdc.h +++ b/arch/parisc/include/asm/pdc.h @@ -88,8 +88,8 @@ int pdc_iodc_print(const unsigned char *str, unsigned count); void pdc_emergency_unlock(void); int pdc_sti_call(unsigned long func, unsigned long flags, - unsigned long inptr, unsigned long outputr, - unsigned long glob_cfg); + unsigned long inptr, unsigned long outputr, + unsigned long glob_cfg, int do_call64); int __pdc_cpu_rendezvous(void); void pdc_cpu_rendezvous_lock(void); diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c index cc124d9f1f7f..71ef1640db5a 100644 --- a/arch/parisc/kernel/firmware.c +++ b/arch/parisc/kernel/firmware.c @@ -1389,17 +1389,24 @@ int pdc_iodc_getc(void) } int pdc_sti_call(unsigned long func, unsigned long flags, - unsigned long inptr, unsigned long outputr, - unsigned long glob_cfg) + unsigned long inptr, unsigned long outputr, + unsigned long glob_cfg, int do_call64) { - int retval; + int retval = 0; unsigned long irqflags; - spin_lock_irqsave(&pdc_lock, irqflags); - retval = real32_call(func, flags, inptr, outputr, glob_cfg); - spin_unlock_irqrestore(&pdc_lock, irqflags); + spin_lock_irqsave(&pdc_lock, irqflags); + if (IS_ENABLED(CONFIG_64BIT) && do_call64) { +#ifdef CONFIG_64BIT + retval = real64_call(func, flags, inptr, outputr, glob_cfg); +#else + WARN_ON(1); +#endif + } else + retval = real32_call(func, flags, inptr, outputr, glob_cfg); + spin_unlock_irqrestore(&pdc_lock, irqflags); - return retval; + return retval; } EXPORT_SYMBOL(pdc_sti_call); diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c index baca6974e288..fe54ca8726e6 100644 --- a/drivers/video/fbdev/stifb.c +++ b/drivers/video/fbdev/stifb.c @@ -71,9 +71,9 @@ #include