From nobody Mon Nov 25 13:36:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1714981958; cv=none; d=zohomail.com; s=zohoarc; b=RLzAwjh1I4MsJFUJlkxaZyTdVqdSbIoQPFl1RGQYNTPP23n6CIKB7JA+Q4eWAnzpkKgvNzPhXtSlFlX/5K4q8HLdm+Y0A7kU2P4b0JHXzRnC3tnsjwsxt7QeSGZaj9NERjPIFDrawFWk6Vk+NCvv+naBBgmcuwrv0lAdZRFvkZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1714981958; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=irmtTqct8A65MzBRfGfL65/eckdbEHDoF5RjwLqL9+Y=; b=DGE4EN1i1naExZls1KhaNszU8vuLFHXFLTcGz4+RooQryUSthu1sxJKO4leeWKYNvuqRdTCm69o1F/iewshgcTTH+MC/A6qUyo9POdYRR0L+ZfPD94stHGYFIvrVaxEKIW+2Jgkig13pxWBhCN4akmRM72P7rxhGxmQFutwj6xo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1714981958271298.39476808242637; Mon, 6 May 2024 00:52:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3t99-0005wJ-9e; Mon, 06 May 2024 03:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3t8c-0005jL-KH for qemu-devel@nongnu.org; Mon, 06 May 2024 03:51:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3t8Y-0001XT-Nl for qemu-devel@nongnu.org; Mon, 06 May 2024 03:51:53 -0400 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-49zWmaTQNh2OrRntU9dcZQ-1; Mon, 06 May 2024 03:51:42 -0400 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-56e645a8762so1133198a12.3 for ; Mon, 06 May 2024 00:51:42 -0700 (PDT) Received: from avogadro.local ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id x2-20020a056402414200b00572cf08369asm4090322eda.23.2024.05.06.00.51.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 00:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714981905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=irmtTqct8A65MzBRfGfL65/eckdbEHDoF5RjwLqL9+Y=; b=XAk+aLvx5C4WSDeQK7j9W9AJngGSDTrCp1+NXWZcwVelOGFRcZJChhKUvKMWPmXzAUDMWr tibwevePaq9qMkX1TwnvJ1XbgqQdmx+64syANHpG2aaUn1YADVKvSVa9XbzkgLFiwyTXoz B3wdCEet3Z0sooDvIaBugsDVg03wobE= X-MC-Unique: 49zWmaTQNh2OrRntU9dcZQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714981901; x=1715586701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=irmtTqct8A65MzBRfGfL65/eckdbEHDoF5RjwLqL9+Y=; b=Sz/IC8Il3ZHhX+38MLQzuc/ZixS43Yp28J7Qtqv2l1AysG8SK6oQ/VEQ9cHT/bSK4C eIvIOehxA69PtYsaAGS8BLxkv76lsGbYN1S2cU1GeHLY+2dT+Be6kDLJLx0Od72J0g0l nc7xrIHP4wNAK77vve2Tyg5BMFYJ8hu1smQvQq5Rs2np5NVi3PSXgoxamb9VLsCloFnz MK6Xr/KR08RFuY2PhOJBkYJ/9XXosEhVCHAk339yCZk8AH5yTiEXTNPVYv3nyQhdu5Cq DYgMawatASuJHB73sRSr0g4c8xwkrbakyxmUt0whMx+NZgan6Tw0Xx8VPfPEwQl5htQT 3b6A== X-Gm-Message-State: AOJu0Yy5BB2B88626yjf/b7LbvMlFabKdCnsoEw/fFdtI/oWGB5D+vCv dD7t7lz4a8p1QAa3azz3VSgPH0YK3QGpB9xiqRaIaIyBAw5tTEMCMgnqyVx3M+UdDfoAFyDHPSi BYbHGOIk37W2ennw1NZodZIivRuZcg/A6m827KGUnl513Vds4FojpfEYFa91bRgCn+KTWTZsgKy jllWiMz0bFHE6W16xAi02qJTgcc0IFD8NYBorG X-Received: by 2002:a50:c30e:0:b0:56e:34e0:4699 with SMTP id a14-20020a50c30e000000b0056e34e04699mr6082475edb.30.1714981900843; Mon, 06 May 2024 00:51:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHLTRoTBQLzuLNGHU08YJmbHYP1FJ1way6/iCEXZeCL8ZvYDH/kcyUTirM+pnjNcre8OVAWwQ== X-Received: by 2002:a50:c30e:0:b0:56e:34e0:4699 with SMTP id a14-20020a50c30e000000b0056e34e04699mr6082458edb.30.1714981900502; Mon, 06 May 2024 00:51:40 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 05/46] kvm: ppc: disable sPAPR code if CONFIG_PSERIES is disabled Date: Mon, 6 May 2024 09:50:44 +0200 Message-ID: <20240506075125.8238-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240506075125.8238-1-pbonzini@redhat.com> References: <20240506075125.8238-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.431, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1714981958478100001 Content-Type: text/plain; charset="utf-8" target/ppc/kvm.c calls out to code in hw/ppc/spapr*.c; that code is not present and fails to link if CONFIG_PSERIES is not enabled. Adjust kvm.c to depend on CONFIG_PSERIES instead of TARGET_PPC64, and compile out anything that requires cap_papr, because only the pseries machine will call kvmppc_set_papr(). Signed-off-by: Paolo Bonzini --- target/ppc/kvm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 63930d4a77d..46fccff7865 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -49,6 +49,8 @@ #include "elf.h" #include "sysemu/kvm_int.h" =20 +#include CONFIG_DEVICES + #define PROC_DEVTREE_CPU "/proc/device-tree/cpus/" =20 #define DEBUG_RETURN_GUEST 0 @@ -71,7 +73,6 @@ static int cap_hior; static int cap_one_reg; static int cap_epr; static int cap_ppc_watchdog; -static int cap_papr; static int cap_htab_fd; static int cap_fixup_hcalls; static int cap_htm; /* Hardware transactional memory support */ @@ -90,6 +91,12 @@ static int cap_fwnmi; static int cap_rpt_invalidate; static int cap_ail_mode_3; =20 +#ifdef CONFIG_PSERIES +static int cap_papr; +#else +#define cap_papr (0) +#endif + static uint32_t debug_inst_opcode; =20 /* @@ -1668,7 +1675,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run= *run) trace_kvm_handle_halt(); ret =3D kvmppc_handle_halt(cpu); break; -#if defined(TARGET_PPC64) +#if defined(CONFIG_PSERIES) case KVM_EXIT_PAPR_HCALL: trace_kvm_handle_papr_hcall(run->papr_hcall.nr); run->papr_hcall.ret =3D spapr_hypercall(cpu, @@ -1698,7 +1705,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run= *run) ret =3D 0; break; =20 -#if defined(TARGET_PPC64) +#if defined(CONFIG_PSERIES) case KVM_EXIT_NMI: trace_kvm_handle_nmi_exception(); ret =3D kvm_handle_nmi(cpu, run); @@ -2054,6 +2061,7 @@ void kvmppc_enable_h_rpt_invalidate(void) kvmppc_enable_hcall(kvm_state, H_RPT_INVALIDATE); } =20 +#ifdef CONFIG_PSERIES void kvmppc_set_papr(PowerPCCPU *cpu) { CPUState *cs =3D CPU(cpu); @@ -2075,6 +2083,7 @@ void kvmppc_set_papr(PowerPCCPU *cpu) */ cap_papr =3D 1; } +#endif =20 int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t compat_pvr) { @@ -2837,7 +2846,7 @@ int kvm_arch_msi_data_to_gsi(uint32_t data) return data & 0xffff; } =20 -#if defined(TARGET_PPC64) +#if defined(CONFIG_PSERIES) int kvm_handle_nmi(PowerPCCPU *cpu, struct kvm_run *run) { uint16_t flags =3D run->flags & KVM_RUN_PPC_NMI_DISP_MASK; --=20 2.44.0