From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8268CC7618B for ; Wed, 24 Jul 2019 16:28:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C50321871 for ; Wed, 24 Jul 2019 16:28:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kVykqlit" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C50321871 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=XbW6olZVSR/sF8lxF8ZYJH/JaUbcdMHBmW0LawUzcPI=; b=kVykqlitE+1GJMqRZ5KjsUEiXA /U1LT52B9c9TcXKKyGKz2YsxJRyFWhg3ugV+Gz56fZFp5ijthlBFKPn3vKrQ2Ow49NqDkRIw4O6eV zCjoi5bF0IOxUkUIaIOQ+MpGh/uGeJCgBDn/OHM61cm+kiXZvtTS+ABgX8HtQVrxPyOQ6zTqI0q97 rSLlSVS6em5/G0ZAcj/g+kXK/wCEi4oRDhvJoQUDrk/WMHuOqOFthqSfNC923kND7sJgPgUOcGHrf KMmBa4oodA6d+VtaLo7zIeLZcJpvCniCHHotuZWLkB/Jsaf6M54K3naRoMXuAaLj+mn3QEtU5QLPs AYxC7yLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqK8O-00038N-V8; Wed, 24 Jul 2019 16:28:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hqK5f-0000K2-9D for linux-arm-kernel@lists.infradead.org; Wed, 24 Jul 2019 16:26:09 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0329428; Wed, 24 Jul 2019 09:26:06 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A35343F71F; Wed, 24 Jul 2019 09:26:04 -0700 (PDT) From: Julien Grall To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH v3 12/15] arm64/lib: Add an helper to free memory allocated by the ASID allocator Date: Wed, 24 Jul 2019 17:25:31 +0100 Message-Id: <20190724162534.7390-13-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190724162534.7390-1-julien.grall@arm.com> References: <20190724162534.7390-1-julien.grall@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190724_092607_622211_3B6C9768 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: suzuki.poulose@arm.com, marc.zyngier@arm.com, catalin.marinas@arm.com, julien.thierry@arm.com, will.deacon@arm.com, Julien Grall , james.morse@arm.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel