All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/53] Support for modifying parameters at runtime
@ 2017-08-23 17:33 Juergen Gross
  2017-08-23 17:33 ` [PATCH v4 01/53] xen: add an optional string end parameter to parse_bool() Juergen Gross
                   ` (52 more replies)
  0 siblings, 53 replies; 75+ messages in thread
From: Juergen Gross @ 2017-08-23 17:33 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross

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, a major 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 prepares the following patches by adding an end pointer to
  parse_bool()
* Patches 2-39 are modifying the custom parameter parsing functions to
  return success or error
* Patch 40 adds generic parameter error tests in the core parameter
  parsing functions
* Patches 41-46 remove custom parsing function error messages
* Patches 47-52 add the runtime parameter modification support
* Patch 53 adds support for runtime modification of some console related
  parameters 

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)


Juergen Gross (53):
  xen: add an optional string end parameter to parse_bool()
  xen/arch/arm/acpi/boot.c: let custom parameter parsing routines return
    errno
  xen/arch/arm/domain_build.c: let custom parameter parsing routines
    return errno
  xen/arch/arm/traps.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/apic.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/cpu/mcheck/mce.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/cpu/vpmu.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/dom0_build.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/genapic/probe.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/hvm/viridian.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/hvm/vmx/vmcs.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/io_apic.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/irq.c: let custom parameter parsing routines return errno
  xen/arch/x86/microcode.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/mm.c: let custom parameter parsing routines return errno
  xen/arch/x86/nmi.c: let custom parameter parsing routines return errno
  xen/arch/x86/numa.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/oprofile/nmi_int.c: let custom parameter parsing routines
    return errno
  xen/arch/x86/psr.c: let custom parameter parsing routines return errno
  xen/arch/x86/setup.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/shutdown.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/time.c: let custom parameter parsing routines return
    errno
  xen/arch/x86/x86_64/mmconfig-shared.c: let custom parameter parsing
    routines return errno
  xen/common/core_parking.c: let custom parameter parsing routines
    return errno
  xen/common/domain.c: let custom parameter parsing routines return
    errno
  xen/common/efi/boot.c: let custom parameter parsing routines return
    errno
  xen/common/kexec.c: let custom parameter parsing routines return errno
  xen/common/memory.c: let custom parameter parsing routines return
    errno
  xen/common/sched_credit2.c: let custom parameter parsing routines
    return errno
  xen/drivers/acpi/tables.c: let custom parameter parsing routines
    return errno
  xen/drivers/char/console.c: let custom parameter parsing routines
    return errno
  xen/drivers/cpufreq/cpufreq.c: let custom parameter parsing routines
    return errno
  xen/drivers/passthrough/amd/iommu_acpi.c: let custom parameter parsing
    routines return errno
  xen/drivers/passthrough/iommu.c: let custom parameter parsing routines
    return errno
  xen/drivers/passthrough/pci.c: let custom parameter parsing routines
    return errno
  xen/drivers/passthrough/vtd/dmar.c: let custom parameter parsing
    routines return errno
  xen/drivers/passthrough/vtd/quirks.c: let custom parameter parsing
    routines return errno
  xen/drivers/video/vesa.c: let custom parameter parsing routines return
    errno
  xen/xsm/flask/flask_op.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/acpi/boot.c                 |  10 ++-
 xen/arch/arm/domain_build.c              |   4 +-
 xen/arch/arm/traps.c                     |   8 ++-
 xen/arch/arm/xen.lds.S                   |   4 ++
 xen/arch/x86/apic.c                      |  10 +--
 xen/arch/x86/cpu/mcheck/mce.c            |   7 +-
 xen/arch/x86/cpu/vpmu.c                  |  13 ++--
 xen/arch/x86/dom0_build.c                |  32 ++++++---
 xen/arch/x86/genapic/probe.c             |  11 ++-
 xen/arch/x86/hvm/viridian.c              |  34 +++++----
 xen/arch/x86/hvm/vmx/vmcs.c              |  19 +++--
 xen/arch/x86/io_apic.c                   |   6 +-
 xen/arch/x86/irq.c                       |  23 +++---
 xen/arch/x86/microcode.c                 |  10 ++-
 xen/arch/x86/mm.c                        |  10 ++-
 xen/arch/x86/nmi.c                       |  23 ++++--
 xen/arch/x86/numa.c                      |  16 +++--
 xen/arch/x86/oprofile/nmi_int.c          |   3 +
 xen/arch/x86/psr.c                       |  56 +++++++++------
 xen/arch/x86/setup.c                     |  41 +++++++----
 xen/arch/x86/shutdown.c                  |  14 +++-
 xen/arch/x86/time.c                      |   6 +-
 xen/arch/x86/x86_64/mmconfig-shared.c    |  30 +++++---
 xen/arch/x86/xen.lds.S                   |   4 ++
 xen/common/core_parking.c                |   6 +-
 xen/common/domain.c                      |   5 +-
 xen/common/efi/boot.c                    |  19 +++--
 xen/common/kernel.c                      | 118 +++++++++++++++++++++++--------
 xen/common/kexec.c                       |  31 ++++++--
 xen/common/memory.c                      |   5 +-
 xen/common/sched_credit2.c               |   6 +-
 xen/common/sysctl.c                      |  36 ++++++++++
 xen/drivers/acpi/tables.c                |   7 +-
 xen/drivers/char/console.c               |  41 ++++++-----
 xen/drivers/cpufreq/cpufreq.c            |  39 ++++++----
 xen/drivers/passthrough/amd/iommu_acpi.c |  26 ++++---
 xen/drivers/passthrough/iommu.c          |  52 ++++++++------
 xen/drivers/passthrough/pci.c            |  38 ++++++----
 xen/drivers/passthrough/vtd/dmar.c       |   4 +-
 xen/drivers/passthrough/vtd/quirks.c     |   9 +--
 xen/drivers/video/vesa.c                 |   4 +-
 xen/include/acpi/cpufreq/cpufreq.h       |   2 -
 xen/include/public/sysctl.h              |  20 ++++++
 xen/include/xen/init.h                   |  87 ++++++++++++++++++++---
 xen/include/xen/lib.h                    |   3 +-
 xen/include/xen/types.h                  |   3 +
 xen/xsm/flask/flask_op.c                 |   6 +-
 xen/xsm/flask/hooks.c                    |   3 +
 xen/xsm/flask/policy/access_vectors      |   2 +
 59 files changed, 775 insertions(+), 277 deletions(-)

