From nobody Tue Feb 10 09:24:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687785808; cv=none; d=zohomail.com; s=zohoarc; b=XkwnkRR1wWigh+oM1w/KNRhhAqOX0XOKFLIOZliI4Uc0502+BIcm1hFJiIK7MzDpGeKESPZkU/eM6u/HUcgTddSEtJAlUHcScjLIOdOd3EXrfdcPYVwzjM2fTl7t6dgtRYLm4sVMSJgT16ks3i3D/lAPrYIy5EXNI8pDJR6HnRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687785808; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dWRy1ksAsummucnx7NYUcmOpyTJTYc9CHbUopFlDLQM=; b=cedcgIwexaATSlfY3o4HvMWYMxUGHux/B7BZs13uV+gBm0RWk+kUjdFlRCpkWLZWGfsfVFXg/izU4ayHT9chVYN+Pdo3RyplGGeHFUnsHKbSX7fh1jzQfaJ5YpE7/nufojFJ720fe0U/mvGtdQwHv4G1qVmfMiTXeRtwiEE/4rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168778580812834.14093471898366; Mon, 26 Jun 2023 06:23:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDmAN-0001G7-0I; Mon, 26 Jun 2023 09:22:03 -0400 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 1qDmAE-0001Bt-UW for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDmAA-000784-Qc for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:54 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-AxTbrPg0PSmkgaCFuLGSmw-1; Mon, 26 Jun 2023 09:21:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 127E4280AA32; Mon, 26 Jun 2023 13:21:43 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA6EE1121319; Mon, 26 Jun 2023 13:21:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687785710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dWRy1ksAsummucnx7NYUcmOpyTJTYc9CHbUopFlDLQM=; b=dKCfc/qah0wmKw+IOO61YolRvjYKiBTD8qJ3DWxTWzHonS2ajxEGFfO/3ULiZtzug5i/YD WfXM1gnbuUx9L4F3oD+ZW6Se6WSDhJLPGMd5J5m2+hmyrX7IfCbg4+dK7cJVqR81zvSKOG NozHinjIoVmgKQXgHSZfKKKDerhmrUY= X-MC-Unique: AxTbrPg0PSmkgaCFuLGSmw-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Christian Borntraeger , mrezanin@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 1/4] pc-bios/s390-ccw: Fix indentation in start.S Date: Mon, 26 Jun 2023 15:21:35 +0200 Message-Id: <20230626132138.87668-2-thuth@redhat.com> In-Reply-To: <20230626132138.87668-1-thuth@redhat.com> References: <20230626132138.87668-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687785808557100001 Content-Type: text/plain; charset="utf-8" start.S is currently indented with a mixture of spaces and tabs, which is quite ugly. QEMU coding style says indentation should be 4 spaces, and this is also what we are using in the assembler files in the tests/tcg/s390x/ folder already, so let's adjust start.S accordingly. Signed-off-by: Thomas Huth Reviewed-by: C=C3=A9dric Le Goater --- pc-bios/s390-ccw/start.S | 136 +++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index 6072906df4..d29de09cc6 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/start.S @@ -10,37 +10,37 @@ * directory. */ =20 - .globl _start + .globl _start _start: =20 - larl %r15, stack + 0x8000 /* Set up stack */ + larl %r15,stack + 0x8000 /* Set up stack */ =20 - /* clear bss */ - larl %r2, __bss_start - larl %r3, _end - slgr %r3, %r2 /* get sizeof bss */ - ltgr %r3,%r3 /* bss empty? */ - jz done - aghi %r3,-1 - srlg %r4,%r3,8 /* how many 256 byte chunks? */ - ltgr %r4,%r4 - lgr %r1,%r2 - jz remainder + /* clear bss */ + larl %r2,__bss_start + larl %r3,_end + slgr %r3,%r2 /* get sizeof bss */ + ltgr %r3,%r3 /* bss empty? */ + jz done + aghi %r3,-1 + srlg %r4,%r3,8 /* how many 256 byte chunks? */ + ltgr %r4,%r4 + lgr %r1,%r2 + jz remainder loop: - xc 0(256,%r1),0(%r1) - la %r1,256(%r1) - brctg %r4,loop + xc 0(256,%r1),0(%r1) + la %r1,256(%r1) + brctg %r4,loop remainder: - larl %r2,memsetxc - ex %r3,0(%r2) + larl %r2,memsetxc + ex %r3,0(%r2) done: - /* set up a pgm exception disabled wait psw */ - larl %r2, disabled_wait_psw - mvc 0x01d0(16), 0(%r2) - j main /* And call C */ + /* set up a pgm exception disabled wait psw */ + larl %r2,disabled_wait_psw + mvc 0x01d0(16),0(%r2) + j main /* And call C */ =20 memsetxc: - xc 0(1,%r1),0(%r1) + xc 0(1,%r1),0(%r1) =20 =20 /* @@ -48,11 +48,11 @@ memsetxc: * * stops the current guest cpu. */ - .globl disabled_wait + .globl disabled_wait disabled_wait: - larl %r1,disabled_wait_psw - lpswe 0(%r1) -1: j 1b + larl %r1,disabled_wait_psw + lpswe 0(%r1) +1: j 1b =20 =20 /* @@ -60,61 +60,61 @@ disabled_wait: * * eats one sclp interrupt */ - .globl consume_sclp_int + .globl consume_sclp_int consume_sclp_int: - /* enable service interrupts in cr0 */ - stctg %c0,%c0,0(%r15) - oi 6(%r15),0x2 - lctlg %c0,%c0,0(%r15) - /* prepare external call handler */ - larl %r1, external_new_code - stg %r1, 0x1b8 - larl %r1, external_new_mask - mvc 0x1b0(8),0(%r1) - /* load enabled wait PSW */ - larl %r1, enabled_wait_psw - lpswe 0(%r1) + /* enable service interrupts in cr0 */ + stctg %c0,%c0,0(%r15) + oi 6(%r15),0x2 + lctlg %c0,%c0,0(%r15) + /* prepare external call handler */ + larl %r1,external_new_code + stg %r1,0x1b8 + larl %r1,external_new_mask + mvc 0x1b0(8),0(%r1) + /* load enabled wait PSW */ + larl %r1,enabled_wait_psw + lpswe 0(%r1) =20 /* * void consume_io_int(void) * * eats one I/O interrupt */ - .globl consume_io_int + .globl consume_io_int consume_io_int: - /* enable I/O interrupts in cr6 */ - stctg %c6,%c6,0(%r15) - oi 4(%r15), 0xff - lctlg %c6,%c6,0(%r15) - /* prepare i/o call handler */ - larl %r1, io_new_code - stg %r1, 0x1f8 - larl %r1, io_new_mask - mvc 0x1f0(8),0(%r1) - /* load enabled wait PSW */ - larl %r1, enabled_wait_psw - lpswe 0(%r1) + /* enable I/O interrupts in cr6 */ + stctg %c6,%c6,0(%r15) + oi 4(%r15), 0xff + lctlg %c6,%c6,0(%r15) + /* prepare i/o call handler */ + larl %r1,io_new_code + stg %r1,0x1f8 + larl %r1,io_new_mask + mvc 0x1f0(8),0(%r1) + /* load enabled wait PSW */ + larl %r1,enabled_wait_psw + lpswe 0(%r1) =20 external_new_code: - /* disable service interrupts in cr0 */ - stctg %c0,%c0,0(%r15) - ni 6(%r15),0xfd - lctlg %c0,%c0,0(%r15) - br %r14 + /* disable service interrupts in cr0 */ + stctg %c0,%c0,0(%r15) + ni 6(%r15),0xfd + lctlg %c0,%c0,0(%r15) + br %r14 =20 io_new_code: - /* disable I/O interrupts in cr6 */ - stctg %c6,%c6,0(%r15) - ni 4(%r15), 0x00 - lctlg %c6,%c6,0(%r15) - br %r14 + /* disable I/O interrupts in cr6 */ + stctg %c6,%c6,0(%r15) + ni 4(%r15),0x00 + lctlg %c6,%c6,0(%r15) + br %r14 =20 - .align 8 + .align 8 disabled_wait_psw: - .quad 0x0002000180000000,0x0000000000000000 + .quad 0x0002000180000000,0x0000000000000000 enabled_wait_psw: - .quad 0x0302000180000000,0x0000000000000000 + .quad 0x0302000180000000,0x0000000000000000 external_new_mask: - .quad 0x0000000180000000 + .quad 0x0000000180000000 io_new_mask: - .quad 0x0000000180000000 + .quad 0x0000000180000000 --=20 2.39.3 From nobody Tue Feb 10 09:24:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687785752; cv=none; d=zohomail.com; s=zohoarc; b=fhrbeGhxYroJMnaQqGRN0OYgm7dyl7kdHdkHhUKf9hXmbfBsWcEhN2rTXXjEWq7hhXHulba7NnBHwzXjQA2k1x5IhW/TOkw40RbEiyeWqXLOpeeBKwni/dbQryWelH+bck7fzLh8iEan+Mw03dNJnoMSxrHa7EExSaeSVTi+L0g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687785752; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iDhtcNchbuN0ZviXnaLD7HMWePfnNoGcw521x/QpHTc=; b=iiTjJzZr0N/eDCBtMWqcT2gUYVpNBWUWbMux/SzRf/K9+009UAv4kT2wnq+w0jyVjFp2pWAgu528r7W3rIW2Re5LvpcxD9kRIcsP4Fr8WvWlj7nsuY2CocMw+8tOp3+7/F4FqMcFLdsdReUlWFNtugD+fPW//Z4bzry/7HbF1aU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1687785752442274.44302370405035; Mon, 26 Jun 2023 06:22:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDmAK-0001Dy-If; Mon, 26 Jun 2023 09:22:00 -0400 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 1qDmAD-00017s-7m for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDmAA-00077Y-9d for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:52 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-669-uz7xY1uLM3-HTz03c8SXBQ-1; Mon, 26 Jun 2023 09:21:45 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D3B93849522; Mon, 26 Jun 2023 13:21:44 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 571DD1121319; Mon, 26 Jun 2023 13:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687785706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iDhtcNchbuN0ZviXnaLD7HMWePfnNoGcw521x/QpHTc=; b=igFV3Fd8PdV50kNrfkjS0b5HpSOM/aCQJldxfpv64p2yaoWtc3NmUemjdYqABN0+oDYxRt qJ6lhJqOgPhGLAMb2Fp5cD48Wy/uxTdCeT6YV+RRVtccDQmoUxZkPoKGEbsJ0XEQG5VVYM aoP8h93sE9XolJXC0FvycpQyjpt9mqw= X-MC-Unique: uz7xY1uLM3-HTz03c8SXBQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Christian Borntraeger , mrezanin@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 2/4] pc-bios/s390-ccw: Provide space for initial stack frame in start.S Date: Mon, 26 Jun 2023 15:21:36 +0200 Message-Id: <20230626132138.87668-3-thuth@redhat.com> In-Reply-To: <20230626132138.87668-1-thuth@redhat.com> References: <20230626132138.87668-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687785756269100001 Content-Type: text/plain; charset="utf-8" Providing the space of a stack frame is the duty of the caller, so we should reserve 160 bytes before jumping into the main function. Otherwise the main() function might write past the stack array. While we're at it, add a proper STACK_SIZE macro for the stack size instead of using magic numbers (this is also required for the following patch). Signed-off-by: Thomas Huth Reviewed-by: Christian Borntraeger Reviewed-by: C=C3=A9dric Le Goater --- pc-bios/s390-ccw/start.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index d29de09cc6..29b0a9ece0 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/start.S @@ -10,10 +10,12 @@ * directory. */ =20 +#define STACK_SIZE 0x8000 + .globl _start _start: =20 - larl %r15,stack + 0x8000 /* Set up stack */ + larl %r15,stack + STACK_SIZE - 160 /* Set up stack */ =20 /* clear bss */ larl %r2,__bss_start --=20 2.39.3 From nobody Tue Feb 10 09:24:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687785776; cv=none; d=zohomail.com; s=zohoarc; b=NpxFyP0I9TyLVbU37mD/oDy+pX3pXw8bzF16K3Lwcc0dAsSxEokNzxOP/J0JGvCSAc32oFQHv3VsuKhr5itv4vTtrihmqU+djqIZ6A1D0SZ3s0HDFwpY0g7iP5CARL3ePKtmBl5hMKNEOy3NGvrawfoxbJ965lfjVvn/pquEo1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687785776; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ed4LIidxenKTEJmd9FPCsvy7s4vbC9dPPSlI64zMutc=; b=Pa9ioe/nbrrkpq9a3t48S+JSPb1vI+7XZbF/mcV288LXzFi0VtxM2/BB7pjod863t3DPWkUKqvJaDBxfGhrjvJnCTkBXA9NVJNaw7zSgUzgnB0whj0ibKukGDO8FKjYb/vHSa8KqoObShX+5J6qHCAJ8CMWLQTDQogiJgwvQhaI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16877857761033.1281358316902015; Mon, 26 Jun 2023 06:22:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDmAM-0001Fi-QL; Mon, 26 Jun 2023 09:22:02 -0400 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 1qDmAE-0001Bq-Mk for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDmAA-000782-IH for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-629-xokr8ATIO8C3erWG1cOg3Q-1; Mon, 26 Jun 2023 09:21:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F0AC8631DB; Mon, 26 Jun 2023 13:21:46 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5B141121319; Mon, 26 Jun 2023 13:21:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687785709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ed4LIidxenKTEJmd9FPCsvy7s4vbC9dPPSlI64zMutc=; b=iKoGVGrKwB3gjt2vGpcLj385NQi2Uvu+sWve9vXAGkn2izgPcBJKh2/bgn4RTyW96ntdC2 W/bPR/T2JCzdcr+FAaOmVQ3R2zC6oZfwHAfUKQg5uRXBGft691sjl+ORM/c/+kcnGpkJiB z3mZXv9TXT+z5uQ+7buKOi3D9zTps+w= X-MC-Unique: xokr8ATIO8C3erWG1cOg3Q-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Christian Borntraeger , mrezanin@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 3/4] pc-bios/s390-ccw: Move the stack array into start.S Date: Mon, 26 Jun 2023 15:21:37 +0200 Message-Id: <20230626132138.87668-4-thuth@redhat.com> In-Reply-To: <20230626132138.87668-1-thuth@redhat.com> References: <20230626132138.87668-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687785786743100001 Content-Type: text/plain; charset="utf-8" The stack array is only referenced from the start-up code (which is shared between the s390-ccw.img and the s390-netboot.img), but it is currently declared twice, once in main.c and once in netmain.c. It makes more sense to declare this in start.S instead - which will also be helpful in the next patch, since we need to mention the .bss section in start.S in that patch. While we're at it, let's also drop the huge alignment of the stack, since there is no technical requirement for aligning it to page boundaries. Signed-off-by: Thomas Huth Acked-by: Christian Borntraeger --- pc-bios/s390-ccw/s390-ccw.h | 1 - pc-bios/s390-ccw/main.c | 1 - pc-bios/s390-ccw/netmain.c | 1 - pc-bios/s390-ccw/start.S | 5 +++++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h index b88e0550ab..91afcbbca9 100644 --- a/pc-bios/s390-ccw/s390-ccw.h +++ b/pc-bios/s390-ccw/s390-ccw.h @@ -55,7 +55,6 @@ void consume_io_int(void); /* main.c */ void write_subsystem_identification(void); void write_iplb_location(void); -extern char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); unsigned int get_loadparm_index(void); void main(void); =20 diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index a2def83e82..5506798098 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -17,7 +17,6 @@ #include "virtio-scsi.h" #include "dasd-ipl.h" =20 -char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); static SubChannelId blk_schid =3D { .one =3D 1 }; static char loadparm_str[LOADPARM_LEN + 1]; QemuIplParameters qipl; diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index 056e93a818..5cd619b2d6 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -50,7 +50,6 @@ void write_iplb_location(void) {} /* STSI 3.2.2 offset of first vmdb + offset of uuid inside vmdb */ #define STSI322_VMDB_UUID_OFFSET ((8 + 12) * 4) =20 -char stack[PAGE_SIZE * 8] __attribute__((aligned(PAGE_SIZE))); IplParameterBlock iplb __attribute__((aligned(PAGE_SIZE))); static char cfgbuf[2048]; =20 diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index 29b0a9ece0..47ef6e8aa8 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/start.S @@ -120,3 +120,8 @@ external_new_mask: .quad 0x0000000180000000 io_new_mask: .quad 0x0000000180000000 + +.bss + + .align 16 + .lcomm stack,STACK_SIZE --=20 2.39.3 From nobody Tue Feb 10 09:24:54 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1687785773; cv=none; d=zohomail.com; s=zohoarc; b=bGY+9z8lW2iEHlytV0PdGkJshdLKHTv5Jhx1G8h7OOHJsj7Gtl8FhloycyH6oJSe7uQ8JtHhq7aIm1mqDhAabTBHV2pq+QVatRI85qzLWKGO0W4T2t/zSHbqN/OX3uo8WNnd24aNV4IXebChL3+pSN4t5C8j2V3552QEr3LYfCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687785773; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nto+TK2+mqa60zhuesXHXkq+lj+CXR/7b9JLIIpf5kw=; b=FN9KaS+hgkU4RqG/v6/4+IN/gssyjWEqIZkwN9Wn4aPmUiksQZvMN1yseJCp3xPaqAsZ/GnUzf+77x2aDFwESilPs8zt6AtiPrvjVroxvTPiRoi+rUj/limJGFRaACCm4ULDhylNaKsS7efEE9knq8RuQCICi5VDlIfVrA2ZlnI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1687785773360169.3978294017412; Mon, 26 Jun 2023 06:22:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDmAL-0001FL-EL; Mon, 26 Jun 2023 09:22:01 -0400 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 1qDmAD-00018v-H4 for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDmAA-00077y-Bi for qemu-devel@nongnu.org; Mon, 26 Jun 2023 09:21:53 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-235-FHgDxLYxNn6alapAtjmuEQ-1; Mon, 26 Jun 2023 09:21:47 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4EBE88C80E6; Mon, 26 Jun 2023 13:21:47 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D5EA1121319; Mon, 26 Jun 2023 13:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687785709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nto+TK2+mqa60zhuesXHXkq+lj+CXR/7b9JLIIpf5kw=; b=hKKOrzf7/o3jOdp9Ekoh9pQGyvF9EWL2DFpk7O5nOjM0veWsjWiH6cd467qoTzOUfgWy7m m/9MXz+Z0LDgK7NiKqMiguX+ut/YQxYRMhJX473VSWQtoma1qUcKa+EbhYEYxSHQ6l6Iqp xwrEMVofjOIsCocNdBJL2CJZd7YM84I= X-MC-Unique: FHgDxLYxNn6alapAtjmuEQ-1 From: Thomas Huth To: qemu-devel@nongnu.org Cc: qemu-s390x@nongnu.org, Christian Borntraeger , mrezanin@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH 4/4] pc-bios/s390-ccw: Don't use __bss_start with the "larl" instruction Date: Mon, 26 Jun 2023 15:21:38 +0200 Message-Id: <20230626132138.87668-5-thuth@redhat.com> In-Reply-To: <20230626132138.87668-1-thuth@redhat.com> References: <20230626132138.87668-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1687785773889100003 Content-Type: text/plain; charset="utf-8" start.S currently cannot be compiled with Clang 16 and binutils 2.40: ld: start.o(.text+0x8): misaligned symbol `__bss_start' (0xc1e5) for relocation R_390_PC32DBL According to the built-in linker script of ld, the symbol __bss_start can actually point *before* the .bss section and does not need to have any alignment, so in certain situations (like when using the internal assembler of Clang), the __bss_start symbol can indeed be unaligned and thus it is not suitable for being used with the "larl" instruction that needs an address that is at least aligned to halfwords. The problem went unnoticed so far since binutils <=3D 2.39 did not check the alignment, but starting with binutils 2.40, such unaligned addresses are now refused. Fix it by using the real start address of the .bss section instead. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D2216662 Reported-by: Miroslav Rezanina Suggested-by: Nick Clifton Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/start.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/start.S b/pc-bios/s390-ccw/start.S index 47ef6e8aa8..6747d4c600 100644 --- a/pc-bios/s390-ccw/start.S +++ b/pc-bios/s390-ccw/start.S @@ -18,7 +18,7 @@ _start: larl %r15,stack + STACK_SIZE - 160 /* Set up stack */ =20 /* clear bss */ - larl %r2,__bss_start + larl %r2,.bss larl %r3,_end slgr %r3,%r2 /* get sizeof bss */ ltgr %r3,%r3 /* bss empty? */ --=20 2.39.3