On Wed, Sep 05, 2018 at 07:12:00PM +0100, Andrew Cooper wrote: > There are holes in the HVM_PARAM space, some of which are from deprecated > parameters, but toolstack and device models currently have blanket read > access. > > Rearrange hvm_allow_get_param() to have a whitelist of toolstack-readable > parameters, with the default case failing with -EINVAL (which subsumes the > HVM_NR_PARAMS check). > > No expected change for the defined, in-use params. > > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Reviewed-by: Roger Pau Monné <roger....@citrix.com> Just one nit. > --- > CC: Jan Beulich <jbeul...@suse.com> > CC: Wei Liu <wei.l...@citrix.com> > CC: Roger Pau Monné <roger....@citrix.com> > CC: Paul Durrant <paul.durr...@citrix.com> > CC: Stefano Stabellini <sstabell...@kernel.org> > CC: Julien Grall <julien.gr...@arm.com> > --- > xen/arch/x86/hvm/hvm.c | 38 ++++++++++++++++++++++++++++---------- > 1 file changed, 28 insertions(+), 10 deletions(-) > > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c > index c22bf0b..96a6323 100644 > --- a/xen/arch/x86/hvm/hvm.c > +++ b/xen/arch/x86/hvm/hvm.c > @@ -4350,7 +4350,7 @@ static int hvm_allow_get_param(struct domain *d, > > switch ( a->index ) > { > - /* The following parameters can be read by the guest. */ > + /* The following parameters can be read by the guest and toolstack. > */ > case HVM_PARAM_CALLBACK_IRQ: > case HVM_PARAM_VM86_TSS: > case HVM_PARAM_VM86_TSS_SIZED: > @@ -4363,18 +4363,39 @@ static int hvm_allow_get_param(struct domain *d, > case HVM_PARAM_ALTP2M: > case HVM_PARAM_X87_FIP_WIDTH: > break; > - /* > - * The following parameters must not be read by the guest > - * since the domain may need to be paused. > - */ > + > + /* > + * The following parameters are intended for toolstack usage only. > + * Some require the domain to be paused, and therefore may not read > by ^ be Roger. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel