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

Re: [PATCH v2] xen/arm: Set correct per-cpu cpu_core_mask


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Mon, 18 Mar 2024 13:53:57 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=Ibm2YtqLQ5URCqm23h2BHb2m1bmlA49TcqsiILZjzGI=; b=lsPfffCZhVkbYmrh0EJwuRvIhiyLnNQZcRr3CqqOnZb4dxlXwSDL1NWznjV0VjOXt6JYDbJC8AL8ndnYmgjQlA1G7IrM9yuCAgSFStY7xbmloy75bVnLZZJkZs6aObN/om7pdD5CLRQJfyqWAb6Z5saMkenBycUC2XpWWabWFdnNdz5A+GoNnceTEUJewuvUuQn/VBhkMcyguKtF4JUf9q2Yryu6mhFvsBUkP0aQF8AGSICx8s096ruCUNZgM5oxiSJwvRtcx0K+012zaB5aMvPhvMyjdY2Ijz5vvxJSpmeZwFnE498Ps2w1IQJFOuGOkrXCbjHI/7hI1Qe3JIT3gw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RggYjv+ObU2LeHT9s5h5cWyuKwt0gflImJ37QhfnIhqYNojWMEI+WCuHgPZOZAHznkukncKNTcer0SJEqtdwRWPTeOO9xofNEmGS/WlmwvFAXfAYRBHNIVsZc0oOJRRN6zlCcUJP3A3T2X2ZeOMTO1Ivm68ysxAhSywGI5uQUa0EOs7fj+p/FcvL7pZH8zj3V4Qb8kYm7/6IAEqHXW5wUmNgRq5/ZSHvxlqe7W/spZhJOxbrRhVqGmtoe2Oa84LYKJPqHj8OXiE3AoSpw/W5taxMvsHYiBGHPXYnXcwQYkH47WGmVjqAKkV8qjElRsupQMHjTv7/OIMdmyZSPb21pA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, <george.dunlap@xxxxxxxxx>
  • Delivery-date: Mon, 18 Mar 2024 05:54:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 3/15/2024 6:58 PM, Julien Grall wrote:
On 14/03/2024 14:22, Henry Wang wrote:
Hi Julien,
Hi,
  /* representing HT siblings of each logical CPU */
  DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_mask);
  /* representing HT and core siblings of each logical CPU */
@@ -89,6 +88,10 @@ static int setup_cpu_sibling_map(int cpu)
      cpumask_set_cpu(cpu, per_cpu(cpu_sibling_mask, cpu));
      cpumask_set_cpu(cpu, per_cpu(cpu_core_mask, cpu));
  +    /* Currently we assume there is no multithread. */

I am not very familiar with the scheduling in Xen. Do you know what's the consequence of not properly supporting MT? One thing I can think of is security (I know there were plenty of security issues with SMT).

Unfortunately me neither, so adding George to this thread as I think he can bring us some insights on this topic from the scheduler perspective.

+Juergen as he worked on co-scheduling.

Thanks.


Depending on the answer, I would consider to print a warning and maybe add it in SUPPORT.MD in a separate patch.

To be honest, as discussed in v1. I think I am quite tempted to add an ASSERT(system_cpuinfo.mpidr.mt == 0) to make sure we catch the multithread support stuff earlier.

ASSERT(...) is not the right solution. You may have user using a Xen shipped by distros where this would be a NOP.

We could try to hide MT completely from the scheduler. If that's too difficult, then we could add use warning_add() to throw a warning (see how we dealt with opt_hmp_unsafe).

Ok. Let's first see what George and Juergen will say, if MT cannot be hidden from scheduler for Arm, maybe we can add something like below:

if ( system_cpuinfo.mpidr.mt == 1 )
     warning_add("WARNING: MULTITHREADING HAS BEEN DETECTED ON THE PROCESSOR.\n"                               "It might impact the security and stability of the system.\n");

Kind regards,
Henry



 


Rackspace

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