From patchwork Sun Apr 26 20:46:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Henrique Cerri X-Patchwork-Id: 1277237 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499KjG4xQLz9sRY; Mon, 27 Apr 2020 06:47:30 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jSoBQ-0004Hd-7v; Sun, 26 Apr 2020 20:47:24 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jSoAo-0003on-6C for kernel-team@lists.ubuntu.com; Sun, 26 Apr 2020 20:46:46 +0000 Received: from mail-qk1-f198.google.com ([209.85.222.198]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jSoAi-0001fn-UB for kernel-team@lists.ubuntu.com; Sun, 26 Apr 2020 20:46:41 +0000 Received: by mail-qk1-f198.google.com with SMTP id x5so17292512qkn.20 for ; Sun, 26 Apr 2020 13:46:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OsztqKkZWFNwe+tVlfV54VMWJoHdb/zThSnirR9xnZY=; b=IxiEehRWN4JH6h0yGN12b40g49jnEapD7FRjVdoN6tf1zg5AVgUICks4nltr85fd0T f2Fut1a4tj7V8z9vuvhABOcAtJTaXC/8Z5XhpkxdVfCzIL7OdT6qeYYhb0+cOnUWMaU8 Fi28IQEFX3red6O9KlnnGC/JCyvswljM0t0a2UyIumNszRv54jrnO54qHQHb7sG1YO2b QbLWrQR/pM3bTLIY4PW++RUtmdMU4JF6s71Wz8SYGlsB6sAc1WhumsyOzmiJWt25Xasp JcKMHmmA24DBPfk9tnWR1GvxQDUosgpPcaz88csuYKdgwQcpYRbJoQCtrkFASxfRc6Iy WrYA== X-Gm-Message-State: AGi0PuadH/zd7TMo5LdQh4yQWxUOAbbsP5OQB5uYVj3SrA+RFrt6vvDk bQhI1QNGjnJnRkaByCS53ue5L1/2Fo/GsSrlOyrwwiITMOavQs5Pl3Gb+yrf1nqktKBaME/S0d0 IewubQoiu8yiVXiPvw8XAfu/OOrSpymNF3Razt3Sr X-Received: by 2002:a37:9d0d:: with SMTP id g13mr18174699qke.350.1587933999499; Sun, 26 Apr 2020 13:46:39 -0700 (PDT) X-Google-Smtp-Source: APiQypI/Z7/u7+TqKE9LlHKk3Lrf1zf4VjN1ZfpDIvHx9SAr4LTLKIcDN4lHmEo8XR69Di+jASQ/TA== X-Received: by 2002:a37:9d0d:: with SMTP id g13mr18174681qke.350.1587933999043; Sun, 26 Apr 2020 13:46:39 -0700 (PDT) Received: from gallifrey.lan ([201.82.186.200]) by smtp.gmail.com with ESMTPSA id h63sm8261654qkd.49.2020.04.26.13.46.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 13:46:38 -0700 (PDT) From: Marcelo Henrique Cerri To: kernel-team@lists.ubuntu.com Subject: [eoan:linux-azure][PATCH 4/4] PCI: hv: Use bytes 4 and 5 from instance ID as the PCI domain numbers Date: Sun, 26 Apr 2020 17:46:27 -0300 Message-Id: <20200426204627.121419-5-marcelo.cerri@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200426204627.121419-1-marcelo.cerri@canonical.com> References: <20200426203646.115503-1-marcelo.cerri@canonical.com> <20200426204627.121419-1-marcelo.cerri@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Haiyang Zhang BugLink: https://bugs.launchpad.net/bugs/1867220 As recommended by Azure host team, the bytes 4, 5 have more uniqueness (info entropy) than bytes 8, 9 so use them as the PCI domain numbers. On older hosts, bytes 4, 5 can also be used -- no backward compatibility issues are introduced and the chance of collision is greatly reduced. In the rare cases of collision, the driver code detects and finds another number that is not in use. Suggested-by: Michael Kelley Signed-off-by: Haiyang Zhang Signed-off-by: Lorenzo Pieralisi Acked-by: Sasha Levin (cherry picked from commit f73f8a504e27959576a2f4d85182202561e426f2) Signed-off-by: Marcelo Henrique Cerri --- drivers/pci/controller/pci-hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c index 4caa3388692a..3a56de6b2ec2 100644 --- a/drivers/pci/controller/pci-hyperv.c +++ b/drivers/pci/controller/pci-hyperv.c @@ -2590,7 +2590,7 @@ static int hv_pci_probe(struct hv_device *hdev, * (2) There will be no overlap between domains (after fixing possible * collisions) in the same VM. */ - dom_req = hdev->dev_instance.b[8] << 8 | hdev->dev_instance.b[9]; + dom_req = hdev->dev_instance.b[5] << 8 | hdev->dev_instance.b[4]; dom = hv_get_dom_num(dom_req); if (dom == HVPCI_DOM_INVALID) {