mbox series

[v3,0/2] hw/core/machine: Add an unit test for smp_parse

Message ID 20211026034659.22040-1-wangyanan55@huawei.com
Headers show
Series hw/core/machine: Add an unit test for smp_parse | expand

Message

wangyanan (Y) Oct. 26, 2021, 3:46 a.m. UTC
Hi,

This is v3 which introduces an unit test for generic smp_parse.

We have had enough discussions about what kind of SMP configurations
by the user should be considered valid and what should be invalid.
Since we have finished optimizing the SMP parsing code, then this
test normatively listed all the possible valid/invalid configurations
that the user can provide. This can be a testing tool when we
introduce new topology members and need to touch the parsing code.

For your reference, some related discussion is here:
https://lore.kernel.org/qemu-devel/YOxf+sxzUSJdbY+j@redhat.com/

Changelog:
v2->v3:
- add Andrew's R-b for PATCH #1
- drop an unused macro definition in PATCH #2
- v2: https://lore.kernel.org/qemu-devel/20211013074119.23028-1-wangyanan55@huawei.com/

v1->v2:
- split smp_parse out into a separate .c file instead of a header (patch #1)
- dropped an unnecessary function and add Andrew's R-b (patch #2)
- v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyanan55@huawei.com/

Yanan Wang (2):
  hw/core/machine: Split out the smp parsing code
  tests/unit: Add an unit test for smp parsing

 MAINTAINERS                 |   2 +
 hw/core/machine-smp.c       | 181 +++++++++++
 hw/core/machine.c           | 159 ----------
 hw/core/meson.build         |   2 +
 include/hw/boards.h         |   1 +
 tests/unit/meson.build      |   1 +
 tests/unit/test-smp-parse.c | 594 ++++++++++++++++++++++++++++++++++++
 7 files changed, 781 insertions(+), 159 deletions(-)
 create mode 100644 hw/core/machine-smp.c
 create mode 100644 tests/unit/test-smp-parse.c

--
2.19.1

Comments

wangyanan (Y) Oct. 28, 2021, 11:50 a.m. UTC | #1
Hi,
Does this short series have a chance to get on the train for 6.2
before the closely coming soft-feature freeze? It would be very
nice to have a test finally, since all the previous work on -smp
code has been completed and merged, IMO. 😉

Regards,
Yanan

On 2021/10/26 11:46, Yanan Wang wrote:
> Hi,
>
> This is v3 which introduces an unit test for generic smp_parse.
>
> We have had enough discussions about what kind of SMP configurations
> by the user should be considered valid and what should be invalid.
> Since we have finished optimizing the SMP parsing code, then this
> test normatively listed all the possible valid/invalid configurations
> that the user can provide. This can be a testing tool when we
> introduce new topology members and need to touch the parsing code.
>
> For your reference, some related discussion is here:
> https://lore.kernel.org/qemu-devel/YOxf+sxzUSJdbY+j@redhat.com/
>
> Changelog:
> v2->v3:
> - add Andrew's R-b for PATCH #1
> - drop an unused macro definition in PATCH #2
> - v2: https://lore.kernel.org/qemu-devel/20211013074119.23028-1-wangyanan55@huawei.com/
>
> v1->v2:
> - split smp_parse out into a separate .c file instead of a header (patch #1)
> - dropped an unnecessary function and add Andrew's R-b (patch #2)
> - v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyanan55@huawei.com/
>
> Yanan Wang (2):
>    hw/core/machine: Split out the smp parsing code
>    tests/unit: Add an unit test for smp parsing
>
>   MAINTAINERS                 |   2 +
>   hw/core/machine-smp.c       | 181 +++++++++++
>   hw/core/machine.c           | 159 ----------
>   hw/core/meson.build         |   2 +
>   include/hw/boards.h         |   1 +
>   tests/unit/meson.build      |   1 +
>   tests/unit/test-smp-parse.c | 594 ++++++++++++++++++++++++++++++++++++
>   7 files changed, 781 insertions(+), 159 deletions(-)
>   create mode 100644 hw/core/machine-smp.c
>   create mode 100644 tests/unit/test-smp-parse.c
>
> --
> 2.19.1
>
> .
Philippe Mathieu-Daudé Oct. 28, 2021, 2:44 p.m. UTC | #2
On 10/26/21 05:46, Yanan Wang wrote:
> Hi,
> 
> This is v3 which introduces an unit test for generic smp_parse.
> 
> We have had enough discussions about what kind of SMP configurations
> by the user should be considered valid and what should be invalid.
> Since we have finished optimizing the SMP parsing code, then this
> test normatively listed all the possible valid/invalid configurations
> that the user can provide. This can be a testing tool when we
> introduce new topology members and need to touch the parsing code.
> 
> For your reference, some related discussion is here:
> https://lore.kernel.org/qemu-devel/YOxf+sxzUSJdbY+j@redhat.com/
> 
> Changelog:
> v2->v3:
> - add Andrew's R-b for PATCH #1
> - drop an unused macro definition in PATCH #2
> - v2: https://lore.kernel.org/qemu-devel/20211013074119.23028-1-wangyanan55@huawei.com/
> 
> v1->v2:
> - split smp_parse out into a separate .c file instead of a header (patch #1)
> - dropped an unnecessary function and add Andrew's R-b (patch #2)
> - v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyanan55@huawei.com/
> 
> Yanan Wang (2):
>   hw/core/machine: Split out the smp parsing code
>   tests/unit: Add an unit test for smp parsing

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
wangyanan (Y) Oct. 29, 2021, 6:28 a.m. UTC | #3
On 2021/10/28 22:44, Philippe Mathieu-Daudé wrote:
> On 10/26/21 05:46, Yanan Wang wrote:
>> Hi,
>>
>> This is v3 which introduces an unit test for generic smp_parse.
>>
>> We have had enough discussions about what kind of SMP configurations
>> by the user should be considered valid and what should be invalid.
>> Since we have finished optimizing the SMP parsing code, then this
>> test normatively listed all the possible valid/invalid configurations
>> that the user can provide. This can be a testing tool when we
>> introduce new topology members and need to touch the parsing code.
>>
>> For your reference, some related discussion is here:
>> https://lore.kernel.org/qemu-devel/YOxf+sxzUSJdbY+j@redhat.com/
>>
>> Changelog:
>> v2->v3:
>> - add Andrew's R-b for PATCH #1
>> - drop an unused macro definition in PATCH #2
>> - v2: https://lore.kernel.org/qemu-devel/20211013074119.23028-1-wangyanan55@huawei.com/
>>
>> v1->v2:
>> - split smp_parse out into a separate .c file instead of a header (patch #1)
>> - dropped an unnecessary function and add Andrew's R-b (patch #2)
>> - v1: https://lore.kernel.org/qemu-devel/20211010103954.20644-1-wangyanan55@huawei.com/
>>
>> Yanan Wang (2):
>>    hw/core/machine: Split out the smp parsing code
>>    tests/unit: Add an unit test for smp parsing
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
Thank you for the testing/review and the help of v4 respin.

Thanks,
Yanan
.