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

Re: [RFC PATCH 1/8] xen/arm: enable SVE extension for Xen


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Fri, 13 Jan 2023 12:53:35 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EOCzE38qMEN6kl5i4vxqfCt4TmImBh08mDzsr8cyH/k=; b=YABHPW+Fjyvd/quSlqlmEzS0SmSJ7rk5awh9Q80ATidxlncanAWQ2KyYRGuzq1exmVOI8FbHsCNdaFBKxRC3I2guZcd8S2zPBEzCKKJwD/Ba5o6kHVAxPemD8bj6fh+HppFEt84RpPk7IDimGpXHw9aRnwz/uLUyc8IruYfCKrvZQtyuuP4/+ughQ3kuLXRKhpAiiuQgZb9R6vof9oHvdgSW58jwIMZn3mcpSh2n8qdglxUz/FP9O3aHOZacH3oC4ccpIYZQhm1Qr3BT4t+tHTKVnbquPynLpKkGZSf2RANG5VswgX47zV6vEThgl+HU6bBpvkpOImv7l+ZZ39catw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dFo7mQSuazCVK+idQCXgQ4qg+ddui+Zlp1IrO6yuajIwByI2L/vLFy97Mzw1suN8zLJxjVsb6AlSviuuTkwosXJrE3XXU5B9oAs0GW/E27dJj0ZjLRNU+6oNM4PKM6osR7GnfkksNFR25vcuLpOtFg46JIqxMuR0HynWIDG/qjIgdd1xX/JAtYPRmceLsfEJXwkkiSjqVBjNJrUmDIkLbgheJlP04jbEqLb+0fTMoGZcLty0Len08Qt0GC4qNJEm/EQSMNZ45R/B4gVW9bPHOxP47i10CeUY1588F2x7/P5rcIzq/H4erbE0gQi0/qyY5qxGinuOJCcN5L69eE864g==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 13 Jan 2023 12:54:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZJcp25sHFUmTjSUKVOX9zw5fwA66ZdWWAgAElHQCAAXLngIAAQw0A
  • Thread-topic: [RFC PATCH 1/8] xen/arm: enable SVE extension for Xen


> On 13 Jan 2023, at 08:53, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 12/01/2023 10:46, Luca Fancellu wrote:
>>> On 11 Jan 2023, at 17:16, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> Hi Luca,
>>> 
>>> As this is an RFC, I will be mostly making general comments.
>> Hi Julien,
>> Thank you.
>>> 
>>> On 11/01/2023 14:38, Luca Fancellu wrote:
>>>> diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
>>>> index 99577adb6c69..8ea3843ea8e8 100644
>>>> --- a/xen/arch/arm/domain.c
>>>> +++ b/xen/arch/arm/domain.c
>>>> @@ -181,6 +181,8 @@ static void ctxt_switch_to(struct vcpu *n)
>>>>      /* VGIC */
>>>>      gic_restore_state(n);
>>>>  +    WRITE_SYSREG(n->arch.cptr_el2, CPTR_EL2);
>>> 
>>> Shouldn't this need an isb() afterwards do ensure that any previously 
>>> trapped will be accessible?
>> Yes you are right, would it be ok for you if I move this before 
>> gic_restore_state because it inside
>> has an isb()? This to limit the isb() usage. I could put also a comment to 
>> don’t forget it.
> 
> I would rather prefer if we don't rely on gic_restore_state() to have an 
> isb() because this could change in the future (although unlikely).
> 
> Looking at the context switch code, I think we can move the call to restore 
> the floating register towards the end of the helper and use one of the 
> existing isb() for our purpose.

Sounds good to me

> 
> 
>>>> @@ -122,6 +137,7 @@ __initcall(update_serrors_cpu_caps);
>>>>    void init_traps(void)
>>>>  {
>>>> +    register_t cptr_bits = get_default_cptr_flags();
>>>>      /*
>>>>       * Setup Hyp vector base. Note they might get updated with the
>>>>       * branch predictor hardening.
>>>> @@ -135,17 +151,15 @@ void init_traps(void)
>>>>      /* Trap CP15 c15 used for implementation defined registers */
>>>>      WRITE_SYSREG(HSTR_T(15), HSTR_EL2);
>>>>  -    /* Trap all coprocessor registers (0-13) except cp10 and
>>>> -     * cp11 for VFP.
>>>> -     *
>>>> -     * /!\ All coprocessors except cp10 and cp11 cannot be used in Xen.
>>>> -     *
>>>> -     * On ARM64 the TCPx bits which we set here (0..9,12,13) are all
>>>> -     * RES1, i.e. they would trap whether we did this write or not.
>>>> +#ifdef CONFIG_ARM64_SVE
>>>> +    /*
>>>> +     * Don't trap SVE now, Xen might need to access ZCR reg in cpufeature 
>>>> code,
>>>> +     * trapping again or not will be handled on vcpu creation/scheduling 
>>>> later
>>>>       */
>>> 
>>> Instead of enable by default at boot, can we try to enable/disable only 
>>> when this is strictly needed?
>> Yes we could un-trap inside compute_max_zcr() just before accessing SVE 
>> resources and trap it
>> again when finished. Would it be ok for you this approach?
> 
> Yes.
> 
> Cheers,
> 
> -- 
> Julien Grall



 


Rackspace

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