xen/arm: smmuv3: Mark more init-only functions with __init
cover xen/arm: smmuv3: Mark more init-only functions with __init
From: "Edgar E. Iglesias" <[email protected]>
I was scanning for code that we could potentially move from the .text section into .init.text and found a few candidates.
I'm not sure if this makes sense, perhaps we don't want to mark these functions for other reasons but my scripts found this chain of SMMUv3 init functions as only reachable by .inittext code. Perhaps it's a little late in the release cycle to consider this...
Best regards,
Edgar
Edgar E. Iglesias (1):
xen/arm: smmuv3: Mark more init-only functions with __init
xen/drivers/passthrough/arm/smmu-v3.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
Signature · 1 line
2.40.1
PATCH 1/1 xen/arm: smmuv3: Mark more init-only functions with __init
From: "Edgar E. Iglesias" <[email protected]>
Move more functions that are only called at init to the .init.text section.
--- xen/drivers/passthrough/arm/smmu-v3.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
xen/drivers/passthrough/arm/smmu-v3.c +9 -8
@@ -1545,7 +1545,7 @@ static int arm_smmu_dt_xlate(struct device *dev, }/* Probing and initialisation functions */ -static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu, +static int __init arm_smmu_init_one_queue(struct arm_smmu_device *smmu, struct arm_smmu_queue *q, void __iomem *page, unsigned long prod_off,
@@ -1588,7 +1588,7 @@ static int arm_smmu_init_one_queue(struct arm_smmu_device *smmu,return 0 ; } -static int arm_smmu_init_queues (struct arm_smmu_device *smmu) +static int __init arm_smmu_init_queues (struct arm_smmu_device *smmu) {int ret;
@@ -1724,7 +1724,7 @@ static int arm_smmu_init_strtab(struct arm_smmu_device *smmu)return 0 ; } -static int arm_smmu_init_structures (struct arm_smmu_device *smmu) +static int __init arm_smmu_init_structures (struct arm_smmu_device *smmu) {int ret;
@@ -1746,7 +1746,8 @@ static int arm_smmu_write_reg_sync(struct arm_smmu_device *smmu, u32 val, }/* GBPA is "special" */ -static int arm_smmu_update_gbpa (struct arm_smmu_device *smmu,u32 set,u32 clr) +static int __init arm_smmu_update_gbpa (struct arm_smmu_device *smmu, +u32 set,u32 clr) {int ret;u32 reg,__iomem *gbpa = smmu->base +ARM_SMMU_GBPA ;
@@ -1842,7 +1843,7 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)static inline void arm_smmu_setup_msis (struct arm_smmu_device *smmu) { }#endif /* CONFIG_MSI */ -static void arm_smmu_free_irqs (struct arm_smmu_device *smmu) +static void __init arm_smmu_free_irqs (struct arm_smmu_device *smmu) {int irq;
@@ -1926,7 +1927,7 @@ err_free_evtq_irq:return ret; } -static int arm_smmu_setup_irqs (struct arm_smmu_device *smmu) +static int __init arm_smmu_setup_irqs (struct arm_smmu_device *smmu) {int ret, irq;u32 irqen_flags =IRQ_CTRL_EVTQ_IRQEN |IRQ_CTRL_GERROR_IRQEN ;
@@ -1988,7 +1989,7 @@ static int arm_smmu_device_disable(struct arm_smmu_device *smmu)return ret; } -static int arm_smmu_device_reset (struct arm_smmu_device *smmu) +static int __init arm_smmu_device_reset (struct arm_smmu_device *smmu) {int ret;u32 reg, enables;
@@ -2405,7 +2406,7 @@ static void arm_smmu_free_structures(struct arm_smmu_device *smmu)xfree (smmu->strtab_cfg.l1_desc); } -static int arm_smmu_device_probe (struct platform_device *pdev) +static int __init arm_smmu_device_probe (struct platform_device *pdev) {int irq, ret;paddr_t ioaddr, iosize;
Signature · 1 line
2.40.1
Hi Edgar,
Quoted 6 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Move more functions that are only called at init to the .init.text section.
Signed-off-by Edgar E. Iglesias <[email protected]>
This also needs a reviewed-by from either Bertrand or Rahul.
Cheers,
Signature · 1 line
Julien Grall
Hi Edgar,
Quoted 8 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
Move more functions that are only called at init to the .init.text section.
Signed-off-by Edgar E. Iglesias <[email protected]>
Regards,
Rahul
Quoted 10 lines · Rahul Singh
Hi Edgar,
Quoted 1 line
On 22 May 2024, at 2:28 PM, Edgar E. Iglesias <[email protected]>
Quoted 6 lines · wrote:
From: "Edgar E. Iglesias" <[email protected]>
Move more functions that are only called at init to the .init.text section.
Quoted 8 lines
Quoted 1 line
Signed-off-by Edgar E. Iglesias <[email protected]>Acked-by Rahul Singh <[email protected]>Tested-by Rahul Singh <[email protected]>Regards,
Rahul
Ping!
This still rebases cleanly on top of master but let me know if I should resend.
Best regards,
Edgar
Hi Edgar,
Quoted 18 lines · Edgar E. Iglesias
On Wed, Jun 5, 2024 at 11:55 AM Rahul Singh <[email protected] <mailto:[email protected]>> wrote:
Hi Edgar,
> On 22 May 2024, at 2:28 PM, Edgar E. Iglesias
<[email protected] <mailto:[email protected]>> wrote:
>
> From: "Edgar E. Iglesias" <[email protected]
<mailto:[email protected]>>
>
> Move more functions that are only called at init to
> the .init.text section.
>
> Signed-off-by: Edgar E. Iglesias <[email protected]
<mailto:[email protected]>>Acked-by Rahul Singh <[email protected] <mailto:[email protected]>>Tested-by Rahul Singh <[email protected]
Quoted 7 lines
<mailto:[email protected]>>
Regards,
RahulPing!
Thanks for the ping and sorry this fell through the cracks.
Quoted 2 lines
This still rebases cleanly on top of master but let me know if I should resend.
This is now committed.
Cheers,
Signature · 1 line
Julien Grall
Hi Edgar,
Quoted 9 lines · Edgar E. Iglesias
From: "Edgar E. Iglesias" <[email protected]>
I was scanning for code that we could potentially move from the .text section into .init.text and found a few candidates.
I'm not sure if this makes sense, perhaps we don't want to mark these functions for other reasons but my scripts found this chain of SMMUv3 init functions as only reachable by .inittext code. Perhaps it's a little late in the release cycle to consider this...
The risk of the change is limited and the SMMUv3 driver is still in tech preview. So I would say it would be fine as long as it is fully reviewed by the code freeze date (14th June).
CCing the release manager (Oleksii) to check if he is happy with committing this patch in 4.19. If not, I can queue it in a personal branch until the tree is re-opened.
But note this still need a review frome either Bertrand or Rahul.
Cheers,
Signature · 1 line
Julien Grall