From nobody Sun Feb 8 22:18:28 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1576816355; cv=none; d=zohomail.com; s=zohoarc; b=JmdIkrPk0GYqqRu9hSPDgGe4m3dBg3Iqv7716msdK2UHUrDKGzA9QV8QR5lwhZE83CF7f3MKLV5A9oWFeP0SO5ScxC1NDDMqDOu9pNGJKrLToSrl79VWqbv9uNGdExDwuVVqEUt91NsqwHax29JusTd3Ug8yEhMr2QwMw/aeL2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576816355; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=m7iuPPS0j6HrvPD1C6NqD0pIWUqoin2M+5kk3+keTAE=; b=Z+x4uWm1fu8adYXWz/eANkfflFjB9sMQplNR8v+k+c2HvLylWS1xtnLI0wIvhIPUv+0Bm0CxgPJQ37JR4CWldZZFepQXWcmA1xqCaBn1Z1pLPEZJ9P3goIyV3Jc2DfE3cYcIpievg+dsgeNQS7a/OOc6PFAeeDUWX0p4ph+Tfvo= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576816355237393.3123035927681; Thu, 19 Dec 2019 20:32:35 -0800 (PST) Received: from localhost ([::1]:50646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii9xp-0007kv-R8 for importer@patchew.org; Thu, 19 Dec 2019 23:32:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55881) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii9nh-0008UX-7Z for qemu-devel@nongnu.org; Thu, 19 Dec 2019 23:22:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ii9nf-00023M-K8 for qemu-devel@nongnu.org; Thu, 19 Dec 2019 23:22:04 -0500 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:34454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ii9nf-00020y-0p; Thu, 19 Dec 2019 23:22:03 -0500 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id B1EDD28523; Thu, 19 Dec 2019 23:22:02 -0500 (EST) To: Jason Wang , qemu-devel@nongnu.org Message-Id: <7e4a17ec16270797b1d47042f95263c3dcbeea5a.1576815466.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH v2 09/13] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode Date: Fri, 20 Dec 2019 15:17:46 +1100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 98.124.60.144 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aleksandar Rikalo , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Laurent Vivier , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Section 3.4.1 of the datasheet says, The alignment of the RRA is confined to either word or long word boundaries, depending upon the data width mode. In 16-bit mode, the RRA must be aligned to a word boundary (A0 is always zero) and in 32-bit mode, the RRA is aligned to a long word boundary (A0 and A1 are always zero). This constraint has been implemented for 16-bit mode; implement it for 32-bit mode too. Signed-off-by: Finn Thain --- hw/net/dp8393x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index d722bbe8c1..a3936d3b7b 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -659,12 +659,16 @@ static void dp8393x_write(void *opaque, hwaddr addr, = uint64_t data, qemu_flush_queued_packets(qemu_get_queue(s->nic)); } break; - /* Ignore least significant bit */ + /* The guest is required to store aligned pointers here */ case SONIC_RSA: case SONIC_REA: case SONIC_RRP: case SONIC_RWP: - s->regs[reg] =3D data & 0xfffe; + if (s->regs[SONIC_DCR] & SONIC_DCR_DW) { + s->regs[reg] =3D data & 0xfffc; + } else { + s->regs[reg] =3D data & 0xfffe; + } break; /* Invert written value for some registers */ case SONIC_CRCT: --=20 2.23.0