[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 2/8] vpci: Refactor REGISTER_VPCI_INIT
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Date: Thu, 26 Jun 2025 08:03:15 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yUUBeDXFvjCJhw2C1JuM6OwIToeQin86XXHa2v986Rw=; b=E8kp8h/87tKllxwjH0FuXccMLCVEazKKkzt3oleQD58E5zzApLVTudRBwoy89SWLWCsMyqaGA5/PhyudqxUYrmDmveg6K9dvcaYfJzPylpcP19pMgvYJHvn/c88mEiW0hgW0U8tNKEBujCEj5Ve+h/qRp/SLGeoL2Irq9tz4DJyYeNyu5b1dv4LCYbHVPY2j+Dzn33AeuriP1bZSW7Kp4BmVwz+7hb7cw092U4SjVQEOB9OiSHVCDap/ZpWMM4+12/s1/EazSFfv6Avf9GcQnTGz9c0+4duZACXyLT1lrY1RAv4OGNIC0+7L386ohcv7umhKF0XNyo1yDRCKBQlieg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fufd88mbvN8rR1b8EwEfQI1euLtRYkSxvm2V501gJnMSaCGQ6lvMx6kpsvtxkvwn+bjNaDbysX1EY9ljinN0xDum5bkB19yqLx4bGV2iFVoLYDSDsj7CEnivThCwOgOf3hQFdrDKkXhnm8GgbzDhhFcg8z7pUi7YPW0nBcC/b2hIAZ3zu0DN6XmUuBSbBNbeb6aOngDlPUPaP0C5oq+4PGRnm6LOqnt4UWYtb2wczDv2816CDfKF85Yctw1TsYmiEHuGScVb3CX4DRQJsyRFeDzkLb6WYEU3KYHpvmKDNNVDKIRxSH0mVhLlYzFtH8yvDsnOEf4879X0bsZiD9joOQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Orzel, Michal" <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Huang, Ray" <Ray.Huang@xxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
- Delivery-date: Thu, 26 Jun 2025 08:03:35 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHb23yakGdVC9XxvEWnYcnp8zrTt7QI/QAAgAGa9QCAAQzVgIAG5D6A//99hgCAAJwoAP//hioAgAHew4D//5oCgAASTfCA//+FrwCAAIi+gP//u5+AgAGwYIA=
- Thread-topic: [PATCH v6 2/8] vpci: Refactor REGISTER_VPCI_INIT
On 2025/6/25 22:07, Jan Beulich wrote:
> On 25.06.2025 12:16, Chen, Jiqian wrote:
>> On 2025/6/25 18:03, Jan Beulich wrote:
>>> Also, as said - you will need to check whether other architectures are
>>> different from x86-64 in this regard. We better wouldn't leave a trap here,
>>> for them to fall into when they enable vPCI support. I.e. my recommendation
>>> would be that if in doubt, we put the __aligned() there unconditionally.
>> That's difficult for me to check on all different platforms since I don't
>> have them all.
>
> You don't need to have them. You'd need to carefully go through the respective
> section(s) of their psABI-s.
>
>> So you mean I should remove "#ifdef CONFIG_X86"? Just let __aligned(16) for
>> all platforms?
>
> Yes. And, as also said, with a suitable comment please.
Ah, my comment definitely needs your change suggestion.
I wrote a draft as below:
/*
* Size of vpci_capability is lager than 8 bytes. When it is used as the entry
* of __start_vpci_array in section, it is 16-byte aligned by assembler, that
* causes the array length (__end_vpci_array - __start_vpci_array) wrong, so
* force its definition to use 16-byte aligned here.
*/
struct vpci_capability {
unsigned int id;
bool is_ext;
int (* init)(const struct pci_dev *pdev);
int (* cleanup)(const struct pci_dev *pdev);
} __attribute__((aligned(16)));
>
> Jan
--
Best regards,
Jiqian Chen.
|