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

Re: [Xen-devel] [PATCH v2 4/4] vsmc: psci: remove 64 bit mode check





On 07/02/2017 08:34 PM, Julien Grall wrote:
Hi Volodymyr

On 06/22/2017 05:25 PM, Volodymyr Babchuk wrote:
PSCI handling code had helper routine that checked calling convention.
It does not needed anymore, because:

  - Generic handler checks that 64 bit calls can be made only by
    64 bit guests.

  - SMCCC requires that 64-bit handler should support both 32 and 64 bit
    calls even if they originate from 64 bit caller.

This patch removes that extra check.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>
---
  xen/arch/arm/vsmc.c | 13 +------------
  1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c
index 5f10fd1..1983e0e 100644
--- a/xen/arch/arm/vsmc.c
+++ b/xen/arch/arm/vsmc.c
@@ -98,12 +98,6 @@ static bool handle_arch(struct cpu_user_regs *regs)
      return false;
  }
-/* helper function for checking arm mode 32/64 bit */
-static inline int psci_mode_check(struct domain *d, register_t fid)
-{
-        return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) );
-}
-
  /* PSCI 2.0 interface */
  static bool handle_ssc(struct cpu_user_regs *regs)
  {
@@ -125,8 +119,7 @@ static bool handle_ssc(struct cpu_user_regs *regs)
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_UP_CPU):
          perfc_incr(vpsci_migrate_info_up_cpu);
-        if ( psci_mode_check(current->domain, fid) )
-            set_user_reg(regs, 0, do_psci_0_2_migrate_info_up_cpu());
+        set_user_reg(regs, 0, do_psci_0_2_migrate_info_up_cpu());
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_OFF):
          perfc_incr(vpsci_system_off);
@@ -140,7 +133,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_ON):
          perfc_incr(vpsci_cpu_on);
-        if ( psci_mode_check(current->domain, fid) )

Please re-indent/re-organize the code correctly rather than just dropping. We want to keep the code nice even if it requires more changes.

*dropping the if.

          {
              register_t vcpuid = get_user_reg(regs, 1);
              register_t epoint = get_user_reg(regs, 2);
@@ -151,7 +143,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_SUSPEND):
          perfc_incr(vpsci_cpu_suspend);
-        if ( psci_mode_check(current->domain, fid) )

Ditto

          {
              uint32_t pstate = get_user_reg(regs, 1);
              register_t epoint = get_user_reg(regs, 2);
@@ -162,7 +153,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_AFFINITY_INFO):
          perfc_incr(vpsci_cpu_affinity_info);
-        if ( psci_mode_check(current->domain, fid) )

Ditto

          {
              register_t taff = get_user_reg(regs, 1);
              uint32_t laff = get_user_reg(regs,2);
@@ -172,7 +162,6 @@ static bool handle_ssc(struct cpu_user_regs *regs)
          return true;
      case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE):
          perfc_incr(vpsci_cpu_migrate);
-        if ( psci_mode_check(current->domain, fid) )

Ditto

          {
              uint32_t tcpu = get_user_reg(regs, 1);
              set_user_reg(regs, 0, do_psci_0_2_migrate(tcpu));



--
Julien Grall

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

 


Rackspace

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