From nobody Thu Sep 19 01:58:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1718002458; cv=none; d=zohomail.com; s=zohoarc; b=AiBsOIozJAv/2UfTjDwmee0zUiZClxnOuCOrWdjzHNc/lIAzaa+DfVsDzcvsUVBGknxeyjfpN139ODWHBQBQO9AKCzBQSxE59rH2GE3KXGe44qq4vn5NYZOmbRCIQiiPMPByOKM36Sf4vLo+zblhn4ubJUL/Wcd00grWPrRVfCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718002458; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v0XZWV38zo7fRMFW2k6millPwbwyTFNlIqQWXfkZcoE=; b=mvqvHffNkI06goiUW9kYW0WOiWA9DzLUcqtlgYJEfZKRtTlgu+m5C3dfkr1pJPkTCWP9Zgy4Mw+EdcB2LutiVI0SrGIBjXPDkOtCVvPCHRj3nxZtusChVSR/DZSKtZrS+PLV4zZRSDlOTHQIBw/bYK7dr/5Rg16P7lEhipoWGXE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1718002458227649.499910519444; Sun, 9 Jun 2024 23:54:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.736904.1142998 (Exim 4.92) (envelope-from ) id 1sGYul-000344-8S; Mon, 10 Jun 2024 06:53:59 +0000 Received: by outflank-mailman (output) from mailman id 736904.1142998; Mon, 10 Jun 2024 06:53:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sGYul-00033v-5e; Mon, 10 Jun 2024 06:53:59 +0000 Received: by outflank-mailman (input) for mailman id 736904; Mon, 10 Jun 2024 06:53:57 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sGYuj-0001oX-J5 for xen-devel@lists.xenproject.org; Mon, 10 Jun 2024 06:53:57 +0000 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [2a00:1450:4864:20::62c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 34a79980-26f6-11ef-b4bb-af5377834399; Mon, 10 Jun 2024 08:53:56 +0200 (CEST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a62ef52e837so528756866b.3 for ; Sun, 09 Jun 2024 23:53:56 -0700 (PDT) Received: from rayden.urgonet (h-217-31-164-171.A175.priv.bahnhof.se. [217.31.164.171]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f1e6795b9sm107981966b.174.2024.06.09.23.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 23:53:54 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 34a79980-26f6-11ef-b4bb-af5377834399 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718002435; x=1718607235; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v0XZWV38zo7fRMFW2k6millPwbwyTFNlIqQWXfkZcoE=; b=wm3NVcf0cwmsKRDHMpzk0pUjs8pRNsKotohsW5zAUtAxPqcjiweXaPjV15z2nk83Dn 1qe7DYXdaGjoyVZW+UzaKiufbfdrDI5LNPOHPsXhb1k8qDHBisLhPMHi0No75/eizajk Fq4Nz1G6LT+UXrGT1Jf5NOk6jtu0tun/5PObGi/fUJE8eGrOfEYocrSrj7dIUD4zvuGX RTlQW/pyQossoInGJS4gvs71Bhc4XmWN1kBru3mBbGTb5FYtqtsncnIDBgrIC3hwPWNe u7aADhnSGB6vWvFmaHFSZgy+tRPffv2PaLfk0DSp+Z+IqDo8lF3gN2Jma00mEBRmZZBr jnCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718002435; x=1718607235; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v0XZWV38zo7fRMFW2k6millPwbwyTFNlIqQWXfkZcoE=; b=NCfN7gDrafE5mYqYlrA+BE7VSyzLsQyVBuWHz0ICbsDsPNBkOMi+Ah1PJA5skvfKVs k0uDNyFCX3FtMOln7FNy+rV6kJ4h1ZU4ZNrJcspLF2+kBofxVU4jemyHbVqWwC/rzwli fcT6gNw+DfZHxZ7D/Abln4/pZB1kO65b/griFFv35XyGGbMW/L9eGtPrs4BA/yocSvFv je2USAZHaHnuxlOu1O40sHZnsfpiFheK39/Mb6HOUA0MS8ZWIg5hiaDMK/7YecDEx6L2 IZvbKRNsh+SgNHKMf0OMaaSSE98+NgOcc0qir/5XcDYBAu2xo5PcXR7bcj+RiSqJBa4y D0Jw== X-Gm-Message-State: AOJu0YykQRm73cX6ALs4b44yrUbgH9utKduQ6bftTZGoTIRcbixWS6eX HIuUFqHU8PTPNM2wIodF/90+tCVNjQ98XFF0wBVr0SpYABCScGlqo7/4MEyJAdQ3KEM2HCYXuH3 I744= X-Google-Smtp-Source: AGHT+IFrqovL90KjjtIWH7ELqoOBQ3DlSigv3se5/sV3vqUZIu9PEL+pc5diOLHr+PJK6s+8Xzun2Q== X-Received: by 2002:a17:906:29d5:b0:a6f:1b40:82ab with SMTP id a640c23a62f3a-a6f1b408397mr163610266b.76.1718002434843; Sun, 09 Jun 2024 23:53:54 -0700 (PDT) From: Jens Wiklander To: xen-devel@lists.xenproject.org Cc: patches@linaro.org, Jens Wiklander , Volodymyr Babchuk , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel Subject: [XEN PATCH v6 5/7] xen/arm: add and call init_tee_secondary() Date: Mon, 10 Jun 2024 08:53:41 +0200 Message-Id: <20240610065343.2594943-6-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610065343.2594943-1-jens.wiklander@linaro.org> References: <20240610065343.2594943-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1718002460133100010 Content-Type: text/plain; charset="utf-8" Add init_tee_secondary() to the TEE mediator framework and call it from start_secondary() late enough that per-cpu interrupts can be configured on CPUs as they are initialized. This is needed in later patches. Signed-off-by: Jens Wiklander Reviewed-by: Bertrand Marquis --- v5->v6: - Rename init_tee_interrupt() to init_tee_secondary() as requested --- xen/arch/arm/include/asm/tee/tee.h | 8 ++++++++ xen/arch/arm/smpboot.c | 2 ++ xen/arch/arm/tee/tee.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/asm/= tee/tee.h index da324467e130..6bc13da885b6 100644 --- a/xen/arch/arm/include/asm/tee/tee.h +++ b/xen/arch/arm/include/asm/tee/tee.h @@ -28,6 +28,9 @@ struct tee_mediator_ops { */ bool (*probe)(void); =20 + /* Initialize secondary CPUs */ + void (*init_secondary)(void); + /* * Called during domain construction if toolstack requests to enable * TEE support so mediator can inform TEE about new @@ -66,6 +69,7 @@ int tee_domain_init(struct domain *d, uint16_t tee_type); int tee_domain_teardown(struct domain *d); int tee_relinquish_resources(struct domain *d); uint16_t tee_get_type(void); +void init_tee_secondary(void); =20 #define REGISTER_TEE_MEDIATOR(_name, _namestr, _type, _ops) \ static const struct tee_mediator_desc __tee_desc_##_name __used \ @@ -105,6 +109,10 @@ static inline uint16_t tee_get_type(void) return XEN_DOMCTL_CONFIG_TEE_NONE; } =20 +static inline void init_tee_secondary(void) +{ +} + #endif /* CONFIG_TEE */ =20 #endif /* __ARCH_ARM_TEE_TEE_H__ */ diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index 93a10d7721b4..04e363088d60 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -29,6 +29,7 @@ #include #include #include +#include =20 /* Override macros from asm/page.h to make them work with mfn_t */ #undef virt_to_mfn @@ -401,6 +402,7 @@ void asmlinkage start_secondary(void) */ init_maintenance_interrupt(); init_timer_interrupt(); + init_tee_secondary(); =20 local_abort_enable(); =20 diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c index ddd17506a9ff..9fd1d7495b2e 100644 --- a/xen/arch/arm/tee/tee.c +++ b/xen/arch/arm/tee/tee.c @@ -96,6 +96,12 @@ static int __init tee_init(void) =20 __initcall(tee_init); =20 +void __init init_tee_secondary(void) +{ + if ( cur_mediator && cur_mediator->ops->init_secondary ) + cur_mediator->ops->init_secondary(); +} + /* * Local variables: * mode: C --=20 2.34.1