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

Re: [PATCH v3 2/3] xsm: consolidate loading the policy buffer


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 31 May 2022 18:05:42 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RXFilAsXVY1I7q6k0txm2ejLetW03uIyctVCES+Ti9E=; b=ZPfw3erQLEHw7/N751XE1BnLn6nBlQjg447M6hh3ySU+lYKZgKMk0sIHu7duvOVnwidvV9lKtq8SjsoAbz5E+7uUTtLKGLNDM6RPi98J/QTxMEahNnrPe0pO4cTXhESBpQNSbXMepq5oCryCRdQmbHFHI0y71TQCwPmk/CRTXhkKb3ih0iDbsEwQvWhOGLM2okH92HcUyJsr9cDLz0lzFPgo9+PJmbQqf0txSmKRM9Kf/Mw6xz2V1h+DSuyl7vvDQMQrWBQHllwQcK/nwpYQDeyxEcqX9ZydvG3ru0lNu8TAIOITgLrdvRBa78bS14fp3QBiBak6TIsDN7ge7fR2ZQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CA9pnhDjJkKu9XsJM361iVutVqnOrbQiwVvvPf4ytTvBjCHZ5jZGGYS48XQdYT8cNuDhv2yRt8sr1G+AoC0ZSLYqXunb/k1zvSFwodSlT51aUGdpYmcJnpmlZfMv6yWQg+ozEi+OFU1lKZkhI/Q8/+v081TuF3BG+6ZgDONkzE7rV/ue0qt1VbjUrkz7ujkJ8K03BbKOLcRx8hKaQViE3oXzE4d6+fD0abclsG4tHSDlKTc8LgZcmR1WZkvs8XsnhxoVMAgWuXn/fiMKrs5psuyzIObeSnO0PJeq/m7k5Om/HK+0usF2vU2DVK3U4XYa03r9G4FWHcSme59ZvfWUwA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: scott.davis@xxxxxxxxxx, christopher.clark@xxxxxxxxxx, jandryuk@xxxxxxxxx, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 31 May 2022 16:05:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.05.2022 17:08, Daniel P. Smith wrote:
> Previously, initializing the policy buffer was split between two functions,
> xsm_{multiboot,dt}_policy_init() and xsm_core_init(). The latter for loading
> the policy from boot modules and the former for falling back to built-in 
> policy.
> 
> This patch moves all policy buffer initialization logic under the
> xsm_{multiboot,dt}_policy_init() functions. It then ensures that an error
> message is printed for every error condition that may occur in the functions.
> With all policy buffer init contained and only called when the policy buffer
> must be populated, the respective xsm_{mb,dt}_init() functions will panic if 
> an
> error occurs attempting to populate the policy buffer.

"flask=late" is also a mode where, afaict, no policy is required. I can't,
however, see how you're taking care of that (but maybe I'm overlooking
something); inspecting flask_bootparam in generic XSM code would actually
be a layering violation.

> --- a/xen/include/xsm/xsm.h
> +++ b/xen/include/xsm/xsm.h
> @@ -775,7 +775,7 @@ int xsm_multiboot_init(
>      unsigned long *module_map, const multiboot_info_t *mbi);
>  int xsm_multiboot_policy_init(
>      unsigned long *module_map, const multiboot_info_t *mbi,
> -    void **policy_buffer, size_t *policy_size);
> +    const unsigned char *policy_buffer[], size_t *policy_size);

I don't think we're dealing with an array here, so const unsigned char **
would seem the more correct representation to me.

Also - what about the DT counterpart function?

Jan




 


Rackspace

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