On 31/05/2019 16:00, Stefano Stabellini wrote:
> Introduce two global parameters to disable debug registers trapping and
> perf counters trapping. They are only safe to use in static partitiong
> scenarios where sched=null is used -- vcpu cannot be migrated from one
> pcpu to the next.
>
> Introduce a new simple umbrella command line option
> "static_partitioning" that enables vwfi=native, sched=null, and also
> sets debug_registers_trap and perf_counters_trap to false.
>
> Signed-off-by: Stefano Stabellini <[email protected]>
> CC: Julien Grall <[email protected]>
> CC: Andrew Cooper <[email protected]>
> CC: George Dunlap <[email protected]>
> CC: Ian Jackson <[email protected]>
> CC: Jan Beulich <[email protected]>
> CC: Konrad Rzeszutek Wilk <[email protected]>
> CC: Tim Deegan <[email protected]>
> CC: Wei Liu <[email protected]>
> CC: George Dunlap <[email protected]>
> CC: Dario Faggioli <[email protected]>
> ---
> This is not ideal. The best course of action would be to implement
> proper context switching of all the necessary debug and perf counters
> registers. This is an imperfect shortcut, which could reasonably be left
> out of the upstream tree but I shared it with others for their
> convenience.
> ---
> xen/arch/arm/traps.c | 26 +++++++++++++++++++++++++-
> xen/common/schedule.c | 2 +-
> xen/include/xen/sched.h | 1 +
I see no hunk in docs/ ...
> 3 files changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index 5c18e918b0..d6eaffde23 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -118,6 +118,28 @@ static int __init parse_vwfi(const char *s)
> }
> custom_param("vwfi", parse_vwfi);
>
> +static bool debug_registers_trap = true;
> +static bool perf_counters_trap = true;
> +
> +static int __init opt_static_partitioning(const char *s)
> +{
> + if ( strcmp(s, "true") &&
> + strcmp(s, "True") &&
> + strcmp(s, "1") )
> + return 0;
Please please please don't opencode boolean checking. I think I've
purged all of it (certainly all that I'm aware of), and this example
isn't remotely compatible with existing boolean options.
Furthermore, you can't make something which looks like a single boolean
option with custom_param(), because you can't make the no- prefix work.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel