From nobody Sun Apr 6 22:23:07 2025 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=samsung.com ARC-Seal: i=1; a=rsa-sha256; t=1736239482; cv=none; d=zohomail.com; s=zohoarc; b=QLgJfv4rH9sGYquTfpkl3tK8E5xIcXkQWkXQbvHP+Zt7AijGJ3e/7zYDQ5Rtys6xLF3v/UeZ4dVO3/S2xb8A56FH96+vW2m9MX7+vlrMiTtS2sGS/7GrTK5RAZChJ58reO65T/UF1Ik0M3bXOh/w5bQB7liElCcujCps9KlpEHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1736239482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=qMVTTSrMbBxUY+BObY6KkjD7t/14XIBA7i8I9M0jDso=; b=eaGLjX2fF3oZwoSPYiv1I75jT/Eln786wUzgh4zGAo+535j+GyoQCrVSs30vj8bBKvl/ks6lCzlpBvhpmR4JRMqHJKwCWiuvulPori8CsZ83aeT0zSW2xcZspmzQfefpRyM+REpDAcHG1BVihOb+cd6Tp2xWTaXV+3CnxEmLJTg= 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 1736239482853600.9162143403148; Tue, 7 Jan 2025 00:44:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tV5CG-0003jk-JX; Tue, 07 Jan 2025 03:44:20 -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 1tV5CE-0003jP-NS for qemu-devel@nongnu.org; Tue, 07 Jan 2025 03:44:19 -0500 Received: from mailout1.samsung.com ([203.254.224.24]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV5C6-0008VZ-7y for qemu-devel@nongnu.org; Tue, 07 Jan 2025 03:44:18 -0500 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20250107084357epoutp01c1e91fd854fdfd6159a96bada791fa34~YXJHMCndD2624526245epoutp01k for ; Tue, 7 Jan 2025 08:43:57 +0000 (GMT) Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20250107084357epcas2p490bd9a8aa015af73bb28e7acab61acce~YXJG7FdYJ2756227562epcas2p44; Tue, 7 Jan 2025 08:43:57 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.69]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4YS4Mw3ZpVz4x9Pr; Tue, 7 Jan 2025 08:43:56 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id CD.97.22105.C49EC776; Tue, 7 Jan 2025 17:43:56 +0900 (KST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20250107084357epoutp01c1e91fd854fdfd6159a96bada791fa34~YXJHMCndD2624526245epoutp01k DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1736239437; bh=qMVTTSrMbBxUY+BObY6KkjD7t/14XIBA7i8I9M0jDso=; h=Subject:Reply-To:From:To:CC:Date:References:From; b=UJU7d0kTj8L1VYzqUCV5YSm01O4f2ElCRTIlqCtuSkacvEzwpFxTNizyc967V8mKT Nwwnac3yx8EE16/9uExVWGV60dBjY2mtJRLmIfPw1Wa6j4K4Y9/r7X0AtcRRUUVvyT SZOiqmafyA+X/Oz0w7rYKsPP6aW5o+wrgM3e/PTk= X-AuditID: b6c32a47-fd1c970000005659-12-677ce94ce160 Mime-Version: 1.0 Subject: [PATCH v2] hw/ufs: Adjust value to match CPU's endian format From: Keoseong Park To: Jeuk Kim , "philmd@linaro.org" , "qemu-devel@nongnu.org" CC: "farosas@suse.de" , "lvivier@redhat.com" , "pbonzini@redhat.com" X-Priority: 3 X-Content-Kind-Code: NORMAL X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20250107084356epcms2p2af4d86432174d76ea57336933e46b4c3@epcms2p2> Date: Tue, 07 Jan 2025 17:43:56 +0900 X-CMS-MailID: 20250107084356epcms2p2af4d86432174d76ea57336933e46b4c3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y X-CPGSPASS: Y X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmphk+LIzCtJLcpLzFFi42LZdljTQtfnZU26wb3lEhYvD2lavH6xnNni /tZrjBafGqQs9m/7x2qxZoWwxfHeHSwO7B53ru1h83hybTOTx/t9V9k8+rasYvTYfLo6gDUq 2yYjNTEltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMH6AYlhbLE nFKgUEBicbGSvp1NUX5pSapCRn5xia1SakFKToF5gV5xYm5xaV66Xl5qiZWhgYGRKVBhQnZG /7xtzAW3hCqets5lbWB8JdjFyMkhIWAisbTrLVsXIxeHkMAORom7L28DORwcvAKCEn93CIPU CAu4Siz/vo0JxBYSUJLoWriVGSJuILFu+h4wm01AT2LK7zuMIHNEBBoZJbb13WAFcZhBnIsr PrNCbOOVmNH+lAXClpbYvnwrI4StIfFjWS8zhC0qcXP1W3YY+/2x+VA1IhKt985C1QhKPPi5 mxHkUAkBSYmpPyQgwvUSre9PsYPslRCYwCjReOwP1Bx9iWsdG8H28gr4SvTf3Ak2h0VAVWLG gqNMEDUuEnd6esFsZgFtiWULXzODzGcW0JRYv0sfYpWyxJFbLBAVfBIdh/+yw3zVsPE3VvaO eU+gpqtJPFqwBRoKMhIX55xjnsCoNAsR0rOQ7J2FsHcBI/MqRrHUguLc9NRiowJjeOQm5+du YgQnRy33HYwz3n7QO8TIxMF4iFGCg1lJhDdLozJdiDclsbIqtSg/vqg0J7X4EKMp0McTmaVE k/OB6TmvJN7QxNLAxMzM0NzI1MBcSZz3XuvcFCGB9MSS1OzU1ILUIpg+Jg5OqQYm7YMhum/f tB2WdbXaxCDX9+fN9M6rfRZ/mqbZKVm88dDdLz7X7NlLX4Po07PXei9XVmg8IaD4rujZhm6u jBCZRpEPLw9P5ZAL69lQtk/zjKVds3JL7Ymd1YI704Q3L5lyx+pAwenpD18ZvrpY0bH/9ZZj 180KPwh8es/LZFwho2npz2mmEqYx4cnD8rfW++zP7zJSSEhbyXSuNT7XhOPlx/uza1VTOT4F PpTZ9+st60wuZ3OjOZ+OXehYwuec1ih8qcpu6aTQXD4lg6u9ZhXP2YTv/tj4UPrnKbedLR82 6eTP1tuS7WvQ/2tebmHhloSUfyl+qqy6Zux9PvZHP71zc1R7+zeO9eAMHt+KxRZKLMUZiYZa zEXFiQDw5Ck6FwQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250107084356epcms2p2af4d86432174d76ea57336933e46b4c3 References: 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=203.254.224.24; envelope-from=keosung.park@samsung.com; helo=mailout1.samsung.com X-Spam_score_int: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.446, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: keosung.park@samsung.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @samsung.com) X-ZM-MESSAGEID: 1736239484904116600 In ufs_write_attr_value(), the value parameter is handled in the CPU's endian format but provided in big-endian format by the caller. Thus, it is converted to the CPU's endian format. The related test code is also fixed to reflect this change. Fixes: 7c85332a2b3e ("hw/ufs: minor bug fixes related to ufs-test") Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Keoseong Park Reviewed-by: Jeuk Kim --- hw/ufs/ufs.c | 2 +- tests/qtest/ufs-test.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c index 8d26d13791..428fe927ad 100644 --- a/hw/ufs/ufs.c +++ b/hw/ufs/ufs.c @@ -1164,7 +1164,7 @@ static QueryRespCode ufs_exec_query_attr(UfsRequest *= req, int op) value =3D ufs_read_attr_value(u, idn); ret =3D UFS_QUERY_RESULT_SUCCESS; } else { - value =3D req->req_upiu.qr.value; + value =3D be32_to_cpu(req->req_upiu.qr.value); ret =3D ufs_write_attr_value(u, idn, value); } req->rsp_upiu.qr.value =3D cpu_to_be32(value); diff --git a/tests/qtest/ufs-test.c b/tests/qtest/ufs-test.c index 60199abbee..1f860b41c0 100644 --- a/tests/qtest/ufs-test.c +++ b/tests/qtest/ufs-test.c @@ -145,7 +145,7 @@ static void ufs_send_query(QUfs *ufs, uint8_t slot, uin= t8_t query_function, req_upiu.qr.idn =3D idn; req_upiu.qr.index =3D index; req_upiu.qr.selector =3D selector; - req_upiu.qr.value =3D attr_value; + req_upiu.qr.value =3D cpu_to_be32(attr_value); req_upiu.qr.length =3D UFS_QUERY_DESC_MAX_SIZE; qtest_memwrite(ufs->dev.bus->qts, req_upiu_addr, &req_upiu, sizeof(req_upiu)); --=20 2.25.1