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

[Xen-devel] [PATCH v5 00/15] Support for modifying parameters at runtime



Currently parameters of the hypervisor (e.g. console log level) can be
set via boot command line. Instead of having to reboot the system in
case another setting is desired, being able to modify many of those
parameters at runtime would be the better option.

This patch series addresses this by adding a new xl command
"xl set-parameters" which takes a string similar to the boot command
line as parameter and passes this string to the hypervisor which will
then use the same parsing infrastructure as for the command line in
order to apply the parameter settings.

As error checks for invalid parameters or parameter values have been
very sparse if present at all in the hypervisor, the first part of this
patch series addresses this problem first: all custom parameter parsing
functions are being changed to return success or an error. The main
parsing function tests for generic parameter value errors (like e.g.
overflow) or invalid parameters and issues a message in case an error
has been detected. Most error messages in the custom parsing functions
are removed then.

While not strictly required for runtime parameter modification I
believe an improved parameter validation is a win with or without the
runtime parameter modification support.

* Patch 1 modifies the last remaining custom parameter parsing function
  not returning success or error to do so
* Patch 2 adds generic parameter error tests in the core parameter
  parsing functions
* Patches 3-8 remove custom parsing function error messages
* Patches 9-14 add the runtime parameter modification support
* Patch 15 adds support for runtime modification of some console related
  parameters 

Changes in V5:
- 38 patches dropped as they are already applied
- Patch 1: rename variable (value -> delim, val_str -> val_delim)
    (Jan Beulich)

Changes in V4:
- added new patch 01
- patches 19, 23, 32, 34: pass end of parameter value to parse_bool()
    (Jan Beulich)
- patch 21: issue a message in case of reboot=efi and no EFI runtime services
    (Jan Beulich)
- patch 23: style correction (Jan Beulich)
- patch 32: add __initdata (Jan Beulich)
- patch 35: differentiate error return values (Jan Beulich)
- patch 35: drop pointless test for input parameter being NULL (Jan Beulich)
- patch 40: removed test for empty string from parse_bool() again, avoid
    calling parse_bool() in that case (Jan Beulich)
- patch 40: print error number in failure case (Jan Beulich)
- patch 40: limit scope of some variables (Jan Beulich)
- patch 40: use type bool for bool_assert (Jan Beulich)
- patch 49: use copy_from_guest() (Jan Beulich)
- patch 49: add more descriptive comment to sysctl.h (Jan Beulich)

Changes in V3:
- patches 7, 14, 15, 24, 27, 34: cosmetic changes (Jan Beulich)
- patches 7, 9, 10, 18, 22, 25, 31, 33, 34: dont modify option value in
    parsing function
- patches 8, 22, 25: dont return out of loop (Jan Beulich)
- patch 9: fix error in parsing routine
- patch 18: let parse_psr_bool() return bool value (Jan Beulich)
- patch 18: return error in case no string matches (Jan Beulich)
- patch 20: dont stop loop at first invalid character (Jan Beulich)
- patch 31: remove prototype of cpufreq_cmdline_parse() from cpufreq.h
    and make it static
- patch 39: use function pointer in struct kernel_param (Jan Beulich)
- patch 39: better range check in assign_integer_param() (Jan Beulich)
- patch 39: dont assign int values in case of overflow (Jan Beulich)
- patch 39: allow multiple handlers for a parameter (Jan Beulich)
- patch 47: moved runtime parameter array in linker scripts (Jan Beulich)
- patch 47: renamed macros to *_runtime_param() (Jan Beulich)
- patch 47: added *runtime_only_param() macros (Jan Beulich)
- patch 47: let *_runtime_param() macros include boot param functionality
    (Jan Beulich)
- patch 48: check pad[] to be zero (Jan Beulich)
- patch 48: return E2BIG in case of parameters too long (Jan Beulich)
- patch 48: move max. parameter size define to sysctl.c (Jan Beulich)
- patch 49: zero padding fields in sysctl.u.set_parameter
- patch 50: use LOGEV() for error message
- patch 52: *_runtime_param() now includes boot parameter setting
    (Jan Beulich)

Changes in V2:
- patch 39 (xen: check parameter validity when parsing command line):
  replaced literal 8 by BITS_PER_BYTE (Wei Liu)
  added test for empty string to parse_bool()
- patch 47 (xen: add basic support for runtime parameter changing):
  added modification of ARM linker script (Wei Liu)
- patch 48 (xen: add hypercall for setting parameters at runtime):
  corrected XSM test (Daniel De Graaf)
- patch 50 (libxl: add libxl_set_parameters() function):
  corrected coding style (Wei Liu)

Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Cc: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
Cc: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Paul Durrant <paul.durrant@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>

Juergen Gross (15):
  xen/arch/x86/psr.c: let custom parameter parsing routines return errno
  xen: check parameter validity when parsing command line
  xen/arch/x86/apic.c: remove custom_param() error messages
  xen/arch/x86/cpu/mcheck/mce.c: remove custom_param() error messages
  xen/arch/x86/hvm/viridian.c: remove custom_param() error messages
  xen/arch/x86/io_apic.c: remove custom_param() error messages
  xen/common/kexec.c: remove custom_param() error messages
  xen/common/sched_credit2.c: remove custom_param() error messages
  xen: carve out a generic parsing function from _cmdline_parse()
  xen: add basic support for runtime parameter changing
  xen: add hypercall for setting parameters at runtime
  libxc: add function to set hypervisor parameters
  libxl: add libxl_set_parameters() function
  xl: add new xl command set-parameters
  xen: make some console related parameters settable at runtime

 docs/man/xl.pod.1.in                |  5 ++
 docs/misc/xen-command-line.markdown |  8 ++++
 tools/flask/policy/modules/dom0.te  |  2 +-
 tools/libxc/include/xenctrl.h       |  1 +
 tools/libxc/xc_misc.c               | 21 +++++++++
 tools/libxl/libxl.c                 | 15 ++++++
 tools/libxl/libxl.h                 |  8 ++++
 tools/xl/xl.h                       |  1 +
 tools/xl/xl_cmdtable.c              |  5 ++
 tools/xl/xl_misc.c                  | 20 ++++++++
 xen/arch/arm/xen.lds.S              |  4 ++
 xen/arch/x86/apic.c                 |  5 +-
 xen/arch/x86/cpu/mcheck/mce.c       |  4 --
 xen/arch/x86/hvm/viridian.c         | 10 ++--
 xen/arch/x86/io_apic.c              |  3 --
 xen/arch/x86/psr.c                  | 58 ++++++++++++++---------
 xen/arch/x86/xen.lds.S              |  4 ++
 xen/common/kernel.c                 | 94 +++++++++++++++++++++++++++++--------
 xen/common/kexec.c                  |  5 --
 xen/common/sched_credit2.c          |  2 -
 xen/common/sysctl.c                 | 36 ++++++++++++++
 xen/drivers/char/console.c          | 18 +++----
 xen/include/public/sysctl.h         | 20 ++++++++
 xen/include/xen/init.h              | 87 ++++++++++++++++++++++++++++++----
 xen/include/xen/lib.h               |  1 +
 xen/include/xen/types.h             |  3 ++
 xen/xsm/flask/hooks.c               |  3 ++
 xen/xsm/flask/policy/access_vectors |  2 +
 28 files changed, 362 insertions(+), 83 deletions(-)

-- 
2.12.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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