From patchwork Wed Dec 21 18:29:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 707923 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 3tkNc44hkDz9sfH for ; Thu, 22 Dec 2016 05:34:44 +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="aEzH7RE6"; 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 3tkNc43gvnzDwcq for ; Thu, 22 Dec 2016 05:34:44 +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="aEzH7RE6"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (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 3tkNVY0Ty6zDwQb for ; Thu, 22 Dec 2016 05:29:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aEzH7RE6"; dkim-atps=neutral Received: by mail-pg0-x241.google.com with SMTP id g1so15362523pgn.0 for ; Wed, 21 Dec 2016 10:29:56 -0800 (PST) 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=joylswxFJ8h/hL0FMORjyXdSDntLVIBjFICbY62BcA4=; b=aEzH7RE6sTV7RMVR8627Rg+Gs+EuCQaTGgGt2DSQFFrVe6oYDVx6jDgo0yqHU3Sy5y JNES1gieCB5RDGasd2ns6y30YtGkh7j+zlxGb+hTiFjG8wWUENieuAkGTB7e4Ykj+lEE cmCQaYTRrSGjXQz0bA4z5cHCfnfGAkjardEuw4VBgIDUq2PufpF7XVHDKSLeovvimWb1 b7xBiR2EPLonYbphSVLtJu6Tay0A5vRmywhd7w0sKsgK5VGJxZ9U67fDwaY8P5bEcv0q +wl0Kg9uSMIkHdhDJRNRwmwoyUi0O9j+jmWAjSCQXdnvL1xArRMsMDTf8bk3zod2v/7Z ZQGg== 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=joylswxFJ8h/hL0FMORjyXdSDntLVIBjFICbY62BcA4=; b=EjnujFaR2DKp9TmS9ds7KRhOdFvpvQ71qHNVosxywk2/lIxNBWpm+NXpwkCqC9lRLw i0ehkPsnAcOo8sr1oEA7wrH/7JeRgHRoW2lY/92nfOkVh+D4qlprnuUlIDDIwiDXOa/O LQyCocn/qzIS/R5G24uJt5mAqBRQkuXXteqCJwH3vf8givPVSxRaceP3UDyO73ipGAdM oC3G+xvgawe+hQin+IkXy+imvmBRMrQczj9juMfWZD3uC+6EbgUESo3grgJz7EVV2Pxx H+PFUFYW4yRzExUXW92lu3fsVyUwsiYjPSPdQRxf21ffwtL/9FsWpi9q6sUFaMcA7/uQ Lq4g== X-Gm-Message-State: AIkVDXKacGZp6xzbtq5SmliwzEV11Anr+U4rJ0CRniub0OvrylbLAA83HyaCE90uaBjc0Q== X-Received: by 10.84.197.165 with SMTP id n34mr11467699pld.34.1482344994934; Wed, 21 Dec 2016 10:29:54 -0800 (PST) Received: from roar.au.ibm.com ([61.68.124.232]) by smtp.gmail.com with ESMTPSA id s17sm155660pgo.26.2016.12.21.10.29.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Dec 2016 10:29:54 -0800 (PST) From: Nicholas Piggin To: Paul Mackerras Subject: [PATCH 2/3] KVM: PPC: Book3S: Move 64-bit KVM interrupt handler out from alt section Date: Thu, 22 Dec 2016 04:29:26 +1000 Message-Id: <20161221182927.24562-3-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161221182927.24562-1-npiggin@gmail.com> References: <20161221182927.24562-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: kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Alexander Graf , Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" A subsequent patch to make KVM handlers relocation-safe makes them unusable from within alt section "else" cases (due to the way fixed addresses are taken from within fixed section head code). Stop open-coding the KVM handlers, and add them both as normal. A more optimal fix may be to allow some level of alternate feature patching in the exception macros themselves, but for now this will do. The TRAMP_KVM handlers must be moved to the "virt" fixed section area (name is arbitrary) in order to be closer to .text and avoid the dreaded "relocation truncated to fit" error. Signed-off-by: Nicholas Piggin Acked-by: Paul Mackerras --- arch/powerpc/include/asm/head-64.h | 2 +- arch/powerpc/kernel/exceptions-64s.S | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/head-64.h b/arch/powerpc/include/asm/head-64.h index fca7033839a9..9bd81619d090 100644 --- a/arch/powerpc/include/asm/head-64.h +++ b/arch/powerpc/include/asm/head-64.h @@ -218,7 +218,7 @@ end_##sname: #ifdef CONFIG_KVM_BOOK3S_64_HANDLER #define TRAMP_KVM_BEGIN(name) \ - TRAMP_REAL_BEGIN(name) + TRAMP_VIRT_BEGIN(name) #else #define TRAMP_KVM_BEGIN(name) #endif diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index d39d6118c6e9..89b4f122aec6 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -717,13 +717,9 @@ hardware_interrupt_hv: BEGIN_FTR_SECTION _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt_common, EXC_HV, SOFTEN_TEST_HV) -do_kvm_H0x500: - KVM_HANDLER(PACA_EXGEN, EXC_HV, 0x502) FTR_SECTION_ELSE _MASKABLE_EXCEPTION_PSERIES(0x500, hardware_interrupt_common, EXC_STD, SOFTEN_TEST_PR) -do_kvm_0x500: - KVM_HANDLER(PACA_EXGEN, EXC_STD, 0x500) ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE | CPU_FTR_ARCH_206) EXC_REAL_END(hardware_interrupt, 0x500, 0x600) @@ -737,6 +733,8 @@ hardware_interrupt_relon_hv: ALT_FTR_SECTION_END_IFSET(CPU_FTR_HVMODE) EXC_VIRT_END(hardware_interrupt, 0x4500, 0x4600) +TRAMP_KVM(PACA_EXGEN, 0x500) +TRAMP_KVM_HV(PACA_EXGEN, 0x500) EXC_COMMON_ASYNC(hardware_interrupt_common, 0x500, do_IRQ)