From nobody Mon Feb 9 09:33:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1602506756; cv=none; d=zohomail.com; s=zohoarc; b=mYG9cRWfBNHZLXv5rWfzZ2dvZoZE1TniVnaOmQyP9JpI8D7BkzEw6+DgcYOfHE5puebdgWtvZg2U3P3f2P/0rY/LvoXZYXbpyoG/+KWV8/C4D8UBJNU7ofmukAO8tjpBLJGts42z21AmbpSYBHlXq0qqOtQjf1KBWdKumcg8SYs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602506756; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9wGxJZcsEOLAGSmgs7p8pt5WGBHmly5siKydoVe/oZE=; b=C1vwgzizp/7uIsIAkYO16XYutyIyFPXHxbzfGQMQ8Fw/g3ErsTM9XvJg2Uw9jk2UZZaEFR17ehqMUEJ92izuqehsO8E2F89lWTmvzjlo/9mDiKQU3kp4LNZac3eBAOxWdFf1n5xKYcPoHeF9nHXN8jfzFdzF3S7dJKhq1P5/lss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1602506756634740.6131521343179; Mon, 12 Oct 2020 05:45:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.5929.15435 (Exim 4.92) (envelope-from ) id 1kRxCy-0002yN-6E; Mon, 12 Oct 2020 12:45:44 +0000 Received: by outflank-mailman (output) from mailman id 5929.15435; Mon, 12 Oct 2020 12:45:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCy-0002yF-2P; Mon, 12 Oct 2020 12:45:44 +0000 Received: by outflank-mailman (input) for mailman id 5929; Mon, 12 Oct 2020 12:45:42 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCw-0002x4-Mb for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:42 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id a2a73f4a-121b-4786-8d31-62151f37af06; Mon, 12 Oct 2020 12:45:42 +0000 (UTC) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-8aCFu4Q9NpWinpC_cbR2fQ-1; Mon, 12 Oct 2020 08:45:38 -0400 Received: by mail-wr1-f70.google.com with SMTP id t17so9288654wrm.13 for ; Mon, 12 Oct 2020 05:45:38 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id s185sm22765462wmf.3.2020.10.12.05.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:36 -0700 (PDT) Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kRxCw-0002x4-Mb for xen-devel@lists.xenproject.org; Mon, 12 Oct 2020 12:45:42 +0000 Received: from us-smtp-delivery-124.mimecast.com (unknown [216.205.24.124]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id a2a73f4a-121b-4786-8d31-62151f37af06; Mon, 12 Oct 2020 12:45:42 +0000 (UTC) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-8aCFu4Q9NpWinpC_cbR2fQ-1; Mon, 12 Oct 2020 08:45:38 -0400 Received: by mail-wr1-f70.google.com with SMTP id t17so9288654wrm.13 for ; Mon, 12 Oct 2020 05:45:38 -0700 (PDT) Received: from localhost.localdomain (106.red-83-59-162.dynamicip.rima-tde.net. [83.59.162.106]) by smtp.gmail.com with ESMTPSA id s185sm22765462wmf.3.2020.10.12.05.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 05:45:36 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a2a73f4a-121b-4786-8d31-62151f37af06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602506741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9wGxJZcsEOLAGSmgs7p8pt5WGBHmly5siKydoVe/oZE=; b=GyWb5H/fZm06bwgGygqA8wvOijWLElMPBbR3NwJ7MLmx63LYrinMLPua+m/FnGVnPL29jF 37CsQ6wuDBa2UT6F3b4hRP8EfWmenc9qT/SKwiv4+WcEPkHAPt5lNUE4zsJryZAhMFQDj1 U4E54cSQn7bYPDr/7M59NoPKFMPkbOo= X-MC-Unique: 8aCFu4Q9NpWinpC_cbR2fQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9wGxJZcsEOLAGSmgs7p8pt5WGBHmly5siKydoVe/oZE=; b=mB+0nT7k7KUi7qtdGb1Kr1uSuYSyIn8zdocxrTLwMLprOrMhNZAUrTPdPREHM27/jL 9Luv3by5FgdcWqdDGj1hhCubsjoZ8cIk2TbOPXBdi7ob8FF0lFnHaEYJkq9W3/rYMHMq N64/wGOBMWMrApkfUGbtbUPFj/jjheDyQWOYbfV0P+W2S9bqa6afDkyXj1CHMZgEUQMu xyZx55bKG5OSusFonVeNGTgtxEx98DV+li9fJnrrFCnwRcTmngRXApLjopkffoAWCoj+ aEibFrEIdW2ufFaou1opuch50Y5PR3nYSj2YpKms3Q8HsbXpHjyyYxN7XvlqZMruVDGK lcaQ== X-Gm-Message-State: AOAM531eQdYhKKNi5MgeQYX6y70az+WIi40PzftcFxSFH9KO0mnkWokQ qIG6Q2pz+/WO8zUY2ObnYUIcNcZpSHvKy5V11/OLnyaSq2nyrJMc9wftYGFh76IRFINg+HI0L4i /EfTPc/bTEIBHutf1DDsqb3ShwVQ= X-Received: by 2002:adf:dccc:: with SMTP id x12mr30544384wrm.241.1602506737182; Mon, 12 Oct 2020 05:45:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGju9pLDMIkjylp5prt4ukBOzX2jmiDpK+NGjR15EPrzwXN0JDbAFCeWH5hcu15IBYdHhmBg== X-Received: by 2002:adf:dccc:: with SMTP id x12mr30544349wrm.241.1602506736967; Mon, 12 Oct 2020 05:45:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-ppc@nongnu.org, qemu-trivial@nongnu.org, Paul Durrant , Aurelien Jarno , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eduardo Habkost , Jiaxun Yang , Yoshinori Sato , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Stefano Stabellini , Helge Deller , Anthony Perard , Richard Henderson , Aleksandar Markovic , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Marcel Apfelbaum , Mark Cave-Ayland , Paolo Bonzini , Huacai Chen Subject: [PATCH 5/5] hw: Use the PCI_DEVFN() macro from 'hw/pci/pci.h' Date: Mon, 12 Oct 2020 14:45:06 +0200 Message-Id: <20201012124506.3406909-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201012124506.3406909-1-philmd@redhat.com> References: <20201012124506.3406909-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 We already have a generic PCI_DEVFN() macro in "hw/pci/pci.h" to pack the PCI slot/function identifiers, use it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: David Gibson --- hw/arm/virt.c | 3 ++- hw/pci-host/uninorth.c | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index e465a988d68..f601ef0798c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1144,7 +1144,8 @@ static void create_pcie_irq_map(const VirtMachineStat= e *vms, full_irq_map, sizeof(full_irq_map)); =20 qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupt-map-mask", - 0x1800, 0, 0, /* devfn (PCI_SLOT(3)) */ + cpu_to_be16(PCI_DEVFN(3, 0)), /* Slot 3 */ + 0, 0, 0x7 /* PCI irq */); } =20 diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index c21de0ab805..f73d452bdce 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -70,10 +70,8 @@ static uint32_t unin_get_config_reg(uint32_t reg, uint32= _t addr) /* ... and then convert them to x86 format */ /* config pointer */ retval =3D (reg & (0xff - 7)) | (addr & 7); - /* slot */ - retval |=3D slot << 11; - /* fn */ - retval |=3D func << 8; + /* slot, fn */ + retval |=3D PCI_DEVFN(slot, func) << 8; } =20 trace_unin_get_config_reg(reg, addr, retval); --=20 2.26.2