From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756172AbcBPWBO (ORCPT ); Tue, 16 Feb 2016 17:01:14 -0500 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:47008 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756010AbcBPWBM convert rfc822-to-8bit (ORCPT ); Tue, 16 Feb 2016 17:01:12 -0500 From: Jake Oshins To: Bjorn Helgaas CC: "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , "gregkh@linuxfoundation.org" , KY Srinivasan , "linux-kernel@vger.kernel.org" , "devel@linuxdriverproject.org" , "olaf@aepfle.de" , "apw@canonical.com" , "vkuznets@redhat.com" , "tglx@linutronix.de" , Haiyang Zhang , "marc.zyngier@arm.com" , Hadden Hoppert Subject: RE: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs Thread-Topic: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs Thread-Index: AQHRY2+dctzGGvn2R0WuEHXfQoDigZ8u7BUAgABTbIA= Date: Tue, 16 Feb 2016 21:46:55 +0000 Message-ID: References: <1455045869-38341-1-git-send-email-jakeo@microsoft.com> <1455045869-38341-4-git-send-email-jakeo@microsoft.com> <20160216164544.GA18685@localhost> In-Reply-To: <20160216164544.GA18685@localhost> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [2001:4898:80e8:2::563] x-ms-office365-filtering-correlation-id: 207e1153-116f-4899-9c82-08d3371ab055 x-microsoft-exchange-diagnostics: 1;DM2PR0301MB1229;5:xI+9uUqzJ8tnqG+jRuKxHg58RVP2ZSzpnLyWM/EDmZUfhQeZYOzCX/VHAI0RNsrpTj4+4S0zrw9aq/QWFJ+5s8TlTCqVyWxcODuPJrq6uMIvhYFxFxZtczFogwsLhrReeEtjcIcefzK/wWHmaO8RKQ==;24:Q+iLfUbafEVq8q1GizDky1DL9vkAh7mf+WTddOeL5QOgITdchEsGO+m5/JvpNipLWAgKyaPf+p97Z96m+PMo3npIxb3KNrEJ7dbWIRBFBGY= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(61426038)(61427038);SRVR:DM2PR0301MB1229;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1229; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(377454003)(43784003)(10290500002)(92566002)(102836003)(6116002)(86612001)(4326007)(19580405001)(2906002)(1220700001)(77096005)(2950100001)(4001430100002)(1096002)(189998001)(5003600100002)(10400500002)(33656002)(107886002)(110136002)(74316001)(5008740100001)(5001960100002)(19580395003)(5005710100001)(10090500001)(86362001)(5002640100001)(40100003)(5004730100002)(87936001)(106116001)(2900100001)(122556002)(99286002)(50986999)(54356999)(76176999)(76576001)(586003)(3826002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR0301MB1229;H:DM2PR0301MB1232.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Feb 2016 21:46:55.4262 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1229 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > Sent: Tuesday, February 16, 2016 8:46 AM > To: Jake Oshins > Cc: bhelgaas@google.com; linux-pci@vger.kernel.org; > gregkh@linuxfoundation.org; KY Srinivasan ; linux- > kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de; > apw@canonical.com; vkuznets@redhat.com; tglx@linutronix.de; Haiyang > Zhang ; marc.zyngier@arm.com; Hadden > Hoppert > Subject: Re: [PATCH RESEND v2 3/3] PCI: hv: New paravirtual PCI front-end > for Hyper-V VMs > > Hi Jake, > > Looks good to me overall; I marked a few nits below. > > The only real question I have is about domain number allocation. See > the note below. > [snip] > > + > > + /* > > + * The PCI bus "domain" is what is called "segment" in > > + * ACPI and other specs. Pull it from the instance ID, > > + * to get something unique. Bytes 8 and 9 are what is used > > + * in Windows guests, so do the same thing for consistency. > > + */ > > + > > + hbus->sysdata.domain = hdev->dev_instance.b[9] | > > + hdev->dev_instance.b[8] << 8; > > How do we know this is unique? We don't have any idea what the > platform will put in _SEG, so I think there's a potential conflict > here. The Intel VMD driver (arch/x86/pci/vmd.c) has a similar > problem, and it looks for unused domain numbers starting at 0x10000 > (see vmd_find_free_domain()). > Bjorn, thank you for your very thorough reviews. I deeply appreciate it. I checked the Hyper-V code and it currently does guarantee that these values are unique. When I resend the series, I'll add a comment to that effect. I'll also add a comment to Hyper-V that says that it has to stay that way. I'll resend shortly. Thanks again, Jake