-- 
2.12.3


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

^ permalink raw reply	[flat|nested] 75+ messages in thread

end of thread, other threads:[~2017-08-25  8:50 UTC | newest]

Thread overview: 75+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 17:33 [PATCH v4 00/53] Support for modifying parameters at runtime Juergen Gross
2017-08-23 17:33 ` [PATCH v4 01/53] xen: add an optional string end parameter to parse_bool() Juergen Gross
2017-08-24  6:04   ` Tian, Kevin
2017-08-24 11:47   ` Wei Liu
2017-08-24 15:33   ` Jan Beulich
2017-08-24 15:43   ` Andrew Cooper
2017-08-25  8:31     ` Juergen Gross
2017-08-25  8:50       ` Jan Beulich
     [not found]   ` <599F0DFB020000780017365B@suse.com>
2017-08-24 16:28     ` Juergen Gross
2017-08-23 17:33 ` [PATCH v4 02/53] xen/arch/arm/acpi/boot.c: let custom parameter parsing routines return errno Juergen Gross
2017-08-23 17:33 ` [PATCH v4 03/53] xen/arch/arm/domain_build.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 04/53] xen/arch/arm/traps.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 05/53] xen/arch/x86/apic.c: " Juergen Gross
2017-08-23 17:33 ` [PATCH v4 06/53] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 07/53] xen/arch/x86/cpu/vpmu.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 08/53] xen/arch/x86/dom0_build.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 09/53] xen/arch/x86/genapic/probe.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 10/53] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 11/53] xen/arch/x86/hvm/vmx/vmcs.c: " Juergen Gross
2017-08-24  6:07   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 12/53] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 13/53] xen/arch/x86/irq.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 14/53] xen/arch/x86/microcode.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 15/53] xen/arch/x86/mm.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 16/53] xen/arch/x86/nmi.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 17/53] xen/arch/x86/numa.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 18/53] xen/arch/x86/oprofile/nmi_int.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 19/53] xen/arch/x86/psr.c: " Juergen Gross
2017-08-24 15:35   ` Jan Beulich
     [not found]   ` <599F0E57020000780017365E@suse.com>
