Cleanup and code duplication removal in xenguest
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest7 patches 2 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | tools/xenguest: Dynamically allocate xc_cpu_policy_t contentstools/ tools/ tools/ +4 more | +119 | 1 reply | |
| 2/7 | tools/xg: Simplify write_x86_cpu_policy_records()tools/ | +17 | 0 replies | |
| 3/7 | tools/xg: Add self-(de)serialisation functions for cpu_policytools/ | +49 | 0 replies | |
| 4/7 | tools/xg: Split xc_cpu_policy_set_domain()tools/ tools/ tools/ | +21 | 0 replies | |
| 5/7 | tools/xg: Streamline xc_cpuid_apply_policy()tools/ tools/ | +93 | 0 replies | |
| 6/7 | tools/xg: Simplify xc_cpuid_xend_policy() and xc_msr_policy()tools/ | +38 | 1 reply | |
| 7/7 | tools/xg: Simplify hypercall stubstools/ | +22 | 0 replies |
Reviews trailers per patch
1 of 7 patches has a Reviewed-by or Acked-by.
| Patch | Anthony PERARD |
|---|---|
| 1/7 | R-b |
| 2/7 | |
| 3/7 | |
| 4/7 | |
| 5/7 | |
| 6/7 | |
| 7/7 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/7] Cleanup and code duplication removal in xenguest
NOTE: This series is still under test
This series tries to bind the current xc_cpu_policy_t and its serialization buffers. Having them separate makes it hard to extend of modify the serialized policy structure and needlessly leaks details in places that don't need them, causing a lot of boilerplate and code duplication. The resulting code is >100LoC leaner.
The series is not as aggressive as it could be, but it's enough to unlock future work regarding cpu policy extensions and ought to make toolstack interactions a lot faster.
Patch 1: Remove the fixed buffers in xc_cpu_policy_t and create pointers
populated during xc_cpu_policy_init() instead.
Patch 2: Removes boilerplate by making use of the newly created buffers Patch 3: Adds a couple of helpers to keep the 2 forms inside the
xc_cpu_policy_t object consistently in sync.
Patch 4: Splits the common set_cpu_policy wrapper in 2. One to send the
deserialized form of the policy object (after serializing it internally first) and another to send the serialized form directly.
Patch 5: Uses the previous patches to avoid a lot of boilerplate in the
main policy manipulation routine.
Patch 6: Remove code duplication in the xend-style override setters Patch 7: Final cleanup so the get_cpu_policy wrappers can operate on policy
objects directly
Alejandro Vallejo (7):
tools/xenguest: Dynamically allocate xc_cpu_policy_t contents tools/xg: Simplify write_x86_cpu_policy_records() tools/xg: Add self-(de)serialisation functions for cpu_policy tools/xg: Split xc_cpu_policy_set_domain() tools/xg: Streamline xc_cpuid_apply_policy() tools/xg: Simplify xc_cpuid_xend_policy() and xc_msr_policy() tools/xg: Simplify hypercall stubs
tools/include/xenguest.h | 11 +- tools/libs/guest/xg_cpuid_x86.c | 626 +++++++++++---------------- tools/libs/guest/xg_private.h | 17 +- tools/libs/guest/xg_sr_common_x86.c | 55 +-- tools/misc/xen-cpuid.c | 2 +- tools/tests/tsx/test-tsx.c | 61 +-- xen/include/xen/lib/x86/cpu-policy.h | 2 +- 7 files changed, 318 insertions(+), 456 deletions(-)
Signature · 1 line
2.34.1