From patchwork Tue Mar 14 09:23:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 738595 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vj8bb29Xvz9s0g for ; Tue, 14 Mar 2017 20:30:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FrRIbK6Q"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vj8bb0wWwzDqfF for ; Tue, 14 Mar 2017 20:30:19 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FrRIbK6Q"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vj8Sc02dzzDqZ0 for ; Tue, 14 Mar 2017 20:24:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FrRIbK6Q"; dkim-atps=neutral Received: by mail-pg0-x243.google.com with SMTP id g2so18769079pge.2 for ; Tue, 14 Mar 2017 02:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=01a5hJKl8A0dcu0IRulgZbuwsEURtLbJBWyI+ur05GA=; b=FrRIbK6QBBg+o+tX2QKpz/9msgkTuRNwS1TELce+kgcZo+hhnMShj7kQUiowFQu6xo u1dsECTRlcdxli4626vgn7OgyTh6Aw3xMTcqOVZVUjiNi0IesPcYTVIsEe11iGABcsNK ttAFN77TqtiPHzb5+Wn5Bl5fgb5JEViE8V7EE/RTZBe48kGJd8thVVKj3GYB9PMDeO3F lsljcjVnvBweX1sgpePJxlqv0TPOtpsqYOCFjuRNex9NrHnoJ2zYgYXwDCI4UrgJsd4d G40K8AKmz5TJ5veqVYTnTs8oukws24V4BufGlI/tgJmws9MbrwPBy3W6rJ5iwYOE/hsd Jugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=01a5hJKl8A0dcu0IRulgZbuwsEURtLbJBWyI+ur05GA=; b=sQsE4rXC2R5ICBuJJSwTUjgnwonZ9ri76jtDZHJmenmyMfmEHhsEMV717XYEkfHt+8 piAulf7aCmm2KtIyHSNIybrzrPdispbwmJ1w4o2b31veGkIatqZZcoBKFusEKPkWnLoH Y9NxWdEo4poxFbdEBhjSR2OJqk36gJTAjSU/nSRMPDbOxztbjlGq1khHAk1dRHFqyvms QbznGcRnhNJmEUSDPSF0CyT5p9YieOJIWXNrEDPNT24rZID03+aQ+jAwybc8ll9lvf9t Xwp/4f5oe36Wo+EjSqEoNNgmmCn0zaoTJXqlQSYRfz+WVM8DcZZ1utSpQUg2UE/U08sh E5Fg== X-Gm-Message-State: AMke39l3RdYssoLZIyVQOO9HjGnEHJsJJSBlWHQqjl8eh8fqX/NegUvmYJbypFFzqTvcEA== X-Received: by 10.98.7.86 with SMTP id b83mr42881602pfd.66.1489483454393; Tue, 14 Mar 2017 02:24:14 -0700 (PDT) Received: from roar.au.ibm.com ([203.221.48.234]) by smtp.gmail.com with ESMTPSA id s21sm37262882pfs.87.2017.03.14.02.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 02:24:12 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 3/8] powerpc/64s: use alternative feature patching Date: Tue, 14 Mar 2017 19:23:44 +1000 Message-Id: <20170314092349.10981-4-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170314092349.10981-1-npiggin@gmail.com> References: <20170314092349.10981-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gautham R Shenoy , Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This reduces the number of nops for POWER8. Signed-off-by: Nicholas Piggin Reviewed-by: Gautham R. Shenoy --- arch/powerpc/kernel/idle_book3s.S | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S index 405631b2c229..9284ea0762b1 100644 --- a/arch/powerpc/kernel/idle_book3s.S +++ b/arch/powerpc/kernel/idle_book3s.S @@ -383,7 +383,11 @@ _GLOBAL(power9_idle_stop) */ .global pnv_powersave_wakeup pnv_powersave_wakeup: - bl pnv_restore_hyp_resource +BEGIN_FTR_SECTION + bl pnv_restore_hyp_resource_arch300 +FTR_SECTION_ELSE + bl pnv_restore_hyp_resource_arch207 +ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_300) li r0,PNV_THREAD_RUNNING stb r0,PACA_THREAD_IDLE_STATE(r13) /* Clear thread state */ @@ -411,14 +415,13 @@ pnv_powersave_wakeup: * * cr3 - set to gt if waking up with partial/complete hypervisor state loss */ -pnv_restore_hyp_resource: - ld r2,PACATOC(r13); - -BEGIN_FTR_SECTION +pnv_restore_hyp_resource_arch300: /* * POWER ISA 3. Use PSSCR to determine if we * are waking up from deep idle state */ + ld r2,PACATOC(r13); + LOAD_REG_ADDRBASE(r5,pnv_first_deep_stop_state) ld r4,ADDROFF(pnv_first_deep_stop_state)(r5) @@ -433,12 +436,14 @@ BEGIN_FTR_SECTION blr /* Waking up without hypervisor state loss. */ -END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) - +/* Same calling convention as arch300 */ +pnv_restore_hyp_resource_arch207: /* * POWER ISA 2.07 or less. * Check if we slept with winkle. */ + ld r2,PACATOC(r13); + lbz r0,PACA_THREAD_IDLE_STATE(r13) cmpwi cr2,r0,PNV_THREAD_NAP cmpwi cr4,r0,PNV_THREAD_WINKLE