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

Re: [PATCH v3 10/10] arm64: Change type of hsr, cpsr, spsr_el1 to uint64_t


  • To: Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 12 May 2021 19:14:54 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=amc0m8q2dyYx5RpIF9dBjoPSkDmKLQmozHAEGQbqqiI=; b=oWMJuYVBHanFFpJ9xAe2UNt00Hpg6VWPZxnuxO8Mp6edYS+cXfqaByAQk4v9t2JGekhmGygSDnpLAUKIxS6HXMDlOJhTPuzC9KmEyw0jG4+5xQYRHKAYkmpyuRr88wPq7snxGsVYh0t2qoFMPXzuxo3lAm7jKNIzBVq4wCa5wA14NzS0fuY6ahUAhfZWT5xxW/faibRXzLoPKagMNb6cAspwgoo1Gdbmj0zK2LVyUSmN75nqP05HLME4I5SFo6SPsdHKoh0C9jQGVXzNqKtMFKBVcYeiWC2y9rWcFSl6wJrr5XXpuIMiihinLxIj4kqTotA3IbXkQVziVODGl4vDMQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=clv4At08S1nQo9WRiSA98ub0RLEvyiMSVRDvAKJl5r2/jMSc3H+ykJg/hUl+X74In5bKct1rOWAkvduJSBHFbD1P4G/Js2dLcd6hUaei2jyljLcFZHzRiX+aW4YrophNtxdf77hUEsA3kV/kFUXVcdmcwIH0nvjpq4UKLTElm2jlu/77c5bgQfFD6Xn26KL7sbUBM6bU/tzLtx7UXzIcdcS6lygUFoSKOlKaYhGEjOKE01P+Z1E/Er3p4QMsDn1NYRGCQ+GU7Dd+kEIjgTN/aCUr/CpCf8bFboAOJebGIKml0xmaxy5n39i/Ng5VhJlivWcJ10hwKeqV7IK/PBC6hA==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, "Petre Pircalabu" <ppircalabu@xxxxxxxxxxxxxxx>, <bertrand.marquis@xxxxxxx>, <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 12 May 2021 18:15:18 +0000
  • Ironport-hdrordr: A9a23:OyGE3KPbx5qsZsBcTgWjsMiBIKoaSvp037BK7S1MoH1uA6mlfq WV9sjzuiWatN98Yh8dcLO7Scu9qBHnlaKdiLN5VduftWHd01dAR7sSjrcKrQeAJ8X/nNQtr5 uJccJFeaDN5Y4Rt7eH3OG6eexQv+Vu6MqT9IPjJ+8Gd3ATV0lnhT0JbTqzIwlNayRtI4E2L5 aY7tovnUvaRZxGBv7LYEXsRoL41qT2qK4=
  • Ironport-sdr: J7NEQ0U3qCLA/sDNthOJizJTLrUQgYDBuVl3kpT019BADEa850BdP6Xe3sl28twq0Ob9pNf5Yp jt5/N9hvk0mh/SAKwmVdE7LKwmlmo21wuX8bRLPX1U6iUTAUyYIIFT07VTJLMtBLLs6/ykLeFe bZia3wYeKMq/R5+Qf28/SEFe0Vw/Ko38+m3v/+iIrgzJzNtaIyW4eHS2Af21Y/LecaIstiTyq0 tO/Sh7l6swIt8Eb8MvZ2VXxojCo4PIrYpsDKsbXU4C/OjG8OqXDDLV/L+YpdvghMjwnD+wDzSt +eA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/05/2021 18:59, Julien Grall wrote:
> Hi,
>
> On 11/05/2021 07:37, Michal Orzel wrote:
>> On 05.05.2021 10:00, Jan Beulich wrote:
>>> On 05.05.2021 09:43, Michal Orzel wrote:
>>>> --- a/xen/include/public/arch-arm.h
>>>> +++ b/xen/include/public/arch-arm.h
>>>> @@ -267,10 +267,10 @@ struct vcpu_guest_core_regs
>>>>         /* Return address and mode */
>>>>       __DECL_REG(pc64,         pc32);             /* ELR_EL2 */
>>>> -    uint32_t cpsr;                              /* SPSR_EL2 */
>>>> +    uint64_t cpsr;                              /* SPSR_EL2 */
>>>>         union {
>>>> -        uint32_t spsr_el1;       /* AArch64 */
>>>> +        uint64_t spsr_el1;       /* AArch64 */
>>>>           uint32_t spsr_svc;       /* AArch32 */
>>>>       };
>>>
>>> This change affects, besides domctl, also default_initialise_vcpu(),
>>> which Arm's arch_initialise_vcpu() calls. I realize do_arm_vcpu_op()
>>> only allows two unrelated VCPUOP_* to pass, but then I don't
>>> understand why arch_initialise_vcpu() doesn't simply return e.g.
>>> -EOPNOTSUPP. Hence I suspect I'm missing something.
>
> I think it is just an overlooked when reviewing the following commit:
>
> commit 192df6f9122ddebc21d0a632c10da3453aeee1c2
> Author: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Date:   Tue Dec 15 14:12:32 2015 +0100
>
>     x86: allow HVM guests to use hypercalls to bring up vCPUs
>
>     Allow the usage of the VCPUOP_initialise, VCPUOP_up, VCPUOP_down,
>     VCPUOP_is_up, VCPUOP_get_physid and VCPUOP_send_nmi hypercalls
> from HVM
>     guests.
>
>     This patch introduces a new structure (vcpu_hvm_context) that
> should be used
>     in conjuction with the VCPUOP_initialise hypercall in order to
> initialize
>     vCPUs for HVM guests.
>
>     Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>     Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>     Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>     Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
>
> On Arm, the structure vcpu_guest_context is not exposed outside of Xen
> and the tools. Interestingly vcpu_guest_core_regs is but it should
> only be used within vcpu_guest_context.
>
> So as this is not used by stable ABI, it is fine to break it.
>
>>>
>> I agree that do_arm_vcpu_op only allows two VCPUOP* to pass and
>> arch_initialise_vcpu being called in case of VCPUOP_initialise
>> has no sense as VCPUOP_initialise is not supported on arm.
>> It makes sense that it should return -EOPNOTSUPP.
>> However do_arm_vcpu_op will not accept VCPUOP_initialise and will return
>> -EINVAL. So arch_initialise_vcpu for arm will not be called.
>> Do you think that changing this behaviour so that
>> arch_initialise_vcpu returns
>> -EOPNOTSUPP should be part of this patch?
>
> I think this change is unrelated. So it should be handled in a
> follow-up patch.
>
> If you are taking care of this, would you mind to also look to move
> struct vcpu_guest_core_regs within the #if defined(__XEN__) ||
> defined(__XEN_TOOLS__)?

+1.  Fairly sure this is the conclusion of a discussion a year or so
back where I noted the same peculiarity, and tried to untangle the mess
which is the common vs arch specific code.  (which is still outstanding,
and I don't immediately recall why.)

~Andrew



 


Rackspace

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