From nobody Fri Apr 19 18:37:07 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 1543420283382911.314643286675; Wed, 28 Nov 2018 07:51:23 -0800 (PST) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.88) (envelope-from ) id 1gS26E-0004kl-4b; Wed, 28 Nov 2018 16:50:02 +0100 Received: from userp2130.oracle.com ([156.151.31.86]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88) (envelope-from ) id 1gS25x-0004kJ-Pm for seabios@seabios.org; Wed, 28 Nov 2018 16:49:59 +0100 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wASFhsmF012858; Wed, 28 Nov 2018 15:50:23 GMT Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2nxx2ub2au-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 15:50:23 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wASFoHAq023734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Nov 2018 15:50:17 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wASFoHMe005126; Wed, 28 Nov 2018 15:50:17 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Nov 2018 07:50:16 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=hGj9CNn1+sFNFdYscusOGa3tK/6lQpV/SBh+c5Upwcs=; b=GuQThEtwBYIUxFAybwM5k09LiVZrUU/F/WxZw9kHs/7qAclLYCwnPoYsCRhYdk1aPfeQ EhPt6ChtTdL/tzrP4SbOTa2Jsu/mANjgZpNszwWjc3iX0v1PgvzluUYcS+rFzQ7JKSpn jYq/gy5D0uEO7V2zXJ/qH0EqQnhT7q3HXhv0JWzRm3MODX/okhAG+huN30UYuNqZdK7l vpN8vlBCMjbaO+x5RVmMOD22/AGZsvCaNst8XAk6uNNNTqh4j0Z9kpxfajuHOiNnTIdj nGzjlqrRoLFmePN+nWnWxO3Jn5STM9J4kvhM18O38O0kY5fqoUFyQYVFvai/rlhUZZsH qA== From: Liran Alon To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Wed, 28 Nov 2018 17:50:01 +0200 Message-Id: <20181128155001.24829-1-liran.alon@oracle.com> X-Mailer: git-send-email 2.16.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9091 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811280138 X-Spam-Score: -5.1 (-----) Subject: [SeaBIOS] [PATCH] mpt-scsi: Align MPT request to 8 bytes X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nikita Leshchenko MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Nikita Leshchenko When mpt-scsi receives a SCSI message, it wraps it in a MPT request message and writes it's address to an IO port to be added to the request queue. This MPT request is allocated on the stack. Previous to this commit, the request is aligned to 4 bytes. However, VirtualBox LSI53c1030 device emulation aligns the request address to 8 bytes. Therefore, this commit change alignment of request to 8 bytes. VirtualBox source code which handles this is at Devices/Storage/DevLsiLogicSCSI.cpp. lsilogicRegisterWrite() LSILOGIC_REG_REQUEST_QUEUE handler adds the request to the queue (pRequestQueueBase). lsilogicR3Worker() reads request from pRequestQueueBase and aligns it to 8 bytes (u32RequestMessageFrameDesc & ~0x07). Reviewed-by: Liran Alon Reviewed-by: Mark Kanda Signed-off-by: Nikita Leshchenko --- src/hw/mpt-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hw/mpt-scsi.c b/src/hw/mpt-scsi.c index 1faede6aec6f..9966ca28054f 100644 --- a/src/hw/mpt-scsi.c +++ b/src/hw/mpt-scsi.c @@ -124,7 +124,7 @@ mpt_scsi_cmd(u32 iobase, struct disk_op_s *op, struct scsi_req { MptSCSIIORequest_t scsi_io; MptSGEntrySimple32_t sge; - } __attribute__((packed, aligned(4))) req =3D { + } __attribute__((packed, aligned(8))) req =3D { .scsi_io =3D { .TargetID =3D target, .Bus =3D 0, --=20 2.16.1 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios