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

Re: [PATCH v9 5/8] vpci: Refactor vpci_remove_register to remove matched registers


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Date: Thu, 31 Jul 2025 06:28:14 +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=r3ayATdbMbePqSOR20UjMeY8g5n5cXyrFzdbrM6AV9A=; b=KzeE6DyBiFSWMcOkUlBawOdee2dvl+pl2jhJtc79pEwzfj3/blfD6+YFI0Zl34vHqvDKaSRHSgg9rrwmpL95O7nToNKcwCnbgwkiO00I3e/WWdddCUqM+9hyIkcDUddHOE0vbZbtaYpmINkEQdArl6JOuiaHZMLGFyLpnSDcgC3tqRgqlBCIPfpsgdLpTfgQBBnNZj+Rk8v5QWglc+eUX6XgINc42IP6gGtcgMNnwHcnefwPvWky/nF48nESIOPil+TcWogn6POhw9GVynd3IQ1/ImplMIZxm1jmeropAX0DmnbIin1/NLQ0tcRN8OJnrL1TspqI1MZOBRRwKA6nCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jvV5d2ySdT6D0PSFz30GpG0RAs7nSdgZO8uH0A+aBRQg6TQ+S9qlbXOd0wtdbceP3/sd1suoJFUc2eerO27vysQM1ciQydAu1H7iGEUt5Quw8sepLrjpltUe6if3Fnw0EJTvspb4F159M9l9WlgEKH6SBOYSP2+NnnfVFZ+88hx/ILUXQCylz51fSfUR54j/0kO3dLK/cyqbvtNcf1PonejbA9ynm2THu/90TJX+Tfo1ESWSygraKubaq17WIFMoU/K7PxYL7/co2lLG8Cngfzo3YpaDmRac+VFcNsb4RN4QlhT6EjYmMkrON17t5vlesfGOU+2TF0B6GysgSVPTSw==
  • 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>, "Huang, Ray" <Ray.Huang@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Chen, Jiqian" <Jiqian.Chen@xxxxxxx>
  • Delivery-date: Thu, 31 Jul 2025 06:28:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/30gIptlaEQcK0u9xBwFJcYIVrRKieMAgAHBDgA=
  • Thread-topic: [PATCH v9 5/8] vpci: Refactor vpci_remove_register to remove matched registers

On 2025/7/30 19:23, Andrew Cooper wrote:
> On 28/07/2025 6:03 am, Jiqian Chen wrote:
>> vpci_remove_register() only supports removing a register in a time,
>> but the follow-on changes need to remove all registers within a range.
>> So, refactor it to support removing all registers in a given region.
>>
>> And it is no issue to remove a non exist register, so remove the
>> __must_check prefix.
>>
>> Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
>> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> Bisection says this causes an assertion failure in the unit test.
> 
> Running /usr/lib/xen/tests/test_vpci
> Assertion failed: vpci_remove_registers(test_pdev.vpci, 16, 2) (main.c:
> main: 407)
> FAILED: /usr/lib/xen/tests/test_vpci
Thanks Andrew.
This is because new function vpci_remove_registers() removes all registers 
inside (offset, offset + size) and returns failure when overlap happens.
For tools/tests/vpci/main.c, there are layout:
     *
     * 32    24    16     8     0
     *  +------+------+------+------+
     *  |            r0             | 0
     *  +------+------+------+------+
     *  |  r7  |  r6  |  r5  |//////| 4
     *  +------+------+------+------|
     *  |///////////////////////////| 8
     *  +-------------+-------------+
     *  |/////////////|    r12      | 12
     *  +------+------+------+------+
     *  |r16[3]|r16[2]|r16[1]|r16[0]| 16
     *  +------+------+------+------+
     *  |    r20[1]   |    r20[0]   | 20
     *  +-------------+-------------|
     *  |            r24            | 24
     *  +------+------+------+------+
     *  |//////|  r30 |//////|  r28 | 28
     *  +------+------+------+------+
     *  |rsvdz |rsvdp | rw1c |  ro  | 32
     *  +------+------+------+------+
     *
As for the last three test cases:
    VPCI_REMOVE_INVALID_REG(20, 1);
    This can success as this overlap with r20[0]
    VPCI_REMOVE_INVALID_REG(16, 2);
    VPCI_REMOVE_INVALID_REG(30, 2);
    These two fail as there are r16[0], r16[1] and r30 inside them, so remove 
success and test cases fail.
So, I think we need to change these two test cases to match the new function's 
logic, like:
VPCI_REMOVE_INVALID_REG(0, 2);
VPCI_REMOVE_INVALID_REG(2, 2);
Or delete them directly.

Hi Roger, what's your opinion?

> 
> Full logs, not that they're of any more help:
> 
> https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1956817587
> 
> ~Andrew

-- 
Best regards,
Jiqian Chen.

 


Rackspace

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