[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190724162534.7390-13-julien.grall@arm.com>
Date: Wed, 24 Jul 2019 17:25:31 +0100
From: Julien Grall <julien.grall@....com>
To: linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.cs.columbia.edu
Cc: james.morse@....com, marc.zyngier@....com, julien.thierry@....com,
suzuki.poulose@....com, catalin.marinas@....com,
will.deacon@....com, Julien Grall <julien.grall@....com>
Subject: [PATCH v3 12/15] arm64/lib: Add an helper to free memory allocated by the ASID allocator
Some users of the ASID allocator (e.g VMID) may require to free any
resource if the initialization fail. So introduce a function allows to
free any memory allocated by the ASID allocator.
Signed-off-by: Julien Grall <julien.grall@....com>
---
Changes in v3:
- Patch added
---
arch/arm64/include/asm/lib_asid.h | 2 ++
arch/arm64/lib/asid.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/arch/arm64/include/asm/lib_asid.h b/arch/arm64/include/asm/lib_asid.h
index c18e9eca500e..ff78865a6823 100644
--- a/arch/arm64/include/asm/lib_asid.h
+++ b/arch/arm64/include/asm/lib_asid.h
@@ -74,4 +74,6 @@ int asid_allocator_init(struct asid_info *info,
u32 bits, unsigned int asid_per_ctxt,
void (*flush_cpu_ctxt_cb)(void));
+void asid_allocator_free(struct asid_info *info);
+
#endif
diff --git a/arch/arm64/lib/asid.c b/arch/arm64/lib/asid.c
index 0b3a99c4aed4..d23f0df656c1 100644
--- a/arch/arm64/lib/asid.c
+++ b/arch/arm64/lib/asid.c
@@ -183,3 +183,8 @@ int asid_allocator_init(struct asid_info *info,
return 0;
}
+
+void asid_allocator_free(struct asid_info *info)
+{
+ kfree(info->map);
+}
--
2.11.0
Powered by blists - more mailing lists