All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Parth Dixit <parth.dixit@linaro.org>, xen-devel@lists.xen.org
Cc: tim@xen.org, ian.campbell@citrix.com,
	christoffer.dall@linaro.org, stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH v2] xen/arm : emulation of arm's PSCI v0.2 standard
Date: Thu, 26 Jun 2014 17:01:01 +0100	[thread overview]
Message-ID: <53AC43BD.3010506@linaro.org> (raw)
In-Reply-To: <1403760382-1863-1-git-send-email-parth.dixit@linaro.org>

Hi Parth,

Thank you for the patch.

On 06/26/2014 06:26 AM, Parth Dixit wrote:
> +void vcpu_block_event(struct vcpu *v)
> +{
> +    vcpu_block();
> +    /* The ARM spec declares that even if local irqs are masked in
> +    * the CPSR register, an irq should wake up a cpu from WFI anyway.
> +    * For this reason we need to check for irqs that need delivery,
> +    * ignoring the CPSR register, *after* calling SCHEDOP_block to
> +    * avoid races with vgic_vcpu_inject_irq.
> +    */

The comment is out of date here and you should move it on top of the
function.

Also, you've introduce this function but didn't replace the code in WFI
trap.

Furthermore, I would move this change in a separate patch. It will be
more clear.

> +    if ( local_events_need_delivery_nomask() )
> +        vcpu_unblock(current);
> +}
> +

[..]

> +int do_psci_0_2_cpu_off(void)
> +{
> +    uint32_t power_state = 0 ;

Coding style require a newline between the declarations.

Also, defining power_state looks pointless here.

> +    return do_psci_cpu_off(power_state);
> +}
> +
> +int do_psci_0_2_cpu_on(register_t target_cpu, register_t entry_point,
> +                       register_t context_id)


This function is 95% the same code. I would merge as much as possible
with do_psci_cpu_on to avoid code duplication.

[..]

> +
> +int do_psci_0_2_migrate(uint32_t target_cpu)
> +{
> +    return PSCI_ENOSYS;
> +}
> +
> +

Only one newline.

> +int do_psci_0_2_migrate_info_type(void)
> +{
> +    return PSCI_0_2_TOS_MP;
> +}
> +
> +

Same here.

> +register_t do_psci_0_2_migrate_info_up_cpu(void)
> +{
> +    return PSCI_ENOSYS;
> +}
> +
> +

Same here.

> +void do_psci_0_2_system_off( void )
> +{
> +    struct domain *d = current->domain;
> +    domain_shutdown(d,SHUTDOWN_poweroff);
> +}
> +
> +

Same here.

> +void do_psci_0_2_system_reset(void)
> +{
> +    struct domain *d = current->domain;
> +    domain_shutdown(d,SHUTDOWN_reboot);
> +}
> +

[..]

>  static inline int vcpu_event_delivery_is_enabled(struct vcpu *v)
>  {
> @@ -55,6 +56,7 @@ static inline int arch_virq_is_global(int virq)
>      return 1;
>  }
>  
> +

Spurious change.

> diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h
> index 189964b..3487380 100644
> --- a/xen/include/asm-arm/psci.h
> +++ b/xen/include/asm-arm/psci.h
> @@ -1,11 +1,6 @@
>  #ifndef __ASM_PSCI_H__
>  #define __ASM_PSCI_H__
>  
> -#define PSCI_SUCCESS  0
> -#define PSCI_ENOSYS  -1
> -#define PSCI_EINVAL  -2
> -#define PSCI_DENIED  -3
> -

Why did you just moved them at the end of the file and change the
indentation?

> +/* PSCI version */
> +#define XEN_PSCI_V_0_1 1

This doesn't seem to be used, right?

> +
> +/* PSCI v0.2 interface */
> +#define PSCI_0_2_FN_BASE			0x84000000
> +#define PSCI_0_2_FN(n)				(PSCI_0_2_FN_BASE + (n))
> +#define PSCI_0_2_64BIT				0x40000000

In general we don't use hard-tab in Xen coding style. Can you remove them?


[..]

> diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
> index 7496556..93803e4 100644
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -385,6 +385,7 @@ typedef uint64_t xen_callback_t;
>  #define PSCI_cpu_off     1
>  #define PSCI_cpu_on      2
>  #define PSCI_migrate     3
> +#define PSCI_0_1_MAX     4

Why do you expose PSCI_0_1_MAX?

-- 
Julien Grall

  reply	other threads:[~2014-06-26 16:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  5:26 [PATCH v2] xen/arm : emulation of arm's PSCI v0.2 standard Parth Dixit
2014-06-26 16:01 ` Julien Grall [this message]
2014-06-27  5:18   ` Parth Dixit
2014-06-27 10:54     ` Julien Grall
2014-06-27 11:17       ` Parth Dixit
2014-06-27 16:43 ` Ian Campbell
2014-06-30  5:06   ` Parth Dixit
2014-06-30 10:15     ` Ian Campbell
2014-06-30 11:06       ` Parth Dixit
2014-06-30 11:11         ` Ian Campbell
2014-07-01  8:41           ` Parth Dixit
2014-07-02  9:19             ` 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=53AC43BD.3010506@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=christoffer.dall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=parth.dixit@linaro.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /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.