From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:489:b0:a44:3ba0:e9d1 with SMTP id f9csp506887eja; Thu, 29 Feb 2024 08:33:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKcOn9d/g2XFYlpnG3bS+mMbPYJaI14mwHrTU3WZwJhKFsKaY7dYM64TWVpdKHVLysC24uVpcNkQw+q7/v+PUCINNMCjaG X-Google-Smtp-Source: AGHT+IHRta87gJF2z2KBvFmJj1S/fQWPr04rwd6nBqwVhkfBdPzwujaDpMLMFcJqAexeqDDYWPjc X-Received: by 2002:a05:6214:1926:b0:690:48f5:28 with SMTP id es6-20020a056214192600b0069048f50028mr1929732qvb.1.1709224402002; Thu, 29 Feb 2024 08:33:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709224401; cv=none; d=google.com; s=arc-20160816; b=XEvBqiuoZ0OMdWwRXvboMcG7o1n69MljSFLXval3ElELoZaUyfR8SvOFVGQ2FypU4U zuDYRcLWBVU49SMRnyMlZ0iI8sYzfioYcgP0bm9mG1Bp7Q50cfcuVrcrrtujcxTAGinA rKYaW4oij5D7Lvd2/Tvf9od3E84ISDTYAqr8rr8+9qBnkf9lB4rqahS5+EMfaRSEpXKB NtxhSwH+pS/LNuPmgq2qx4NZRyFmtysFVdtNy8z4M787MYSJ8JyGubaxhnsxCixGqQal aA20ML/prnu+1jGqSiFXsSOxW8Sm1bra+00iLCaizrmiT1fJkBv2kdYwglcQuBLiBwb8 /njA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:from:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:date; bh=0+HeOQDCin455p3U++SFET+XtWdPdvD0qpSSuZcCtIA=; fh=kHLsR3jjhMqS3cla2gydHFs9zLFbxmJgpnxriC7JI/Y=; b=JMTNc4xYvErJCPTmdO+Fk0tYlD2pdgVrOqaZClBKV28URdbS/f7J5jDzq30pzi5/Qu tROSefMRBGDGbWtkdnwIpAVyjwtNtTga3LAkVSyBBMQ4dwkzN48r2IXuJdrpszX+Ef6G xKIUDIbjJR3KAplRecsJbxxos+GwZpz51XFKlukvWXX4VhPN3Qe6MtOnYnJ2TAXmRxZS YzLHpqQrlVSMrL8oV10IdHDVfx2sBKSM84yBdIo3EV82GW4Sj6KKtaqAUQCSdv1iyF0b n5IpMrx9DXllTdp9gAeasfAyex7+8tJIiVskIGMM2d5akWPgS/c3qs5fAaPiyajWsMI2 CU8Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o4-20020ad45c84000000b0069019d520fdsi1192152qvh.252.2024.02.29.08.33.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Feb 2024 08:33:21 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nongnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfjKy-0003CB-9q; Thu, 29 Feb 2024 11:32:48 -0500 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 1rfjKt-0003BF-3j; Thu, 29 Feb 2024 11:32:43 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfjKp-0000JK-MW; Thu, 29 Feb 2024 11:32:41 -0500 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TlxTg0hB2z6J9bM; Fri, 1 Mar 2024 00:27:51 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AC0391408FE; Fri, 1 Mar 2024 00:32:33 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 29 Feb 2024 16:32:33 +0000 Date: Thu, 29 Feb 2024 16:32:32 +0000 To: Ankit Agrawal CC: Markus Armbruster , Jason Gunthorpe , "alex.williamson@redhat.com" , "clg@redhat.com" , "shannon.zhaosl@gmail.com" , "peter.maydell@linaro.org" , "ani@anisinha.ca" , "berrange@redhat.com" , "eduardo@habkost.net" , "imammedo@redhat.com" , "mst@redhat.com" , "eblake@redhat.com" , "david@redhat.com" , "gshan@redhat.com" , Zhi Wang , Matt Ochs , "pbonzini@redhat.com" , Aniket Agashe , Neo Jia , Kirti Wankhede , "Tarun Gupta (SW-GPU)" , Vikram Sethi , "Andy Currid" , Dheeraj Nigam , Uday Dhoke , "qemu-arm@nongnu.org" , "qemu-devel@nongnu.org" Subject: Re: [PATCH v7 1/2] qom: new object to associate device to numa node Message-ID: <20240229163232.0000478d@Huawei.com> In-Reply-To: References: <20240223124223.800078-1-ankita@nvidia.com> <20240223124223.800078-2-ankita@nvidia.com> <8734td3uty.fsf@pond.sub.org> <20240228135504.00005d12@Huawei.com> <87bk80vaft.fsf@pond.sub.org> <20240229102230.00004277@Huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: 6imGdORfWuxX On Thu, 29 Feb 2024 13:00:27 +0000 Ankit Agrawal wrote: > >> >>> Jonathan, you pointed out interface design issues in your review o= f v2.> =20 > >> >> Are you fully satisfied with the interface in v3? > >> >> > >> >> Yes. I'm fine with the interface in this version (though it's v7, s= o I'm lost > >> >> on v2 vs v3!) =20 > >> > > >> > Looks like I can't count to 7! > >> > > >> > With NUMA capitalized in the doc comment, QAPI schema > >> > Acked-by: Markus Armbruster > >> > > >> > Thanks! =20 > >> > >> Thanks! Will fix that in the next version. =20 > > > > The following is really me arguing with myself, so can probably be > > ignored, but maybe it will spark an idea from someone else! > > > > One trivial tweak that might make our life easier if anyone adds > > support in the future for the other device handle type might be to go > > with simply dev rather than pci-dev. > > > > There is a sticky corner though if a device is a PCI device > > and in ACPI DSDT so maybe we are better off adding acpi-dev > > to take either pci-dev or acpi-dev? =20 >=20 > That use case does complicate the situation. Do you of any such > use case for generic initiator? In physical systems yes - in QEMU not yet, though it's a quirk of the available ids to get to the ACPI devices (which oddly are PCI devices :() >=20 > As for your suggestion of using acpi-dev as the arg to take both > pci-dev and acpi-dev.. Would that mean sending a pure pci device > (not the corner case you mentioned) through the acpi-dev argument > as well? Not sure if that would appropriate. Ah, looking up my description is unclear. I meant two optional parameters pci-dev or acpi-dev - which one was supplied would indicate the type of handle to be used. >=20 > > Annoyingly for generic ports, (I'm reusing this infrastructure here) > > the kernel code currently only deals with the ACPI form (for CXL host > > bridges).=A0 Given I point that at the bus of a PXB_CXL it is both > > a PCI device, and the only handle we have for getting to the > > Root Bridge ACPI handle. =20 >=20 > So IIUC, you need to pass a PCI device to the generic port object, but use > that to reach the ACPI handle and build the Generic port affinity structu= re > for an ACPI device? Yes. Slightly shortcut is that the UID is the bus number for all the relevant devices so I can abuse that. QEMU doesn't keep track of the ACPI handles directly so this is the current cleanest solution. >=20 > > So I think I've argued myself around to thinking we need to extend > > the interface with another optional parameter if we ever do support > > the ACPI handle for generic initiators :( > > > > Jonatha =20 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 21246C54E41 for ; Thu, 29 Feb 2024 16:33:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfjKx-0003BU-G7; Thu, 29 Feb 2024 11:32:47 -0500 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 1rfjKt-0003BF-3j; Thu, 29 Feb 2024 11:32:43 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfjKp-0000JK-MW; Thu, 29 Feb 2024 11:32:41 -0500 Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4TlxTg0hB2z6J9bM; Fri, 1 Mar 2024 00:27:51 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (unknown [7.191.163.240]) by mail.maildlp.com (Postfix) with ESMTPS id AC0391408FE; Fri, 1 Mar 2024 00:32:33 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Thu, 29 Feb 2024 16:32:33 +0000 Date: Thu, 29 Feb 2024 16:32:32 +0000 To: Ankit Agrawal CC: Markus Armbruster , Jason Gunthorpe , "alex.williamson@redhat.com" , "clg@redhat.com" , "shannon.zhaosl@gmail.com" , "peter.maydell@linaro.org" , "ani@anisinha.ca" , "berrange@redhat.com" , "eduardo@habkost.net" , "imammedo@redhat.com" , "mst@redhat.com" , "eblake@redhat.com" , "david@redhat.com" , "gshan@redhat.com" , Zhi Wang , Matt Ochs , "pbonzini@redhat.com" , Aniket Agashe , Neo Jia , Kirti Wankhede , "Tarun Gupta (SW-GPU)" , Vikram Sethi , "Andy Currid" , Dheeraj Nigam , Uday Dhoke , "qemu-arm@nongnu.org" , "qemu-devel@nongnu.org" Subject: Re: [PATCH v7 1/2] qom: new object to associate device to numa node Message-ID: <20240229163232.0000478d@Huawei.com> In-Reply-To: References: <20240223124223.800078-1-ankita@nvidia.com> <20240223124223.800078-2-ankita@nvidia.com> <8734td3uty.fsf@pond.sub.org> <20240228135504.00005d12@Huawei.com> <87bk80vaft.fsf@pond.sub.org> <20240229102230.00004277@Huawei.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100004.china.huawei.com (7.191.162.219) To lhrpeml500005.china.huawei.com (7.191.163.240) Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Reply-to: Jonathan Cameron From: Jonathan Cameron via Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu, 29 Feb 2024 13:00:27 +0000 Ankit Agrawal wrote: > >> >>> Jonathan, you pointed out interface design issues in your review o= f v2.> =20 > >> >> Are you fully satisfied with the interface in v3? > >> >> > >> >> Yes. I'm fine with the interface in this version (though it's v7, s= o I'm lost > >> >> on v2 vs v3!) =20 > >> > > >> > Looks like I can't count to 7! > >> > > >> > With NUMA capitalized in the doc comment, QAPI schema > >> > Acked-by: Markus Armbruster > >> > > >> > Thanks! =20 > >> > >> Thanks! Will fix that in the next version. =20 > > > > The following is really me arguing with myself, so can probably be > > ignored, but maybe it will spark an idea from someone else! > > > > One trivial tweak that might make our life easier if anyone adds > > support in the future for the other device handle type might be to go > > with simply dev rather than pci-dev. > > > > There is a sticky corner though if a device is a PCI device > > and in ACPI DSDT so maybe we are better off adding acpi-dev > > to take either pci-dev or acpi-dev? =20 >=20 > That use case does complicate the situation. Do you of any such > use case for generic initiator? In physical systems yes - in QEMU not yet, though it's a quirk of the available ids to get to the ACPI devices (which oddly are PCI devices :() >=20 > As for your suggestion of using acpi-dev as the arg to take both > pci-dev and acpi-dev.. Would that mean sending a pure pci device > (not the corner case you mentioned) through the acpi-dev argument > as well? Not sure if that would appropriate. Ah, looking up my description is unclear. I meant two optional parameters pci-dev or acpi-dev - which one was supplied would indicate the type of handle to be used. >=20 > > Annoyingly for generic ports, (I'm reusing this infrastructure here) > > the kernel code currently only deals with the ACPI form (for CXL host > > bridges).=A0 Given I point that at the bus of a PXB_CXL it is both > > a PCI device, and the only handle we have for getting to the > > Root Bridge ACPI handle. =20 >=20 > So IIUC, you need to pass a PCI device to the generic port object, but use > that to reach the ACPI handle and build the Generic port affinity structu= re > for an ACPI device? Yes. Slightly shortcut is that the UID is the bus number for all the relevant devices so I can abuse that. QEMU doesn't keep track of the ACPI handles directly so this is the current cleanest solution. >=20 > > So I think I've argued myself around to thinking we need to extend > > the interface with another optional parameter if we ever do support > > the ACPI handle for generic initiators :( > > > > Jonatha =20