From patchwork Mon Aug 2 21:54:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12414881 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,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 BCCEEC4338F for ; Mon, 2 Aug 2021 22:04:31 +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 79C8C60E09 for ; Mon, 2 Aug 2021 22:04:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 79C8C60E09 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wSgLh/mr5FY8ErPQLk+DIyLxa2DVArFS2KmdwCFLvyE=; b=w0Y8IakgUUtXde 5kspQVnLomfE2B+S+Vwmmusr4+UDo6jeWD9l6T0bOX09Yv51dhG14FXSap8l8nu1bChnCDQdkeWwA afHVhb2TeMcIaIU7USVhJxSIQLsOVhq0F1OP02XXyTrVDey/6wyH3X2PCe2az4IdEDrXUNPPhSnKA cKrcHNqLwrOHEXRd+zFyl7v7uDMyEogsLCPOaL4T3A2npny0zL6+0c2zwjBbI98r1o4w3+wlqzh1s 4ptsOjWsMZry6LXT1Du9jjGpL37K5Gfq5VEMG5U4IvrtefQA8WrM6NyDV1srQSSJwIPpazuIdHsja w0Cr+lU2QaxiVwEiLNQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAg0v-000NZD-Dj; Mon, 02 Aug 2021 22:02:27 +0000 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAftF-000Jur-Qj for linux-arm-kernel@lists.infradead.org; Mon, 02 Aug 2021 21:54:31 +0000 Received: by mail-qv1-xf2b.google.com with SMTP id f91so9638129qva.9 for ; Mon, 02 Aug 2021 14:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=r+CYCZCiU1cMcD+VmU9RhDaYUtg7Su3wxwCheymC23U=; b=jctFebjkj3S+TT2x0nauprSV2wyj0PwRV40R5o4/TRvvfjkGSMl96RZP+Aqp2IFQ5m IR9X6dgSW4nno0xAh35XttKT4va3Hvq6tlueaS40BE+3FKdhcycgnE6xBVMQT7TAZqUE 71O9mr3Wl8Mt6kce6WpT8dOMeSrUaOYwFzLXe3sdZHUGXr6ohZfCVt6qsTEC9SNDWKkm R4+sJuqlCeOZZi5H9J3GsMLXN4keopqd+c5IcdI6xf4XJNoEwSiPEuX0wV5kIrPmvVHC 01mW7aNFawtNFDhbUR4mjsfOOn0j1N9LKv2W8Lkg0DREVeqoFcXJ+gaiBNsjZ5hVnO2K kaHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=r+CYCZCiU1cMcD+VmU9RhDaYUtg7Su3wxwCheymC23U=; b=jR6Zp/Vm4N9WZvbznbh6Ib4z/I65Om6LdOxgdvspBylI7Ag9aZQgdUMLiTYn8pRsoq vYgqLaKvpHWa5DiBMub8e8cC1wPc8qYBwYOp/DAx7e/niakSdUL6ghkgRChYDoC5Rojn 3ARIeWeWc09iEKU+gSWmucbgmEhzCz2/XwtZXsPvIOx9dswFDMoVAaH2BLXfrAbZfxWy WsHm9sYptq65kbOhV61bb1iiyN+RxwD04ODC7nl7+HAb9HAuWU8pD5vTF9JBMF8NVTnX lz8MlfUrNtP0kGL1XqhBLGg6EyeIaEfGs8J26AgG4wnFP41tFzJXrPgBoFgxCXogvBHt 2Bvw== X-Gm-Message-State: AOAM532uJYopCBqwsTdJ7Im6lQw4JMnDhB1zC3Cq8+wuCwd80vgMJb5a wi7zGW+ChQ3r2xKKpsdv+R/uGA== X-Google-Smtp-Source: ABdhPJyd/VxX84pagYf1ZcTV+T5GT+qS17GuV4XbvkFGYFpX9dQIB5Z9oz1yWxX+Lk4ixOmma8alIw== X-Received: by 2002:a0c:c2d3:: with SMTP id c19mr18681667qvi.62.1627941268973; Mon, 02 Aug 2021 14:54:28 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id v11sm5479216qtc.0.2021.08.02.14.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:54:28 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, maz@kernel.org, james.morse@arm.com, vladimir.murzin@arm.com, matthias.bgg@gmail.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com, tyhicks@linux.microsoft.com, kernelfans@gmail.com, akpm@linux-foundation.org, madvenka@linux.microsoft.com Subject: [PATCH v16 13/15] arm64: kexec: remove the pre-kexec PoC maintenance Date: Mon, 2 Aug 2021 17:54:06 -0400 Message-Id: <20210802215408.804942-14-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210802215408.804942-1-pasha.tatashin@soleen.com> References: <20210802215408.804942-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_145429_968833_04766D4D X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that kexec does its relocations with the MMU enabled, we no longer need to clean the relocation data to the PoC. Suggested-by: James Morse Signed-off-by: Pavel Tatashin --- arch/arm64/kernel/machine_kexec.c | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index b43195a7fcb6..b1856f34cc51 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -77,48 +77,6 @@ int machine_kexec_prepare(struct kimage *kimage) return 0; } -/** - * kexec_list_flush - Helper to flush the kimage list and source pages to PoC. - */ -static void kexec_list_flush(struct kimage *kimage) -{ - kimage_entry_t *entry; - - dcache_clean_inval_poc((unsigned long)kimage, - (unsigned long)kimage + sizeof(*kimage)); - - for (entry = &kimage->head; ; entry++) { - unsigned int flag; - unsigned long addr; - - /* flush the list entries. */ - dcache_clean_inval_poc((unsigned long)entry, - (unsigned long)entry + - sizeof(kimage_entry_t)); - - flag = *entry & IND_FLAGS; - if (flag == IND_DONE) - break; - - addr = (unsigned long)phys_to_virt(*entry & PAGE_MASK); - - switch (flag) { - case IND_INDIRECTION: - /* Set entry point just before the new list page. */ - entry = (kimage_entry_t *)addr - 1; - break; - case IND_SOURCE: - /* flush the source pages. */ - dcache_clean_inval_poc(addr, addr + PAGE_SIZE); - break; - case IND_DESTINATION: - break; - default: - BUG(); - } - } -} - /** * kexec_segment_flush - Helper to flush the kimage segments to PoC. */ @@ -207,7 +165,6 @@ int machine_kexec_post_load(struct kimage *kimage) (unsigned long)reloc_code + reloc_size); icache_inval_pou((uintptr_t)reloc_code, (uintptr_t)reloc_code + reloc_size); - kexec_list_flush(kimage); kexec_image_info(kimage); return 0;