[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] vpci: Add resizable bar support


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 22 Nov 2024 04:04:05 +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=mDIcTKJ/go7ZVc4NvHftzsocvz89//26lnWjQuq+xx8=; b=XylZoXc0o0S5lgLPfMzhftdujqoL/s3KlGDReif7KDU2Gq8dvZ/dHemo03dmypV3K3nUbbHL4yD6uHeouyaJ8zm1ZIU1Ex764N90HkmcMMsOnXiw76B9rJ/idkpJ+JrpIuzrkJ8mbgrKXu9XZ2yFDGLvt3yoTghVK45sWDIN1+LjP06BhmcboHNLJnaNSsCUpFPuMKS5jMdOBb2VGlf9OpnM27AZnmXaK7suKNCUDH1NzTiMUzi8HtXBfyZWQkl1VhfepUWeKSEINIqEHbDjLjHwru2SI2nKGhdzhiBobDm9KujYG97fU5irG93HUWt1JEu2iIMnJ1/XD4cxDfbBlw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J91b0C8zbNf3BhGHob60HFDVqZQ+gt1cqZWnprsIZZehdK1UrFQVEP0731hCFzXWgoa2flT0qT5KHgpHKKDpywe+wVqxBMLIU+ws71d/ijmCAnQlp01qTt5I13+wljLyXhwBT2UePmFhTSMWWpXzlSZazXtOk75Bmp/W61pkjpaQzk6sq6ReDGq1zPp/lNQfI55tO8BwYGlshx3/gPvXNFoI7zaxpF1MTdc5LN0kJdTk4rtM68DmOC40+iGU4AuDX+o707Ihly3JddG40aOPYNZvL3sw13ZNXklGjWP63pnpj0N+7C0iRWrZTEjSbp5g+eKmfRe53g3kgBr+56vV+A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Fri, 22 Nov 2024 04:04:34 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHbNaIlMxf8mJcywkeNRFmHEai1qbK08gcAgACKfwD//4ZQAIABzRcAgAAfLACAAB0/gIABIxcAgAAMOoCABNwTAIABfwWAgAFxTQD//+JeAIABss4A///tiAAANs/tAA==
  • Thread-topic: [PATCH] vpci: Add resizable bar support

On 2024/11/21 17:52, Roger Pau Monné wrote:
> On Thu, Nov 21, 2024 at 03:05:14AM +0000, Chen, Jiqian wrote:
>> On 2024/11/20 17:01, Roger Pau Monné wrote:
>>> On Wed, Nov 20, 2024 at 03:01:57AM +0000, Chen, Jiqian wrote:
>>>> The only difference between our methods is the timing of updating the size.
>>>> Yours is later than mine because you updated the size when the driver 
>>>> re-enabled memory decoding, while I updated the size in time when driver 
>>>> resize it.
>>>
>>> Indeed, my last guess is the stale cached size is somehow used in my
>>> approach, and that leads to the failures.  One last (possibly dummy?)
>>> thing to try might be to use your patch to detect writes to the resize
>>> control register, but update the BAR sizes in modify_bars(), while
>>> keeping the traces of when the operations happen.
>>>
>> This can work, combine our method, use my patch to detect and write the size 
>> into hardware register, and use your patch to update bar[i].size in 
>> modify_bars().
>> Attached the combined patch and the xl dmesg.
> 
> This is even weirder, so the attached patch works fine? 
Yes, it works fine.
And I will double check.

> The only difference with my proposal is that you trap the CTRL registers, but
> the sizing is still done in modify_bars().
> 
> What happens if (based on the attached patch) you change
> rebar_ctrl_write() to:
> 
> static void cf_check rebar_ctrl_write(const struct pci_dev *pdev,
>                                       unsigned int reg,
>                                       uint32_t val,
>                                       void *data)
> {
>     pci_conf_write32(pdev->sbdf, reg, val);
> }
Will try.

> 
> And if you don't trap any PCI_REBAR_CTRL at all?
What do you mean? If I don't trap any rebar_ctrl, how can I call 
rebar_ctrl_write?

> 
> I'm mostly interested in figuring put which part of the code in
> rebar.c makes this work (as compared to my original approach).
> 
> Thanks, Roger.

-- 
Best regards,
Jiqian Chen.

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.