2017-08-24 16:27     ` Juergen Gross
2017-08-25  8:17       ` Jan Beulich
     [not found]       ` <599FF92102000078001738F2@suse.com>
2017-08-25  8:33         ` Juergen Gross
2017-08-23 17:34 ` [PATCH v4 20/53] xen/arch/x86/setup.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 21/53] xen/arch/x86/shutdown.c: " Juergen Gross
2017-08-25  8:40   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 22/53] xen/arch/x86/time.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 23/53] xen/arch/x86/x86_64/mmconfig-shared.c: " Juergen Gross
2017-08-25  8:41   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 24/53] xen/common/core_parking.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 25/53] xen/common/domain.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 26/53] xen/common/efi/boot.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 27/53] xen/common/kexec.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 28/53] xen/common/memory.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 29/53] xen/common/sched_credit2.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 30/53] xen/drivers/acpi/tables.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 31/53] xen/drivers/char/console.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 32/53] xen/drivers/cpufreq/cpufreq.c: " Juergen Gross
2017-08-25  8:42   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 33/53] xen/drivers/passthrough/amd/iommu_acpi.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 34/53] xen/drivers/passthrough/iommu.c: " Juergen Gross
2017-08-25  8:43   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 35/53] xen/drivers/passthrough/pci.c: " Juergen Gross
2017-08-25  8:44   ` Jan Beulich
2017-08-23 17:34 ` [PATCH v4 36/53] xen/drivers/passthrough/vtd/dmar.c: " Juergen Gross
2017-08-24  6:09   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 37/53] xen/drivers/passthrough/vtd/quirks.c: " Juergen Gross
2017-08-24  6:10   ` Tian, Kevin
2017-08-23 17:34 ` [PATCH v4 38/53] xen/drivers/video/vesa.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 39/53] xen/xsm/flask/flask_op.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 40/53] xen: check parameter validity when parsing command line Juergen Gross
2017-08-24 14:27   ` Wei Liu
2017-08-23 17:34 ` [PATCH v4 41/53] xen/arch/x86/apic.c: remove custom_param() error messages Juergen Gross
2017-08-23 17:34 ` [PATCH v4 42/53] xen/arch/x86/cpu/mcheck/mce.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 43/53] xen/arch/x86/hvm/viridian.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 44/53] xen/arch/x86/io_apic.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 45/53] xen/common/kexec.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 46/53] xen/common/sched_credit2.c: " Juergen Gross
2017-08-23 17:34 ` [PATCH v4 47/53] xen: carve out a generic parsing function from _cmdline_parse() Juergen Gross
2017-08-23 17:34 ` [PATCH v4 48/53] xen: add basic support for runtime parameter changing Juergen Gross
2017-08-23 17:34 ` [PATCH v4 49/53] xen: add hypercall for setting parameters at runtime Juergen Gross
2017-08-24 14:28   ` Wei Liu
2017-08-23 17:34 ` [PATCH v4 50/53] libxc: add function to set hypervisor parameters Juergen Gross
2017-08-23 17:34 ` [PATCH v4 51/53] libxl: add libxl_set_parameters() function Juergen Gross
2017-08-23 17:34 ` [PATCH v4 52/53] xl: add new xl command set-parameters Juergen Gross
2017-08-23 17:34 ` [PATCH v4 53/53] xen: make some console related parameters settable at runtime Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.