From patchwork Thu Feb 21 03:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Niethe X-Patchwork-Id: 1045727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NR3B9CoF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 444g2z6vcqz9sBr for ; Thu, 21 Feb 2019 14:30:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726113AbfBUDaT (ORCPT ); Wed, 20 Feb 2019 22:30:19 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:37525 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726016AbfBUDaS (ORCPT ); Wed, 20 Feb 2019 22:30:18 -0500 Received: by mail-pg1-f194.google.com with SMTP id q206so13049401pgq.4 for ; Wed, 20 Feb 2019 19:30:18 -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:mime-version :content-transfer-encoding; bh=63t96RQiKpNGzgnr+RYXcq0/eY03TTk4vtQMm5L/9O4=; b=NR3B9CoF3c+oV66ZIhVPoj0MmVfiPrLiXQtePgRy0oqke8j96UhIZNEKl565i26XW9 n0fHdQzzCOQH6dnyfDJRe9oA8+jxClTc47QMzl92OkwbJ1HWvGIyoKqU6JRWAVcK0CEg FjVhi308AVFy/Rsa85u1c/P7PHtiAY6cI6uY9dWn2U3Us9MKS3fVO7xf71RcC6qFYpUE 4OV5usQPIAB75CXU4szkqUvCSIy7ehWkWHeFwD5Pfm/9IuFsjpH5MTELwmkUvFK+PKOl M53lX/1SiqGHUFbhavX/u3jwomLgmR27Rd4BhuzTf1C6XI4zk3E25KXhfg+4hJSgQi5a xPow== 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:mime-version :content-transfer-encoding; bh=63t96RQiKpNGzgnr+RYXcq0/eY03TTk4vtQMm5L/9O4=; b=dbHrA7xDvXMPZz6AQ0R+8eJNe6IswMZfwEAaIZQRIYwmPMTa2NHdjNgy/oO+jv5VGf UZt79DWDooj1IRQTzEF+dUGlRzoFv+3IjK69Btz74SnnWUEPm08D1uD16yjpYnfQM2zA xz/NEtsgij2PIEW8WKArdTHqmh+lDMQDWQ0QDsrhd2/4poVILi13CpeF1cH7y/THDVPw Fge/ywYblrE7gvivGJxWRO0trBlyh5O5/ZkNuK6htwI/yy1P3QIyUkqdAZlAr8Xzhama nde97qb2xFkuUAVKe9SCG78q+WJKCSQjd5MLML5ArDkTIL04lCwuDeaSS3kRoYDuRGAs feRw== X-Gm-Message-State: AHQUAubFJmb8YHjwRHbsINjRzOOs9RXvV8/e5YqdbKN4vw+kOQGFW8wt Wp34pBswEHRgrLutNmogpsQ= X-Google-Smtp-Source: AHgI3IaTUIw4UmfLv8oaO6Xiw8KWnfv0aiIhSkKeeJ+Cf7W26tEO6OZC6Rk/4EkvDIEdyLSjlq3H2Q== X-Received: by 2002:a65:64d9:: with SMTP id t25mr32630252pgv.244.1550719817677; Wed, 20 Feb 2019 19:30:17 -0800 (PST) Received: from pasglop.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id z1sm31464093pfi.155.2019.02.20.19.30.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Feb 2019 19:30:16 -0800 (PST) From: Jordan Niethe To: linuxppc-dev@lists.ozlabs.org, kvm-ppc@vger.kernel.org Cc: Jordan Niethe Subject: [PATCH] KVM: PPC: Book3S HV: Fix build failure without IOMMU support Date: Thu, 21 Feb 2019 14:28:48 +1100 Message-Id: <20190221032848.22590-1-jniethe5@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Currently trying to build without IOMMU support will fail: (.text+0x1380): undefined reference to `kvmppc_h_get_tce' (.text+0x1384): undefined reference to `kvmppc_rm_h_put_tce' (.text+0x149c): undefined reference to `kvmppc_rm_h_stuff_tce' (.text+0x14a0): undefined reference to `kvmppc_rm_h_put_tce_indirect' This happens because turning off IOMMU support will prevent book3s_64_vio_hv.c from being built because it is only built when SPAPR_TCE_IOMMU is set, which depends on IOMMU support. Fix it using ifdefs for the undefined references. Fixes: 76d837a4c0f9 ("KVM: PPC: Book3S PR: Don't include SPAPR TCE code on non-pseries platforms") Signed-off-by: Jordan Niethe --- arch/powerpc/kvm/book3s_hv.c | 2 ++ arch/powerpc/kvm/book3s_hv_rmhandlers.S | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 5a066fc299e1..94e50438e6a2 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -937,6 +937,7 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu) ret = kvmppc_h_set_xdabr(vcpu, kvmppc_get_gpr(vcpu, 4), kvmppc_get_gpr(vcpu, 5)); break; +#ifdef CONFIG_SPAPR_TCE_IOMMU case H_GET_TCE: ret = kvmppc_h_get_tce(vcpu, kvmppc_get_gpr(vcpu, 4), kvmppc_get_gpr(vcpu, 5)); @@ -966,6 +967,7 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu) if (ret == H_TOO_HARD) return RESUME_HOST; break; +#endif case H_RANDOM: if (!powernv_get_random_long(&vcpu->arch.regs.gpr[4])) ret = H_HARDWARE; diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index 9b8d50a7cbaf..541b121477e4 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S @@ -2264,8 +2264,13 @@ hcall_real_table: .long DOTSYM(kvmppc_h_clear_mod) - hcall_real_table .long DOTSYM(kvmppc_h_clear_ref) - hcall_real_table .long DOTSYM(kvmppc_h_protect) - hcall_real_table +#ifdef CONFIG_SPAPR_TCE_IOMMU .long DOTSYM(kvmppc_h_get_tce) - hcall_real_table .long DOTSYM(kvmppc_rm_h_put_tce) - hcall_real_table +#else + .long 0 /* 0x1c */ + .long 0 /* 0x20 */ +#endif .long 0 /* 0x24 - H_SET_SPRG0 */ .long DOTSYM(kvmppc_h_set_dabr) - hcall_real_table .long 0 /* 0x2c */ @@ -2343,8 +2348,13 @@ hcall_real_table: .long 0 /* 0x12c */ .long 0 /* 0x130 */ .long DOTSYM(kvmppc_h_set_xdabr) - hcall_real_table +#ifdef CONFIG_SPAPR_TCE_IOMMU .long DOTSYM(kvmppc_rm_h_stuff_tce) - hcall_real_table .long DOTSYM(kvmppc_rm_h_put_tce_indirect) - hcall_real_table +#else + .long 0 /* 0x138 */ + .long 0 /* 0x13c */ +#endif .long 0 /* 0x140 */ .long 0 /* 0x144 */ .long 0 /* 0x148 */