From nobody Sun Nov 16 04:03:39 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1743446997; cv=none; d=zohomail.com; s=zohoarc; b=OQkrRpI2BtE300SGAgvdb6lBSZp3TumvJguAQaTRmE2NQM3k+mRf3LiSGaKj9YW3RTsbq0gDnYbqAnkcDYwXm5cHXz3jKI6jxj4gbHOJjhjEzJ0IMWqf/inftSywcMjj/GawE5v1j1PEuNCFBImYRmuCb2vmpF5wXljG1R2Hphg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743446997; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5e2LFLYL4FGGRWn+21Rw9GjEyeqb79QgJMcjrKvXJ9U=; b=iXpYATej/b6RMC/RnVnFAH3p7QpugXu9FquRl8qvwjx09745wK5jNF9BwPotnK0JH3J9n9b65PgjdTO7/BGMzTxO0c8IwMZDlxVg2PC6225ORcbtvSf+KyF1e7wMMXV6+7kIPy7/Qv853UeS59BWpFNqjSUfNdHqPsHabZfzyI0= 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 1743446997908407.3977317053898; Mon, 31 Mar 2025 11:49:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzKBs-0002Kh-FE; Mon, 31 Mar 2025 14:48:56 -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 1tzKBp-0002KM-Ff for qemu-devel@nongnu.org; Mon, 31 Mar 2025 14:48:55 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tzKBm-0001lo-OE for qemu-devel@nongnu.org; Mon, 31 Mar 2025 14:48:53 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-3018e2d042bso5553943a91.2 for ; Mon, 31 Mar 2025 11:48:50 -0700 (PDT) Received: from blackjackal.. ([2409:40f4:2018:65c1:99be:24ba:7ca2:678f]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3039f1d4f4bsm9928476a91.33.2025.03.31.11.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 11:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743446929; x=1744051729; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5e2LFLYL4FGGRWn+21Rw9GjEyeqb79QgJMcjrKvXJ9U=; b=DKE7NXsFwtJCbyUDFsYPfOvZIN+wzO4kIpZHwCbc79EKygSHUu4rjGwU992YdoY4pW hMaGMFyXAQIWTjjFHc+NCspWtgfR8OsCZdjRuknkjQCEEqUqUDGWPVdeQ9Qtbw+YbcrV L2dxfAxvRCCL52FoBEhvGKzJQdZG9OOPpNIzWQ+Iw1XxBg+POvuJ007tSCNjiM24B7a/ hNvDYfccDNHZXnp0ymSSVTHj3GSfxuEmINicbiKRCpVNtaIMbpGz5BvEAkHJktHK0STz JaALplnOtEjIBBCK6A5GO//zUE9p3cjw44t7ejsMP0fOpAmvFCgOJxkBaqnWcwZuOXpy awmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743446929; x=1744051729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5e2LFLYL4FGGRWn+21Rw9GjEyeqb79QgJMcjrKvXJ9U=; b=qGFJn9ZFbrunrZuuoAUvmm2GOdBcs9dthUmJQZTwHzeOfH7SojbgaYwcN2CuutQI+f iL6fnWU2HY50cTB8aNHcJUTF7dNDP2Pr/4M1Wjya5ZeV8HwrbJ90louRSdXO5L4vmg03 QC8svBmiDNWmkfR0vCwtTXtwM4y0pkmooNRG9NFp9wxif2eJlDZhD1x9i7ZTEwU8TMjA lP+1ztsZJNwx/I5chUmIKHBNtFTiWUSaVO2J9h5ikGtAf/HZ6u4OOvi6MaPWWZTK8p+C Ncc/MGuYggHmV2UOZpCP+C7N28HH/+WqKOdsfXU2WsnTEKlC18CIkQOph+gCMiYjiI2K zLnQ== X-Gm-Message-State: AOJu0YxEGTktQBEyX9oGUfUCGYcPCZ/G/SWFxUzHlTw+RVPCjP7DLvDG FGlUwsDawMXhLOcJrzA2cbpO6aBZHXUNnESvkt/VSJXe7NlWTOZBNaa9Jjne X-Gm-Gg: ASbGnctrsir7HUV4ZrKQg7RiMDxrD8hSkWc9zyMe45jIG7FVCmqjQ4IluJzsB3MMiZj nuTE4hjiY5kpqJVw+P8oz/RPNliQg9eF0KMgbBPmuizjE6H9igYenCIKACACX987U6CxSL/xqjk K3+elw+AjWK0jnKMgtvcYF/u24j2KzQSQhEBFwfPoFpYsQD+4euFlIhYahlr0szev6avbG7lt+e iGRbIMMa+hWkdrMBHCzNhklS/iDr2COYnM/vZH4t8J0+51G+/QkNFZcWZLKYM0YSG1qW/V5TNC5 WFfloV+Fyh9ZRkSuRt/2ZhCcqjB0JMrGBnVAAh7UITuxLYBXuvNV X-Google-Smtp-Source: AGHT+IHEh/mUJ9lhjUSiwIrzQoHuUpG6w4VJy5zyLDMss6vmEdARLBUYMvcDtwMbMPdrB5+DoDfEhQ== X-Received: by 2002:a17:90b:1f82:b0:2fe:afa7:eaf8 with SMTP id 98e67ed59e1d1-3056087870emr439769a91.13.1743446929022; Mon, 31 Mar 2025 11:48:49 -0700 (PDT) From: Rakesh Jeyasingh To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, philmd@linaro.org, thuth@redhat.com, rakeshjb010@gmail.com, balaton@eik.bme.hu Subject: [PATCH v4 1/2] hw/pci-host/gt64120: Fix endianness handling Date: Tue, 1 Apr 2025 00:18:19 +0530 Message-ID: <20250331184820.34673-2-rakeshjb010@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250331184820.34673-1-rakeshjb010@gmail.com> References: <20250331184820.34673-1-rakeshjb010@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::102e; envelope-from=rakeshjb010@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1743447000199019000 Content-Type: text/plain; charset="utf-8" The GT-64120 PCI controller requires special handling where: 1. Host bridge(bus 0 ,device 0) must use native endianness 2. Other devices follow MByteSwap bit in GT_PCI0_CMD Previous implementation accidentally swapped all accesses, breaking host bridge detection (lspci -d 11ab:4620). This patch: - Removes gt64120_update_pci_cfgdata_mapping(), moving data_mem initializat= ion to gt64120_realize() - Adds custom read/write handlers - Replace raw bit check with FIELD_EX32 for MByteSwap . - Use extract32 for bus/device check (bus 0, device 0). - Implement size-specific swaps (bswap16 for 2-byte, bswap32 for 4-byte) per MemoryRegionOps requirements. Fixes: 145e2198 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE Me= moryRegionOps") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2826 Signed-off-by: Rakesh Jeyasingh --- hw/pci-host/gt64120.c | 91 +++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 34 deletions(-) diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index d5c13a89b6..3595d8127e 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -320,38 +320,6 @@ static void gt64120_isd_mapping(GT64120State *s) memory_region_transaction_commit(); } =20 -static void gt64120_update_pci_cfgdata_mapping(GT64120State *s) -{ - /* Indexed on MByteSwap bit, see Table 158: PCI_0 Command, Offset: 0xc= 00 */ - static const MemoryRegionOps *pci_host_data_ops[] =3D { - &pci_host_data_be_ops, &pci_host_data_le_ops - }; - PCIHostState *phb =3D PCI_HOST_BRIDGE(s); - - memory_region_transaction_begin(); - - /* - * The setting of the MByteSwap bit and MWordSwap bit in the PCI Inter= nal - * Command Register determines how data transactions from the CPU to/f= rom - * PCI are handled along with the setting of the Endianness bit in the= CPU - * Configuration Register. See: - * - Table 16: 32-bit PCI Transaction Endianness - * - Table 158: PCI_0 Command, Offset: 0xc00 - */ - - if (memory_region_is_mapped(&phb->data_mem)) { - memory_region_del_subregion(&s->ISD_mem, &phb->data_mem); - object_unparent(OBJECT(&phb->data_mem)); - } - memory_region_init_io(&phb->data_mem, OBJECT(phb), - pci_host_data_ops[s->regs[GT_PCI0_CMD] & 1], - s, "pci-conf-data", 4); - memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGDATA << 2, - &phb->data_mem, 1); - - memory_region_transaction_commit(); -} - static void gt64120_pci_mapping(GT64120State *s) { memory_region_transaction_begin(); @@ -645,7 +613,6 @@ static void gt64120_writel(void *opaque, hwaddr addr, case GT_PCI0_CMD: case GT_PCI1_CMD: s->regs[saddr] =3D val & 0x0401fc0f; - gt64120_update_pci_cfgdata_mapping(s); break; case GT_PCI0_TOR: case GT_PCI0_BS_SCS10: @@ -1024,6 +991,57 @@ static const MemoryRegionOps isd_mem_ops =3D { }, }; =20 +static bool is_phb_dev0(const PCIHostState *phb) +{ + /*Checks if the current PCI configuration access targets the host brid= ge(bus 0, device 0)*/ + return extract32(phb->config_reg, 11, 5/*dev*/ + 8/*bus*/) =3D=3D 0; +} + +static uint64_t gt64120_pci_data_read(void *opaque, hwaddr addr, unsigned = size) +{ + GT64120State *s =3D opaque; + PCIHostState *phb =3D PCI_HOST_BRIDGE(s); + uint32_t val; + bool le_mode =3D FIELD_EX32(s->regs[GT_PCI0_CMD], GT_PCI0_CMD, MByteSw= ap); + + if (!(phb->config_reg & (1 << 31))) { + val =3D 0xffffffff; + } else { + val =3D pci_data_read(phb->bus, phb->config_reg | (addr & 3), size= ); + } + + /* Only swap for non-bridge devices in big-endian mode */ + if (!le_mode && !is_phb_dev0(phb)) { + val =3D bswap32(val); + } + return val; +} + +static void gt64120_pci_data_write(void *opaque, hwaddr addr,=20 + uint64_t val, unsigned size) +{ + GT64120State *s =3D opaque; + PCIHostState *phb =3D PCI_HOST_BRIDGE(s); + bool le_mode =3D FIELD_EX32(s->regs[GT_PCI0_CMD], GT_PCI0_CMD, MByteSw= ap); + + if (!le_mode && !is_phb_dev0(phb)) { + val =3D bswap32(val);=20 + } + if (phb->config_reg & (1u << 31)){ + pci_data_write(phb->bus, phb->config_reg | (addr & 3), val, size); + } +} + +static const MemoryRegionOps gt64120_pci_data_ops =3D { + .read =3D gt64120_pci_data_read, + .write =3D gt64120_pci_data_write, + .endianness =3D DEVICE_LITTLE_ENDIAN, + .valid =3D { + .min_access_size =3D 4, + .max_access_size =3D 4, + }, +}; + static void gt64120_reset(DeviceState *dev) { GT64120State *s =3D GT64120_PCI_HOST_BRIDGE(dev); @@ -1178,7 +1196,6 @@ static void gt64120_reset(DeviceState *dev) =20 gt64120_isd_mapping(s); gt64120_pci_mapping(s); - gt64120_update_pci_cfgdata_mapping(s); } =20 static void gt64120_realize(DeviceState *dev, Error **errp) @@ -1202,6 +1219,12 @@ static void gt64120_realize(DeviceState *dev, Error = **errp) memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGADDR << 2, &phb->conf_mem, 1); =20 + memory_region_init_io(&phb->data_mem, OBJECT(phb), + >64120_pci_data_ops, + s, "pci-conf-data", 4); + memory_region_add_subregion_overlap(&s->ISD_mem, GT_PCI0_CFGDATA << 2, + &phb->data_mem, 1); + =20 /* * The whole address space decoded by the GT-64120A doesn't generate --=20 2.43.0 From nobody Sun Nov 16 04:03:39 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1743446978; cv=none; d=zohomail.com; s=zohoarc; b=nKJ6NdfCBfOl2lkxc6wJJEtjuTBnrvvVJ0wDiDWaiA61T1lgKFsPvvy6XHXEibKEtR3ocYWydbszEkiGHs5PP3erXHIEhY6EDf5ghVCmbftl+ja2Km/SUfupDXFuI046rR+rFdnZFLnt1gTGV+R3eLOkT3yb852hXPNZlp6+2KY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743446978; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=c34zp6QHzUyuitt4Vixfy5pfieckp6MjfH8iM6VqqHQ=; b=HPvPui63H3s5A8nNrlZYofaXTefCOOk6TxRNPaNPd30foNv6+Yn3bj2s7qhf33gs91B7Dj9hcFgQy1ZV0zD+QbP204SOGpZYVVRQv3Wj/g5q3RBQtDS48YhZ3lBoGrG9a7PLP3kN/n2AiKXE239a2UCvtCitlGJmBgYYxdfap38= 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 1743446978976922.9900261406938; Mon, 31 Mar 2025 11:49:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzKCG-0002Nw-LT; Mon, 31 Mar 2025 14:49:20 -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 1tzKCB-0002NA-DU for qemu-devel@nongnu.org; Mon, 31 Mar 2025 14:49:18 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tzKC9-0001nC-3e for qemu-devel@nongnu.org; Mon, 31 Mar 2025 14:49:14 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-3012a0c8496so6243984a91.2 for ; Mon, 31 Mar 2025 11:49:12 -0700 (PDT) Received: from blackjackal.. ([2409:40f4:2018:65c1:99be:24ba:7ca2:678f]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3039f1d4f4bsm9928476a91.33.2025.03.31.11.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Mar 2025 11:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743446951; x=1744051751; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c34zp6QHzUyuitt4Vixfy5pfieckp6MjfH8iM6VqqHQ=; b=ZrCs9NsGL5JOV3201yKNXve9PWp5FdoBbRsPz7GuL+S6yIcvLqN/ql6xV2W2+5dP17 dXmamtjgB1cDMcW66VrxoRZ5BpqXTnYr0NSaPPX//OCoxl+M1UC1CDA201jgBAVVtIew PqwLPXHnBvaz0N4HtTEozut9gFUs1ONarPV1AUTqUCvaoHQZBOhnSXsL9tAB+bAzYsA2 7qG6K7m/JZ5NP37o6b7nKlarxHaz6k1HZiWLpsTBqbuhfZ4b32sHbgrAgXSojyQjN7qn UTVLbQnaQaAUln7UOv8cWafuonZECBKDkOFiQEb04EyHSfgQR654GuOXJBgn201L6y6G KlgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743446951; x=1744051751; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c34zp6QHzUyuitt4Vixfy5pfieckp6MjfH8iM6VqqHQ=; b=QKh2Itj1HvHaC52lKjZVhfAXXFuBbmwPsp+2JmHLOsUDr+R7uzveg4R/uc2pgc5Xpm XQiYOBpf1BWS2GaZY5Ua90jK/h/RRQm8Q+hqNldmhqlpDTBtEcOA+stgERYcGemjO2sM H8sAKAqEMk5YiW9g0o7idPuhBldCqJ+V6AagoKi77UpV1a+HNXljzrUuo6nQH8D9YaQw E+9EMh9BlJrP0xM7QeJHn1ZSLvk+Zmi7IRTsKM2bSllkoqfU9gT7ZdBhkbnHV8G1CNrm pg4+2yvM5G+ZZ6cIF+hafu0zwaehBEloe5s3Pk2jhGaa3Z6IqH46OLcLAkw4ZUplL6AM iihA== X-Gm-Message-State: AOJu0Ywh36j0q3gqa2NuBU02hypdEMmtqD/kYEzqC51HnqZBhJqkYdlz QRRRyqMRPeffnFZEkHhEug1UXm8CN9GjvS04Zi3QsZr915/X0guSLqtdgH4t X-Gm-Gg: ASbGncuSvcnJUlHUr4pD4VnGKKFreqATWdh/iu+Whrb1M8k5/Y+zQdl5MIR8fb3dsMv LaCZhp0l28TCQpz0ZjVNe8BhUozTvdapZ8786BONjDeATXMC1o8ksN1aRmK60P99K3G3IyEaojC t7lhSKiT1hCrb+CDckDcRXhPDUy4UpIKJnTii1u7qEr5eyObpQNMHccV8osSTZZi+KpVJphfk1o abu4lZ2vBWOoSFuMDzG03xtH4nKdPFqTvWD6moC5vmZi3hKaaFDja+68tCTAbEgcTOXmgmEbv7L S7aPdawTsSA0VeIm1VdJ8ZAtGmdvIbRzCwvGJgmFqpDMcy4e2CI/ X-Google-Smtp-Source: AGHT+IH09QtKdtPBXNgrQlmAh7i9VHT8EfN/XAnHSHHoAZ93tsi681tEdoUf541XKijeVZlg4L0dSA== X-Received: by 2002:a17:90b:5483:b0:2ff:64c3:3bd9 with SMTP id 98e67ed59e1d1-3053214bcc3mr13048092a91.23.1743446950867; Mon, 31 Mar 2025 11:49:10 -0700 (PDT) From: Rakesh Jeyasingh To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, pbonzini@redhat.com, philmd@linaro.org, thuth@redhat.com, rakeshjb010@gmail.com, balaton@eik.bme.hu Subject: [PATCH v4 2/2] hw/pci-host: Remove unused pci_host_data_be_ops Date: Tue, 1 Apr 2025 00:18:20 +0530 Message-ID: <20250331184820.34673-3-rakeshjb010@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250331184820.34673-1-rakeshjb010@gmail.com> References: <20250331184820.34673-1-rakeshjb010@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::102f; envelope-from=rakeshjb010@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1743446979708019100 pci_host_data_be_ops became unused after endianness fixes Suggested-by: Paolo Bonzini Signed-off-by: Rakesh Jeyasingh Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci/pci_host.c | 6 ------ include/hw/pci-host/dino.h | 4 ---- include/hw/pci/pci_host.h | 1 - 3 files changed, 11 deletions(-) diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 80f91f409f..56f7f28a1a 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -217,12 +217,6 @@ const MemoryRegionOps pci_host_data_le_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 -const MemoryRegionOps pci_host_data_be_ops =3D { - .read =3D pci_host_data_read, - .write =3D pci_host_data_write, - .endianness =3D DEVICE_BIG_ENDIAN, -}; - static bool pci_host_needed(void *opaque) { PCIHostState *s =3D opaque; diff --git a/include/hw/pci-host/dino.h b/include/hw/pci-host/dino.h index fd7975c798..5dc8cdf610 100644 --- a/include/hw/pci-host/dino.h +++ b/include/hw/pci-host/dino.h @@ -109,10 +109,6 @@ static const uint32_t reg800_keep_bits[DINO800_REGS] = =3D { struct DinoState { PCIHostState parent_obj; =20 - /* - * PCI_CONFIG_ADDR is parent_obj.config_reg, via pci_host_conf_be_ops, - * so that we can map PCI_CONFIG_DATA to pci_host_data_be_ops. - */ uint32_t config_reg_dino; /* keep original copy, including 2 lowest bi= ts */ =20 uint32_t iar0; diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index e52d8ec2cd..954dd446fa 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -68,6 +68,5 @@ uint32_t pci_data_read(PCIBus *s, uint32_t addr, unsigned= len); extern const MemoryRegionOps pci_host_conf_le_ops; extern const MemoryRegionOps pci_host_conf_be_ops; extern const MemoryRegionOps pci_host_data_le_ops; -extern const MemoryRegionOps pci_host_data_be_ops; =20 #endif /* PCI_HOST_H */ --=20 2.43.0