From patchwork Sun May 20 15:31:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 160267 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 51847B6FAB for ; Mon, 21 May 2012 01:31:44 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755722Ab2ETPbn (ORCPT ); Sun, 20 May 2012 11:31:43 -0400 Received: from smtp.snhosting.dk ([87.238.248.203]:58144 "EHLO smtp.domainteam.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752260Ab2ETPbm (ORCPT ); Sun, 20 May 2012 11:31:42 -0400 Received: from merkur.ravnborg.org (unknown [188.228.89.252]) by smtp.domainteam.dk (Postfix) with ESMTPA id 252F2F199A; Sun, 20 May 2012 17:31:41 +0200 (CEST) Date: Sun, 20 May 2012 17:31:40 +0200 From: Sam Ravnborg To: "David S. Miller" , sparclinux Subject: [PATCH 1/2] sparc32: fix cpuid_patch run-time patching Message-ID: <20120520153140.GA13857@merkur.ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From eecbbe31067e738d4342dee9709f14086cd4fbad Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 20 May 2012 17:24:20 +0200 Subject: [PATCH 1/2] sparc32: fix cpuid_patch run-time patching We hang forever when trying to do run-time patching of instructions identified by the cpuid_patch section Signed-off-by: Sam Ravnborg --- I tested this by replacing all sun4d code with sun4m code, and I then modified the sun4m code to be wrong. With no patching the kernel failed to boot. With patching the kernel was able to boot after this little fix. The bug was found when testing the flushi variant in the following patch - but the bug-fix warranted a dedicated patch. Sam arch/sparc/kernel/setup_32.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index 635df5c..d65b5a1 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -229,6 +229,8 @@ static void __init per_cpu_patch(void) *(unsigned int *) (addr + 0) = insns[0]; *(unsigned int *) (addr + 4) = insns[1]; *(unsigned int *) (addr + 8) = insns[2]; + + p++; } #ifdef CONFIG_SMP local_ops->cache_all();