All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	xen-devel@lists.xensource.com
Cc: dgdegra@tycho.nsa.gov
Subject: Re: [PATCH v4 2/3] arm: export platform_op XENPF_settime64
Date: Mon, 16 Nov 2015 13:08:11 +0000	[thread overview]
Message-ID: <1447679291.27871.81.camel@citrix.com> (raw)
In-Reply-To: <1447350364-22923-2-git-send-email-stefano.stabellini@eu.citrix.com>

On Thu, 2015-11-12 at 17:46 +0000, Stefano Stabellini wrote:
> Call update_domain_wallclock_time at domain initialization.
> Set time_offset_seconds to the number of seconds between physical boot
> and domain initialization: it is going to be used to get/set the
> wallclock time.
> Add time_offset_seconds to system_time when before calling do_settime,
> so that system_time actually accounts for all the time in nsec between
> machine boot and when the wallclock was set.
> 
> Expose xsm_platform_op to ARM.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

An aside:[...]
@@ -1332,6 +1332,75 @@ static int flask_deassign_dtdevice(struct domain
> *d, const char *dtpath)
>  }
>  #endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
>  
> +static int flask_platform_op(uint32_t op)
> +{
> +    switch ( op )
> +    {
> +#ifdef CONFIG_X86
> +    /* These operations have their own XSM hooks */
> +    case XENPF_cpu_online:
> +    case XENPF_cpu_offline:
> +    case XENPF_cpu_hotadd:
> +    case XENPF_mem_hotadd:
> +        return 0;

Should this not then be an error (e.g. fail closed)?

Also, although only implemented today for x86 they don't seem inherently
any more x86 specific than many of the other things below, so maybe the
ifdef could be ditched?


> +#endif
> +
> +    case XENPF_settime32:
> +    case XENPF_settime64:
> +        return domain_has_xen(current->domain, XEN__SETTIME);
> +
> +    case XENPF_add_memtype:
> +        return domain_has_xen(current->domain, XEN__MTRR_ADD);
> +
> +    case XENPF_del_memtype:
> +        return domain_has_xen(current->domain, XEN__MTRR_DEL);
> +
> +    case XENPF_read_memtype:
> +        return domain_has_xen(current->domain, XEN__MTRR_READ);
> +
> +    case XENPF_microcode_update:
> +        return domain_has_xen(current->domain, XEN__MICROCODE);
> +
> +    case XENPF_platform_quirk:
> +        return domain_has_xen(current->domain, XEN__QUIRK);
> +
> +    case XENPF_firmware_info:
> +        return domain_has_xen(current->domain, XEN__FIRMWARE);
> +
> +    case XENPF_efi_runtime_call:
> +        return domain_has_xen(current->domain, XEN__FIRMWARE);
> +
> +    case XENPF_enter_acpi_sleep:
> +        return domain_has_xen(current->domain, XEN__SLEEP);
> +
> +    case XENPF_change_freq:
> +        return domain_has_xen(current->domain, XEN__FREQUENCY);
> +
> +    case XENPF_getidletime:
> +        return domain_has_xen(current->domain, XEN__GETIDLE);
> +
> +    case XENPF_set_processor_pminfo:
> +    case XENPF_core_parking:
> +        return domain_has_xen(current->domain, XEN__PM_OP);
> +
> +    case XENPF_get_cpu_version:
> +    case XENPF_get_cpuinfo:
> +        return domain_has_xen(current->domain, XEN__GETCPUINFO);
> +
> +    case XENPF_resource_op:
> +        return avc_current_has_perm(SECINITSID_XEN, SECCLASS_XEN2,
> +                                    XEN2__RESOURCE_OP, NULL);
> +
> +    case XENPF_get_symbol:
> +        return avc_has_perm(domain_sid(current->domain), SECINITSID_XEN,
> +                            SECCLASS_XEN2, XEN2__GET_SYMBOL, NULL);
> +
> +    default:
> +        printk("flask_platform_op: Unknown op %d\n", op);
> +        return -EPERM;
> +    }
> +}
> +
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-11-16 13:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 17:45 [PATCH v4 0/3] wallclock time on arm Stefano Stabellini
2015-11-12 17:46 ` [PATCH v4 1/3] xen: move wallclock functions from x86 to common Stefano Stabellini
2015-11-16 13:04   ` Ian Campbell
2015-11-12 17:46 ` [PATCH v4 2/3] arm: export platform_op XENPF_settime64 Stefano Stabellini
2015-11-12 18:49   ` Daniel De Graaf
2015-11-13 11:59   ` Julien Grall
2015-11-16 13:08   ` Ian Campbell [this message]
2015-11-24 17:00     ` Daniel De Graaf
2015-11-25 10:36       ` Ian Campbell
2015-11-12 17:46 ` [PATCH v4 3/3] xen/arm: move ticks conversions function declarations to the header file Stefano Stabellini
2015-11-13 12:00   ` Julien Grall
2015-11-16 13:08   ` Ian Campbell
2015-11-16 13:09 ` [PATCH v4 0/3] wallclock time on arm Ian Campbell
2015-11-20 11:41   ` Stefano Stabellini
2015-11-25 11:49 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1447679291.27871.81.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.