From patchwork Fri Mar 7 18:03:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006869 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3DEE21C16A for ; Fri, 7 Mar 2025 18:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370629; cv=none; b=Ukss5Zxc2ttVU2FV2EaCCC+cmhLYZgyZv9fn1KVd7vcq3ruuAdUlKRU9SOzxaLvh7IFA0KnBWeozr84YYMea2syOoP5HpTD86JrJ3kVMX+xpOCc59tEgPHSGFG67gYCzDTxlsic4FJ69FHhzSk/uHolDFurn/i26dPf+u4U+gQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370629; c=relaxed/simple; bh=bu59tL9L5VROU2Hbljq8VbPEC8f8dcQOMNoTWWVJojY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PTTzEgfgTBzH1KKujw5gbdMtdTN0X3DfrzYQHLAVv8fpYv+yu2Fd6HiZGYxPDGxPnufSZwmIC9MvwLUJxQHcnJLP1vCp4HvF7ufXTCkRmmYgE8XRCQvmnlIaYYPCPt5RBQ3xotCj36GRCrc4g6bO/jxTBOgrZH0ftr7YTmhVuaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BISUG5Ru; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BISUG5Ru" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43bdcd0d97dso12778765e9.3 for ; Fri, 07 Mar 2025 10:03:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370626; x=1741975426; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J4WceDIEs6qy2mz0/CkEqDnKb2HdT3DG3c81fgnQQN8=; b=BISUG5RuPt4R68QrK4o739qXe/5xFIlMmPVEgtNrsNNbXCmeC+kLiuX1MVyqIgZJsp +UGfGrrK9kE3APb68pbJ6waQ8hFk2pjdHsJPBgssnzJr6E+3W7Fz0X1Q5BiH81zdIoRJ /3glp4khQhyvL7xpuh+L0L44FSEvOFu0I3EBqw1Xzev7Ww3QmGR6NqlxA6lTqR2RPrnH C8BKeUmYYZ8vSgt4Tc0D5RATVmyAFcd/YV+OTitpHFXT2dqggVKLB9f+TD29I4V+e+xg I/mXKbsc4Rqx8B6FkGhnMxTvj2GEebapxCNUfmzn8C7qAu0GVP8BcBYNWd9q6xfDHVkm xpYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370626; x=1741975426; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J4WceDIEs6qy2mz0/CkEqDnKb2HdT3DG3c81fgnQQN8=; b=ooxr1GV1/m5489gNDw/lzqHeFUZifAd/Jc3mDxh+qunCVeSNe+UGDytKJjQ86gaoDN AETMv2UbEXBXzLRdd6+8JzGm3Qc2rXyYIJ5BvfvpRcfiuioa09xyBUHeGOgqDhbw+axh z/cs77pdpjG2P2cNr0j+ya2R70+/nJAhQ34E8bc4cvn4qSX210m6MW1M/QePnEADEZlc UyTA+YloinpuhOvU8fH8xy+hX0jJG1o2OowAGnrWsvIlOZnAOxDsnnyBy94N7R2JbDDh /osQOXm6ICSr9YOUylPXDfn3b/91lY80XqN6FZwSXMcHv4NQcE8QNQSfPDrQNJDuM7fr QLKg== X-Forwarded-Encrypted: i=1; AJvYcCWCrEWaNPrnf6oJN71yYlz+09crPs0htcYq3qlTVB7hmH/iqWsVfa+S2dsq2JOqWizZSDg=@vger.kernel.org X-Gm-Message-State: AOJu0YyDzrEhFR5wWpJ8iCb6hpgM+kvfGES8ga8vIL6pk58WrNceCd0v 4QPHmcqhH6qLaJYrpwEArT3N5E7ezErnwniU+HHUnQse/IM4wbcO0s/ps9kIje0= X-Gm-Gg: ASbGnctF1p3fowVnvXA4QpdeXDYMHSdbCvZKROr3GRO9bPUcNqyRPGFBCTXoSIJiCTW oyxEPbOFjIFQBBpFyE58OxGMv0tVyykF22mX6rhENoZ28/R8v7esTa8J8rYlq7Q0AWt5Gj2NRpq RunLor6MTxdKVfw/loFDUIgjl3Vdsy5gTyvxho5G3F9erZUtb/FenqMikPhIdvOEFWs7lz8XA6u 1+v25y3/zRZ6VdgsgXTpPcvBu/ULV1WASOoPVneMnOuXsf6zlm/mJ8ZaGPPy3zWzB0YVSd7hZD8 imuJq+lyVFBHkJdCrqadFj6wiDV+JQa3qukj7HKaUZR8xk7FYd+DQB/57R7nKM4gE6kmTLTkYnW cueE1/C/e5qs2EKDNvj8= X-Google-Smtp-Source: AGHT+IENdobWa78DHN7taYvyUia80YoI2km9M/IOHa3nNnJsg+wiICIpvLN5fVTrb2DUViXZ9quCCA== X-Received: by 2002:a05:600c:4447:b0:43b:d0fe:b8be with SMTP id 5b1f17b1804b1-43c68718900mr35580865e9.30.1741370625106; Fri, 07 Mar 2025 10:03:45 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd831719sm61522465e9.0.2025.03.07.10.03.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 01/14] hw/vfio/common: Include missing 'system/tcg.h' header Date: Fri, 7 Mar 2025 19:03:24 +0100 Message-ID: <20250307180337.14811-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Always include necessary headers explicitly, to avoid when refactoring unrelated ones: hw/vfio/common.c:1176:45: error: implicit declaration of function ‘tcg_enabled’; 1176 | tcg_enabled() ? DIRTY_CLIENTS_ALL : | ^~~~~~~~~~~ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 7a4010ef4ee..b1596b6bf64 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -42,6 +42,7 @@ #include "migration/misc.h" #include "migration/blocker.h" #include "migration/qemu-file.h" +#include "system/tcg.h" #include "system/tpm.h" VFIODeviceList vfio_device_list = From patchwork Fri Mar 7 18:03:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006870 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C109918FC92 for ; Fri, 7 Mar 2025 18:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370634; cv=none; b=KhZyYAkrd7fHNVSIjp0WknE4untIfeD3xeKQ+8XSpkbE85hCvOWVqgAhRbWAbHOMRzFF0pUcWO5EkurtiQZ/mnEPqhKANAkEQIJfA/azF7cEMWiul/YxnDcknDNLUibmHgHz/ofkTBwy9lIfvA+jdOfoOgzaHrHgreG5hQTHGA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370634; c=relaxed/simple; bh=ZVL1Z35KUy1EALzqodIrTZATGYJ4pO4pn0b1NrnaSzE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mvCSxteEDCumwBz6e3FlMX6jDC9XZYTSpidwm8qGRzeY6tm6y9MFPIU/xtUjzxfmtcH+WFamYPak5bQtGTM70V+wME3byjrEgd9FRlQxxUv3xtnofULmSTZDXhZSQwNuFhjI5p87zb2+JV5LL9PUtNWQRYO1046hKBdawBZO2lk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=FyJlEy85; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FyJlEy85" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-39104c1cbbdso1121508f8f.3 for ; Fri, 07 Mar 2025 10:03:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370631; x=1741975431; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k75P2fUqxCLcSZyEfoYQ2NgIkqW5yPRPNiO+LCjfzGI=; b=FyJlEy85k69x8uWuvASuMLgSGNo20v5g+33qlIoNetd5OeNMsMbjzz+ROoKowds0XY aLOn96Y46d8GWqD9r24OYPQ/0pT6v1vR6gRiQDwuqjf0qLvrCRBrlSNaDbLE4Smhq/wF cqT5Uoj8/eyt2z4NX5MIaXxM6AmmrkiAzAsM5h2bJtY9w02TH+4gsoxvOYggbflf1Uzp cUDzJX+HsK5om1q9B6C6F+wclGQ3VWPsv6E4TxI4gqlPxd4CLrXP3W9cpsHh8LDm3JXw A9uxeoo/b8z+cTIPE2NK5OMAa0lVU0lKcZ+YBG0K/WaziJZJz4BI9GZ60lii1QwO+HCG VILA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370631; x=1741975431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k75P2fUqxCLcSZyEfoYQ2NgIkqW5yPRPNiO+LCjfzGI=; b=ZLdSDC41SeY0keXHY2IZ76HmWO8UQ8bBNVCLhOhxMW8oIZ3RUO1r6leJYCkSLkqEHo epMBW8tGORAL5/6ly3ulczs3dQpU7BCHvd8D6CaHLfNeXZBTC1ojZUQdAaPgdD7FXRcu JEmorsoTfSOTZqNp5QTV1KYI2Pu8hVmw0H9Dx4Nj6rIYgKw+ONs4uHZ+jt5tRYTPiS7C 4ByGGNsYp5OH7BDMQ8TOY1fhEvpEfUQRBPoup4QGFVzj45lMBzr6AmbW90TbZvQHxMhv sT5KOLw0vLh+1SNekgI7LsNqB9YIedh0zNzBayvJoBA1XKQZDoeijfJ0isUnW4NUCxrr fA/g== X-Forwarded-Encrypted: i=1; AJvYcCWoONWG6H/H4iAqmPoXnG1VJ9YGIqRxWjau33KQ8CQHEn8T1uGySET/OoOZ9VwQzjYUk1c=@vger.kernel.org X-Gm-Message-State: AOJu0YyX6QsXKf71VrSoDmfc6tjVSzUfAres5cCLMODgBrnLE9eX6Bjk F4yMebXCmvs4Ew4jc75wtjEbDMGbXDUfGn9O3FznvvteiHt1Ku8RpqVPyNdIkVo= X-Gm-Gg: ASbGncsZaYnTqU8GtwxNS8vGuc7PkFuzXy1SZR38OpkD2a59BYjFayYK9t/rxoQc6/S vtMfQS7FE5MiMizuUCgUfnjGs8ppSkqW0PvuktbMY/2CUnSksQ3tvwmSqJwzrTAABQNxGKYVdA9 I4gPVlJo9DLeYnxTGs7QteCzfHsDh1bYWh2ZMnAaxnTF65ZuK+l/QiNjb8Xo3/EWs9eSEemiCSM PC0hoVYK7b6WWgrcfFgz2CCZlcU6JGFuo1pbXqOwhkW4OID0Majo3t1KmFCCLaybKgJxXmmmTSk BmbuHEYIgGFuZuOsHC7Rstjxp2YMA5ANXUnYbNSadtmFKVL2r4wc++aeMrfm/8PkI6HxJM9VDQS plEVgRTDHIISkNTz4U34= X-Google-Smtp-Source: AGHT+IHYEmTztSGGumLd9aL/cX0/wZGEavdogLPn/DgZYSC1IJEj6byPpvVwnQkBQTNW86k9v9l5pQ== X-Received: by 2002:a05:6000:178d:b0:390:df02:47f0 with SMTP id ffacd0b85a97d-39132dd6b75mr2573700f8f.42.1741370630655; Fri, 07 Mar 2025 10:03:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd435c836sm87577545e9.37.2025.03.07.10.03.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 02/14] hw/vfio/spapr: Do not include Date: Fri, 7 Mar 2025 19:03:25 +0100 Message-ID: <20250307180337.14811-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 is already include by "system/kvm.h" in the next line. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/spapr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index ad4c499eafe..9b5ad05bb1c 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -11,9 +11,6 @@ #include "qemu/osdep.h" #include #include -#ifdef CONFIG_KVM -#include -#endif #include "system/kvm.h" #include "exec/address-spaces.h" From patchwork Fri Mar 7 18:03:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006871 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 865D9217670 for ; Fri, 7 Mar 2025 18:03:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370640; cv=none; b=c+JZbTAHWcgD6+c5B32/j3fb2Y4Qxu/OZZLy7i0BaQNJLIAHhFxuFo/qx+WhasQheBDftOflbtAuu5rugYY1wV7HvNfEAfOlKnQgZewhXRl13TfemQJ1/AsJyHJmu5+EmeyYfBdDsLqrzxCBkicuCFkxoqKDw9lbKL8doey0NWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370640; c=relaxed/simple; bh=+x0LQtWFXmuqzfMewREHvnNtInYH8RIrOAuVxKSpcPg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oqSMxdSlNh6Nd/hBQzhQltDvRLgnz1lzBzxQGlzkAcK9rmQ48bUX3NdKoA7HhWL5qfZ81JlOB/eqCVhGqjSGFkBvHxXey/Ki0fXJy0uU+qfriZZbilFLYP1QGZ5a3/J3KK95AqUm0xnXdE90yBRYUK1LIB30Jh3VXkzz342vcEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=DHnVm6y2; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DHnVm6y2" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-43bc30adad5so13636615e9.1 for ; Fri, 07 Mar 2025 10:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370637; x=1741975437; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=krlUeIQnTGSREObLa/ECb/a6wxL5+gnrd7UhE7/j7Y4=; b=DHnVm6y2L+Utulp1ba4juet6iej0qMUNxXWpNl2zRNlFy9jCEvThkAsATDEAiaEpyr lERfrDVQwamodBBr/ts2WHM6pXzf3orPHPcme4ys5N4RZVRvBzTOc2X5I5r1/WIoQ1Pz DzJL9hh53SujBCeW70Fzea4wcOok+LeWdZ8WYit+kxpAeqsrsEd2uw7p+w7rLvud0ZsR W+1gsOgOV1hk0KXKi4Gub+3/cLoQJQuZnb7vhf9ijTxg+IeWX9z9hI/2ifLew2rnymsO Y91lxmXNaYXT9zVjWC92ZwgExjWh3+T1A+gGAYdrJmcBUhMHbuHUFxF6+V0II/+8u2Ie OiQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370637; x=1741975437; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=krlUeIQnTGSREObLa/ECb/a6wxL5+gnrd7UhE7/j7Y4=; b=Ddm8bnYuVrg7PO1v07zFEZHTvfbumyToo5W4jRknQD1m7XVyW0t3JPNGuOY2vUtQR6 6amv1AMgpIC3O+cuMZ/KbZ6hPKNHKnFEpRE4OkD096WqLXisw/jswROWWJ8Iubp1jxXs /sXh1rnSKZwnDc4rB5jccNdPsrQJgF/5g1sFOJSCszQXdT1+AQjcR0xjEkOMgGH9x/wB RPf+NQZLZYnRmGfB6n4rkJA3T6c+KnYZRer9nPlbM9MdvGhfVSkLwKXgfzcI8z6YU3DQ KlWnkyWwtbzc2DZyWHpfwyQRrSKRJlt/cytAc0V67DpHEc1hmF51rhriz0f9X25qjceA 4ZRw== X-Forwarded-Encrypted: i=1; AJvYcCUezcWVKaODlsk7Oq0U5XK6wWJhv14cVIvVRtOVZuFQk3FmOpn9j4dLrLq57+hHQFqvZYY=@vger.kernel.org X-Gm-Message-State: AOJu0YyhX6ZMwj7p/j8sLF0mldhgrKnfN86gR/Td0l1/WVfFtC41Fv0M gRQMmzUkYqgLYSpDdNYxIhSJPBHFWdZShELZc9JJhH04l1SP3b8ini2xBXq6g7s= X-Gm-Gg: ASbGncvLuVcjoGNydxqhX/Swo4HdXdegduMcfK+B4yLMgoTRmoe6xU5gqc9HXkDvnfm M1hO6Mjb9dR7J8FXJgeJLi7UhROMF+dlwWr/dDnQnAH6pvx4Od9NHZSgjGxITeos2yvgXvC+mYV fqimRIXDv5Z4W8yvmJcvNu7OITR/vSuchflw1vJXoAcV6YoJ+YzSdmIcdKtsSMuWSozZZEdJjQ/ /fIWZQrcGeL1nhy2MyZsepBZT2cRJyLEFNEgHXw0ddl5Md/v1d2GOe++qFA9QQgtiVT/X7V/UE1 jpGsFqXSY9h/Ix3rRFTV+DXDqDqMOTznDalCeRAw+YVArLx6f8h5wmfDeAc39ymH2mngk3p6jw+ DoBaGT62TBwzl8KDxoF0= X-Google-Smtp-Source: AGHT+IGu5Q1YPuPmBb8fk1NDTqZebT4A1/g6W7nPx0JHWu+hxOl2cltZSz5gJGPwWO4yjdIb8BwaRQ== X-Received: by 2002:a05:600c:26cc:b0:43b:c390:b77f with SMTP id 5b1f17b1804b1-43cb91c5affmr23555105e9.26.1741370636721; Fri, 07 Mar 2025 10:03:56 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4352e29sm87392995e9.32.2025.03.07.10.03.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:03:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 03/14] hw/vfio: Compile some common objects once Date: Fri, 7 Mar 2025 19:03:26 +0100 Message-ID: <20250307180337.14811-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Some files don't rely on any target-specific knowledge and can be compiled once: - helpers.c - container-base.c - migration.c (removing unnecessary "exec/ram_addr.h") - migration-multifd.c - cpr.c Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/migration.c | 1 - hw/vfio/meson.build | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 416643ddd69..fbff46cfc35 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -27,7 +27,6 @@ #include "qapi/error.h" #include "qapi/qapi-events-vfio.h" #include "exec/ramlist.h" -#include "exec/ram_addr.h" #include "pci.h" #include "trace.h" #include "hw/hw.h" diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 260d65febd6..8e376cfcbf8 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -1,12 +1,7 @@ vfio_ss = ss.source_set() vfio_ss.add(files( - 'helpers.c', 'common.c', - 'container-base.c', 'container.c', - 'migration.c', - 'migration-multifd.c', - 'cpr.c', )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files( @@ -25,3 +20,11 @@ vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) + +system_ss.add(when: 'CONFIG_VFIO', if_true: files( + 'helpers.c', + 'container-base.c', + 'migration.c', + 'migration-multifd.c', + 'cpr.c', +)) From patchwork Fri Mar 7 18:03:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006872 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DAB2217670 for ; Fri, 7 Mar 2025 18:04:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370645; cv=none; b=XAlcSykADKnXnoYn08WbXMJa3LChZe9Q6R07vgRMhRQ3MNUvFdfQ/WfBM5VgucPfaPPI/+ZV2GaayTwe5ZQQfxS9HRo3JIcsHd8t3OgpGKYvE5fol3uO/W0bn0dcCerio2WhZR3KvBDvDzuIaVjFNuMqZbcLpciMSk5Rm8/6EJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370645; c=relaxed/simple; bh=lXXphKQbpJNTtHUav52LK+UzEncfLO9/RxqUhhKP1VQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XHNO6duiBTGUn16KtT5rp10ISj5PsjfvhfwAGNDQp0nK264ueFlUBGRzXty87kuRJHMw92cyI0Q8MohLS3aIaEj/2BGgPF4UqXqq92WsVnoHUzJMTAU11lt9lwJJKbe68yAfOSi8cO2vV6IJBFB6PrVdurryVjX3Yf5mN27wHWk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=bQGrTdk3; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bQGrTdk3" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43bdcd0d97dso12780115e9.3 for ; Fri, 07 Mar 2025 10:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370642; x=1741975442; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XjnP6suRKIDIvCyvQUHjHOPyIvdZR5e5AjhnJZaY/H8=; b=bQGrTdk3D9EZZ2y7ZKXnhfngKzQlGgaWpWoM+6b83Fez8XpMG913Oll9COFp//oMNU QDBKegAgYy8xm927C0vYN64AyG28wIpyHNo6EMEoi/6L12U6eejx2LxMXy0k0CkhxzYf lBtVEQUz8BLLrfi9vQY6fMGoY7Hpyb/KShBtsok1IyX8/2aMIiqXaZ32qTW3DNxwZlLE 5fwEmlK4QlQqmhH+UFG0U8X+pNo4yRjsh538eXVN1sSIbcTnR54bcYLCu8mU8d7np3X6 X2I70sGvJrJEqbK9RfDaO4ySrI4ji2HgLHpStpe+1ZEyIn1GcJtJ2iPtHSzJOg51VEWL mrWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370642; x=1741975442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XjnP6suRKIDIvCyvQUHjHOPyIvdZR5e5AjhnJZaY/H8=; b=WVl4D0nKzXxHy4qlPPmsEIWUhCYjTw2G5Zwa9slFJNeG3Rp4xh37OL36T737SB+AhE vuI+n3NhRdjIobgfMAlSBeuTvjE1/82UVzv/0wzlAoJlPCz7d5o7rDldDgQtPjRZflOh VQT66bMvCATmECHJfy9S9NNMIt3ke191ht0GpklWucUV//MtUJbB/RsqLhu32U16q3eI I2f7v7P2z2IlQrNxI/rcjYxO3IwhxrpdDnMyoOHOlUYLO0toUQ2SUUwySLQFFXg2OJXJ 7nF6czPavfTKxAAHulBtjrnlwTyL4gTV7aSMkv9VjstUSkJHg/zeN6Ae7PkHi7bysTeL HXpQ== X-Forwarded-Encrypted: i=1; AJvYcCUZobhLlvh8Ud8jvDpHNikEMb27fF3xNCe+LbqXl6zmiHpWwVCD8oi542oomgQ0lSHu13w=@vger.kernel.org X-Gm-Message-State: AOJu0YxevIMRctNdedZ1xvWEOoifhUSQmz8AC4mUjamIP6nViRvoVGuP bzGFekSyUlWs+rQxkBWmNpsu1CW3iEZC16OeGepORXOxDA2aIUT2aAZfkKDvjh0= X-Gm-Gg: ASbGncurV2U84WZO2cTPCk1pyfuxVK5UoYAQfP7SxQmqQzzsOkd5DLQd1gm8LgE+xlc wKkrwMed/rTW2zLOTEGjYb/EB7Lvuy5nGGC2JfDyUFCJY+4WqbFl3JhYXt0ejs4vvFebL6CSAew OuKyiwQfS4No29+Arr51aul2UDBYhHpxTxSFsBl1yuRHPS/5hak3i17XtIU/h4cGXvtiGyZQpXC zELnkNBpAdpZX6IknxEss3hVjP9uuqRSkGEpEdCnOhuXthdqlIvx+0XBGj3gntfEZIt6PY/U2Rj yfS3D/P1Ot0zJfsMdp3LVSgdavUhScYhl6oURIt6uFpajT4GCuSCiUE/frlRZKTOdnBuoJq+4nP kWLI7IKfNNQExLp64wjY= X-Google-Smtp-Source: AGHT+IH3pBJfwJ8GeERs7TfdjebZ04J4hRz/gHgLpXVYv4THdONSI3tncV7atbL9lWwA6lGOlofjPw== X-Received: by 2002:a05:600c:4683:b0:439:9f42:8652 with SMTP id 5b1f17b1804b1-43c601e1201mr33989135e9.17.1741370642093; Fri, 07 Mar 2025 10:04:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912bfba679sm6002314f8f.8.2025.03.07.10.04.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 04/14] hw/vfio: Compile more objects once Date: Fri, 7 Mar 2025 19:03:27 +0100 Message-ID: <20250307180337.14811-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 These files depend on the VFIO symbol in their Kconfig definition. They don't rely on target specific definitions, move them to system_ss[] to build them once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 8e376cfcbf8..2972c6ff8de 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -14,13 +14,13 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) -vfio_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c')) -vfio_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c')) vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) -vfio_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) +system_ss.add(when: 'CONFIG_VFIO_XGMAC', if_true: files('calxeda-xgmac.c')) +system_ss.add(when: 'CONFIG_VFIO_AMD_XGBE', if_true: files('amd-xgbe.c')) +system_ss.add(when: 'CONFIG_VFIO_IGD', if_true: files('igd.c')) system_ss.add(when: 'CONFIG_VFIO', if_true: files( 'helpers.c', 'container-base.c', From patchwork Fri Mar 7 18:03:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006873 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5136223E229 for ; Fri, 7 Mar 2025 18:04:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370651; cv=none; b=dvV6f8A2QylkQI3sJ6xlgp//6lFj055yhgKatZ8RT9QPZYv9/gJm+ZlVLSX0oQumL4AWPoOEoRPxuCLeU7lvXvGy2ZZrl98lMocj+kITmo3cbPDi3ToaN5cBsAPph+Hx0QoUcAJQbmN28O9BjlHv6LZ+YVAbslwHsPKY/UdWQCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370651; c=relaxed/simple; bh=4NU+RjGBUYuu23EMdj6qV2xxTpRFZpBkjafWKSM9eXU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LsDzvwYopPwzCO52+mNVymH+0nJNV3odefp3DGGU3LJq0nb7uOimT8pbx9W2IwlCen6oT8ZS4s75CLqduWu4VMOVTwXbs4Gk7EmtidxueAspItlSx97kpHmnW2q2Pj66rcAAYW+w4fVhzWxtCnuBD/ieGbA9bPPmdrkz+7qIsAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mC13cNAJ; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mC13cNAJ" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-38f406e9f80so1584303f8f.2 for ; Fri, 07 Mar 2025 10:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370647; x=1741975447; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TEveCyP6FEOPe2OjJI8iFRo9o4gmTgwH3d2sFhPvDtA=; b=mC13cNAJqnEbC8gwm4ODJNyfnmwDTLdkcXaNqlkl1qKLGIL6vkuzx1Pnispo+OiA4d rcCRYH/jXCKQrx5IuLRG3wOLaHF6TefoA2hLNCM7OVfmkWR8YIjrO3WDW6gCEol8kBYZ fLuVbQIyTVm+DAfCqbbdtVAj1Yh0BYz2JI5rWN8EAzcDr3ByJ2KLu8NfpceBvZIjEeWG jtoDLUB5eXBjUmJK+w0yhVgG0CE4ZMd8tbwcOS+x8X5gKrwB0XbQuv4neu/qdLpH+fL9 5n5iayKjkm0RZRnGyoaeceuAnPz90JEOn98hrO3d9crvOtscg6Cad5URNNJIn1uksZKy 7ATA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370647; x=1741975447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TEveCyP6FEOPe2OjJI8iFRo9o4gmTgwH3d2sFhPvDtA=; b=bxAESCaRq5pgnHwqQGrvN96UC8aMawU1374MwbqJUF2ITRll8E6o9Im/XdUelQObzc ANlKG6bRYxK0geo8GdHa+Saj7fLdvKShSVZ29IdQG8HOnSjN/jeoo4iZcD1G7vHEGF5Z pzA8PPlXojkxH1zdtoZNtWZSN+ID5dcRUW2y+2JcYsz6U/L2qDMi3Y98mCGA76mfmmnG JL4po5y/tKuts2nNbR5P14LzvEv9BnE9wU/LoaaG+p6F7ro5IdODRrHgC7rLE4T2VK4c DT6CghbVoNRGmruMmv382DLGCi1baIMVA6c+/647l1Da+nXvedWQcOCYqeXF0OFiLuSQ qlVw== X-Forwarded-Encrypted: i=1; AJvYcCVgjlU7i1WQtODA5bFwTMgksKwL/jHruV6zxdgJU8NWCScfL2+fVTBkO3Mlq5C7ZRi7BWU=@vger.kernel.org X-Gm-Message-State: AOJu0YwrlBXKa6Qfqg1HzJhMQXJw6TRcOvKCP9apsKLz5vatqWouU72l eaIK3nXIzwRMiXN6g/Qg4AXun/XbtMnPbM93IgkXF2Ucsqs30dXbHLe9NHm2YjA= X-Gm-Gg: ASbGnctxWN9yKocAXoHeKcmpuGTIMGyCop9QovEBNTafF8nnGoCakCf+i9lbynprSnf f2PUAnlo1kkGoq5rAa4NBUGsAfjl6h8Wv01kpxtkZ7RUAsPXkuyqLf2yZpRWmxdEM4fcUtHS8EI Ca80rxqFB1WRlfdT06MCSxlIMeoPOnlrGg7lZRv+0KId0FzjPJlmMf9F1ozoNdhCA1kYlzrXNHd ilURAoIDJjYrmj3i7TXkiqSVJCrriMyh3IfpEM3zaiGQnHltNrrw/q8LwMj2xFOkA+Lg2fJ3zRj lKqSjHZVeB71+pUSsziULzsr0JbBZmC+1IKSaw/mQ2rBNMsqqmE/RYf9qm1r3Ib738gngUt/Iwk eE15kFoAKEhKG6tkWrs8= X-Google-Smtp-Source: AGHT+IFP46e+d4zSpLLCoseVXCZJECsAXVPehPMPfpJJ5BpgkkXKnlM7odaYTNUUfr+LJlq6dGhKCQ== X-Received: by 2002:a5d:64cd:0:b0:391:2995:5ef2 with SMTP id ffacd0b85a97d-39132dace0fmr2665116f8f.37.1741370647439; Fri, 07 Mar 2025 10:04:07 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c01d81csm6127965f8f.58.2025.03.07.10.04.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 05/14] hw/vfio: Compile iommufd.c once Date: Fri, 7 Mar 2025 19:03:28 +0100 Message-ID: <20250307180337.14811-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Removing unused "exec/ram_addr.h" header allow to compile iommufd.c once for all targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/iommufd.c | 1 - hw/vfio/meson.build | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index df61edffc08..42c8412bbf5 100644 --- a/hw/vfio/iommufd.c +++ b/hw/vfio/iommufd.c @@ -25,7 +25,6 @@ #include "qemu/cutils.h" #include "qemu/chardev_open.h" #include "pci.h" -#include "exec/ram_addr.h" static int iommufd_cdev_map(const VFIOContainerBase *bcontainer, hwaddr iova, ram_addr_t size, void *vaddr, bool readonly) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 2972c6ff8de..fea6dbe88cd 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -4,9 +4,6 @@ vfio_ss.add(files( 'container.c', )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) -vfio_ss.add(when: 'CONFIG_IOMMUFD', if_true: files( - 'iommufd.c', -)) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci-quirks.c', @@ -28,3 +25,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( 'migration-multifd.c', 'cpr.c', )) +system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( + 'iommufd.c', +)) From patchwork Fri Mar 7 18:03:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006874 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E7F821D3D6 for ; Fri, 7 Mar 2025 18:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370656; cv=none; b=RMAw95EYDhan6WnmvFnL+e3StSr3vbJUH0m8qgVXQfPrLQcmqvowXls7oLjDeC4E1he0D+AQQ1klpwFPl3oi0Yn1rliVE7nUy8LrTtc2S72Ne6eG/OIdsPqzxDBLyE8n0FqzAF0A8QaAeRwgAIRr1WZ64tbfFNhPwEVkI6zlrLs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370656; c=relaxed/simple; bh=vMkJ4ZDNQbkS/rzmnAR5OMytElf/TyZxD5UeVX3EGfE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Hy9fkWcPgcwhStEA/cKtLfOiZt2uW84Q4DFNVCfUG5l5pdWxng5paxsSVwXG9f5V7eFrFCNhCpYQ1ktc7PXL56WYMBXdtlRCa1vcS7WwlaJa9iW31rUkIb4iLyjCb4F7YMhdq2TWns/TblMvrewAVNq3TjSCHLwagu/mwckFkqE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=mDuJ7H+n; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="mDuJ7H+n" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43bc0b8520cso13517765e9.1 for ; Fri, 07 Mar 2025 10:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370653; x=1741975453; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MrW4KPeEMsJGAah1rF/LLgEoRbvBGZD/GNv5niDZ+2Y=; b=mDuJ7H+nTC/fXi+L6FIXNCQfbEL79XqqOKi4eTIiYqkPWaHQ3E5MtbD3/SvAywjC7F GUJ5Tto/146NfxkmPAavnqoSy4/WPhBGqn6POwUAvmG2TZzSiqVIcNoMjyB47SGyeqZP NzdJJYX70SEhoIragVj+HhM6mygLQTOr2n4NX3hicgG1IFqnr4QzopjXGuMEUS5rRxtp XGWHKXQL/vNOAB1ip4zFaFrLrAjN3z2zzJP7QRUgXCmfzwwCgpyCHL8LVtyVYuf3Wlqm s6nOq16Fv+wtLzpyxu5FwQLdwKzp5coBQu7CYy0x3zcCXYIILxrn6X+lvpadJXCVCDOL g6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370653; x=1741975453; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MrW4KPeEMsJGAah1rF/LLgEoRbvBGZD/GNv5niDZ+2Y=; b=MIbnxwVEvus75/W7790P8NM7fp9zlBWKJ3ISitGmoOGvtiB53d6wVl56/NSP4OYDL3 n1r0v1GfSoNt9WnmfSgl1O7DltT8ujRFMg6gYGhH5vo0/xWg9GmOPLscr67iQuUGdif1 TV4eqUzp0qXfRWN277GeEgH4SW/IzkXfHMnwAtJWmX8KVQbjUIaRDBm4ngMB+E1mJbnD jjE28k87LGBOtlusEFcMmNH5vOoW9jaMX/fYwJGUaNV/AIFbRajzTDI483n9uejEYPF+ UwefhA4gXfWfA432gWoM0vhqKu5qwr3VG/YljAXKLkVyNUYE6VIVkHbgbBakKmz8I4E6 lWpg== X-Forwarded-Encrypted: i=1; AJvYcCWO2Tz37v0oqgIr3F/FzOwR2OtLvZ0siL0K5z4JKkT5ESSD42xNM+jKFZzQNrkJPePEYyE=@vger.kernel.org X-Gm-Message-State: AOJu0YxPhxiUAaM9IA7iLUEUlj0VCS/N9zdYsRwiN4M7WH8PIw89a6uN AzV4i02pdry0A7NZR6obD6qjM6tYbWQzNQ8MVc+8VIER/u1UJaH4JjlAHawDMZ4= X-Gm-Gg: ASbGncstxC8ZZX81KJgQAIZm7cicpylms3F4tCqMSFJs3qjRui8HvRr7feLVR4Uue+T l5gOFMHDhruAWxypd2WnbwRVCSJnN0BauAkuHHgnN3kBQUm4EyLi2oo47G42LleL9iJ13qA4HWL DYmR8oowURUm3/3Gs96/qWfi2uL2GL4UCwXGcEPRDWMwjSv5CbDRfrsLPQ7LkvAU9TEW/W2KAJ7 CeatyXRWDny8xalVU2AaSkvZFXju+a+G22rk9RJl9IHotmtx8M1SmMuf4nlchHcsGA19wkFsVTV gNtcQbdCmoGruScHRnRKBqfJwnhbY7SbJDkXJOrXf1TBTgELd/GbjwKqT9qxXI28F/DddhK5BX1 bDVqm1rt+qIk9UZWBD2Y= X-Google-Smtp-Source: AGHT+IGFTJtAtCuhG8E9BzVu/Ipl6XSR97mVKepvf/WN8vp2isiEEQxnLWYj7XYHqmF1ObgwOUeF7w== X-Received: by 2002:a05:600c:4f87:b0:439:9828:c425 with SMTP id 5b1f17b1804b1-43c601d9508mr32710975e9.7.1741370652735; Fri, 07 Mar 2025 10:04:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd8b046dsm58400885e9.5.2025.03.07.10.04.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:12 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 06/14] system: Declare qemu_[min/max]rampagesize() in 'system/hostmem.h' Date: Fri, 7 Mar 2025 19:03:29 +0100 Message-ID: <20250307180337.14811-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both qemu_minrampagesize() and qemu_maxrampagesize() are related to host memory backends. Move their prototype declaration to "system/hostmem.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/exec/ram_addr.h | 3 --- include/system/hostmem.h | 3 +++ hw/ppc/spapr_caps.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + hw/vfio/spapr.c | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 94bb3ccbe42..ccc8df561af 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -101,9 +101,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr, bool ramblock_is_pmem(RAMBlock *rb); -long qemu_minrampagesize(void); -long qemu_maxrampagesize(void); - /** * qemu_ram_alloc_from_file, * qemu_ram_alloc_from_fd: Allocate a ram block from the specified backing diff --git a/include/system/hostmem.h b/include/system/hostmem.h index 5c21ca55c01..62642e602ca 100644 --- a/include/system/hostmem.h +++ b/include/system/hostmem.h @@ -93,4 +93,7 @@ bool host_memory_backend_is_mapped(HostMemoryBackend *backend); size_t host_memory_backend_pagesize(HostMemoryBackend *memdev); char *host_memory_backend_get_name(HostMemoryBackend *backend); +long qemu_minrampagesize(void); +long qemu_maxrampagesize(void); + #endif diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 904bff87ce1..9e53d0c1fd1 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -34,6 +34,7 @@ #include "kvm_ppc.h" #include "migration/vmstate.h" #include "system/tcg.h" +#include "system/hostmem.h" #include "hw/ppc/spapr.h" diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 51ae0c133d8..1261d93b7ce 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -41,6 +41,7 @@ #include "hw/s390x/tod.h" #include "system/system.h" #include "system/cpus.h" +#include "system/hostmem.h" #include "target/s390x/kvm/pv.h" #include "migration/blocker.h" #include "qapi/visitor.h" diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c index 9b5ad05bb1c..1a5d1611f2c 100644 --- a/hw/vfio/spapr.c +++ b/hw/vfio/spapr.c @@ -12,6 +12,7 @@ #include #include #include "system/kvm.h" +#include "system/hostmem.h" #include "exec/address-spaces.h" #include "hw/vfio/vfio-common.h" From patchwork Fri Mar 7 18:03:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006875 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E887123E229 for ; Fri, 7 Mar 2025 18:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370661; cv=none; b=eooTPkfAq4Thw7qoscwa1fQJvYsv740Y94Sal8MS1q6jF/aS+oqdcnp7MyGFo+dkw/qkF8vMvyp+5uNI9+tizbw5WW4ypaZ2Gmabk3MVBEBP9bYGr7tTpHQZezbVUcxE+xBuhU29DdAQgKFzHs+Nf9hcIEjjRR9XgcBMD6IZVMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370661; c=relaxed/simple; bh=IZhCmu4cNUDWxqZM4d4LY3tPB2mJF4YclUHsfrjMzWw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HMWleHUDLjUSYdceWNsOtxU6HxAqQ6rxRwL17bRLVlyZ6RN+LB5W4cBNa6CWMBnN4zX8tNKd85W5kUYg/I7oPEPf6VqB3bRxYFlY73ArGCTXBbJvgQLiKVYo3fV8e62ruYvA3wC0fnPc3SyHC2+pyNziUpJJwMgb/9rZmBdAiNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=AGakfjb8; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AGakfjb8" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4394a823036so18348565e9.0 for ; Fri, 07 Mar 2025 10:04:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370658; x=1741975458; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qbL4jYEWkDOTQMFiCDljIBBdBkk1lhILqkIilS+kSdQ=; b=AGakfjb8ritGnqp/ua+KLYBlBZhhe1bMQlayJVNuNLrLa1akrX8MAGVZ8bauLXNMxX CvXmRPz+xvV6mbVzryOLRlo8GUdC/QeuZVOTFC5TW3C3aUl2fnhDJaFJYti+pMVN4lw4 TqN+IU95bzpN1fYzFTWr6kPSjZ4oL0lmPO51gOQtXiLfdKaFqqNCmeFcC6ibSmdHGNro mG6WGcSUR6R40wDbHD/zcX6J0zKBerUqVQA0T+NAubLkvsIZuRp68d1omcPeFESFqt2h AScMkcom1eTauBnY1sZrKaZ/HnjCzbakepDr4oBQ41F5gVeRcVvoEcfjCpKzBYVMNwSX Q1/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370658; x=1741975458; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qbL4jYEWkDOTQMFiCDljIBBdBkk1lhILqkIilS+kSdQ=; b=lm3YZPyiSr83LaMgv4gTvuO/iHOhncmfCMcAlVEahYt2IZEnnCHe3+Mnx8PPNOhpM0 wQheZsuG+Gi6ymbzCLcagJQ4Eo4bTUwVw/MgMvKKR6HXxcXwdwR4+JWE4AdYOYIWYySk wlF+9/cAmZruu+KLSpWTY1D1AvOD5nWqmgK4TXPZnJHdtzz2oD3enhLWs7IilpZAuqUA LOHmA3zfaqA7M4CJAqx4povK1CA+u6zw777etYQhlqRvNH+blgucSCXHZefG5R8YS5pn mkkrENnCPkC24YI+VvcQL/V5/W1AMjbtBsQ5H24cucSw3uV8m0BxkyrLkunmvM3Lx3Ia P8wQ== X-Forwarded-Encrypted: i=1; AJvYcCV6Pa6QtGV6zOJQsw8gB+37fNxg0MJRm0naeyEkLrOUXrY4LOAE/o96XZQLqqnWDSuWvtA=@vger.kernel.org X-Gm-Message-State: AOJu0YxWaHD/ivtIeyfVc21Nk/562gHJ4jxgqOXlSojuA5lXe7hFUPx7 JgNI1H+Kiph1BlWDW3Y//MDb6oEJ/qLszqKDVRTXqPPh5EEA4y3a35Eo9mb7Vy0= X-Gm-Gg: ASbGncvXYyeyApJUS6YmCfXH4KYqth5/CXuyrd2FfgCXPvNFV+iEfGO9GP+2SPIZlnf O4kykfolJbo/eTguKhMF8FhW6bqqdQjLbTN/UwFODm3N96o4GOPMfwgRTZYHTmxr5GaslRZjUIp Sobi0tGAyR+iSSfVMnpS3my6rub1XyDfp4veSwk6Ba3rwGErvhL9EQUtDgBvKkjU5zFubJChlaU XvIfD+GP76+UX7TIni1SmGaqmzyJccY0lCrgGidKPcmCtQaCzFTCmDAENdXjk4lzwJkgfTkiCMm QM/lXEwI6EJdFOBGeIKf46FsXO0A7cwihMC0ysfOLQK+iefzJNQ32vpBbjpu6BzsQHtSlbPFBgb V0MAu/BuC738MvhaHfrc= X-Google-Smtp-Source: AGHT+IEc0uflM7XSjD6JKBXbS+veYnGpRErIZqn03oBD1gdH1lamqtUvX68sdYGTF8GJTCscI5i4zw== X-Received: by 2002:a05:600c:5117:b0:43b:d12a:40e4 with SMTP id 5b1f17b1804b1-43c601cfd31mr33628725e9.17.1741370658139; Fri, 07 Mar 2025 10:04:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ce3d5a0e2sm5945365e9.12.2025.03.07.10.04.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 07/14] hw/vfio: Compile display.c once Date: Fri, 7 Mar 2025 19:03:30 +0100 Message-ID: <20250307180337.14811-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 display.c doesn't rely on target specific definitions, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index fea6dbe88cd..96e342aa8cb 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -5,7 +5,6 @@ vfio_ss.add(files( )) vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( - 'display.c', 'pci-quirks.c', 'pci.c', )) @@ -28,3 +27,6 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) +system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( + 'display.c', +)) From patchwork Fri Mar 7 18:03:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006876 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F03AF21C16A for ; Fri, 7 Mar 2025 18:04:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370667; cv=none; b=NjktzLhPJ724RaSzg+w5mUA6Z8PGUvBYwqcpnr06Wi7ZY7C70xmmT63I7q9cS3nyAFjysYzAroy7+qYF2IaLBUl576KteX5nR+fJWjMBc0NMVlVMIHCXZV+1pJpiYq/4STgNdECiZvZPhzbtePiZkKeL1gr66e1oOxVoGa/3+eM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370667; c=relaxed/simple; bh=9BvSfDYQ/noI7SgRbVbxumf1WP3NKSSn7+9fuUNEDpo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k3vb2PfqpVUYkYjD2es1Lhbh21XnzQEcJCr+yX7cudsiRfAWF2UoGKXMKbu+8RQzrgeYP+dAakka/L8NDmDcM9QCRVIDMLjKm1Sh098ozsER/kC7GL8IkbKBamvWSYf14RMsqU2J1OefLfFvT35cwMIFSyO1r2Pm4BfEUPP8GoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SA579To0; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SA579To0" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43bc31227ecso12605775e9.1 for ; Fri, 07 Mar 2025 10:04:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370664; x=1741975464; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zein7nNBqGkN3Vk6l0GAK1eJKKbYG2EwAlAfLaPQUy0=; b=SA579To0E8MGz1lr39fWJGWEnmq+ldLw9zeKadYKW1oWPAYlIGdxwunFcoWhyfaeqV NCVyL4/rpIC9TZj++xkLlMtazdry+tDuGvnfx5JqqrkAr/oL6IQDurYPV3ZgXMNTKdgN y06/nqojBd7JOBaEj7cavhf9419/Uph68g0bulKGtHaNE4OYUWDZEtS9WcHOZqJ7nKVa vHu5mecFGTRqPJi59UkIWC7+Acvfec8PEcWQBtOi181NfpE7s6LhPbo7rF73HR3mV3Xl kHLHtpk02k9at7kYHDKwLAJ7KTgiXlyOFIm8AqXaXxctDTtqNEYIFyMwSboOjcblvnHE Mo7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370664; x=1741975464; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zein7nNBqGkN3Vk6l0GAK1eJKKbYG2EwAlAfLaPQUy0=; b=WEvktLHxr/syaMMZE7Eqi7ECCZ2VCWpwjx9q08SI4FG/lZ83WwotKoU1dRAccFgne3 lLDaMaXc3vtPwlq+OwTDHTu7XUB9gSI+FpLWj0xdJtRf3wY8xHF8oQbltWqLBSyUtaZl LrIvKXtVhPxdfu7aDlgyA/wqHWK3MLdooT0HR94+lz7u/ZRF0qcxsRsAYt5yyUuznYbJ 57PJ+6O71/npyTVC6iFVxSGxwpH/JentXCdG5OrzUv1Kvu/V9taqVWJUaen9dVq8LVNX SvxnkWIdo/P2hwuxBNvU3qylsg9MK0XZJglOJS5ka+UPHeqMX9EUuN19Z0Qg56rYCxSA Bifg== X-Forwarded-Encrypted: i=1; AJvYcCXjkMyzCvmkITQpIkxSAbCBSwAPB3h4g/KX+CKaFbw+UIEi74swFH3Rfx1Sc1cLLpOSvWs=@vger.kernel.org X-Gm-Message-State: AOJu0YyW8yi8St5tk1TO92RDdYBec2ikJBXI+E/D+nWRYr4YMVY20m4Z kRXKvWWwhFI0yIiu74umQJERwkT9YNpW/kSf1WMnkiNsmmOqo0LLA4l671/rwrU= X-Gm-Gg: ASbGncvliTXMY51J5TqNPnIhHZZO/bWo9g7Bz1qG0kMRSN8O2MQGzW0FTQCKxcw5E9u ENGPVc5ZrkVLeo0jKr+3mXN8hxnhwCC4jqmsripZ5nsU5ZJvknU1i1TevAD+zW1T/EJPZ4s9FzX keXOkuGnGkUZUjgTG0ZryJI76lvWGm7UdoHdCR3TViXrP9HBJeoSlAN2W8TuZ35n6UCRJG8xnbb tV9Mnr3HxiS8anwBep6HO0eq1apFfb0UKH/6d8X51EWeCV8uWxNdoHpCw0SVgBqgjWQLx65AtSq 9o5RThtg0NxdO17RfE6C6lScMgxmQ9Uq+ECtmX59kAEm08yBfb5cnv/LPZhpf06MnokIMlJGAfS eQmGsdU7+7lq34EvnIc0= X-Google-Smtp-Source: AGHT+IFDgIDG9piVmZplAJ+ruu2TBupqlEASPykHccRCOMyucVuMcasUmrzNVAlMlKSwIHkSMaQ5UA== X-Received: by 2002:a05:600c:6d8e:b0:43b:cc3c:60ca with SMTP id 5b1f17b1804b1-43c5a631736mr27612245e9.21.1741370663562; Fri, 07 Mar 2025 10:04:23 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd8da097sm60151705e9.17.2025.03.07.10.04.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 08/14] system/kvm: Expose kvm_irqchip_[add,remove]_change_notifier() Date: Fri, 7 Mar 2025 19:03:31 +0100 Message-ID: <20250307180337.14811-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Currently kvm_irqchip_add_irqfd_notifier() and kvm_irqchip_remove_irqfd_notifier() are only declared on target specific code. There is not particular reason to, as their prototypes don't use anything target related. Move their declaration with common prototypes, and implement their stub. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- include/system/kvm.h | 8 ++++---- accel/stubs/kvm-stub.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h index ab17c09a551..75673fb794e 100644 --- a/include/system/kvm.h +++ b/include/system/kvm.h @@ -412,10 +412,6 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg); void kvm_irqchip_add_irq_route(KVMState *s, int gsi, int irqchip, int pin); -void kvm_irqchip_add_change_notifier(Notifier *n); -void kvm_irqchip_remove_change_notifier(Notifier *n); -void kvm_irqchip_change_notify(void); - struct kvm_guest_debug; struct kvm_debug_exit_arch; @@ -517,6 +513,10 @@ void kvm_irqchip_release_virq(KVMState *s, int virq); void kvm_add_routing_entry(KVMState *s, struct kvm_irq_routing_entry *entry); +void kvm_irqchip_add_change_notifier(Notifier *n); +void kvm_irqchip_remove_change_notifier(Notifier *n); +void kvm_irqchip_change_notify(void); + int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, EventNotifier *rn, int virq); int kvm_irqchip_remove_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c index ecfd7636f5f..a305b33d84d 100644 --- a/accel/stubs/kvm-stub.c +++ b/accel/stubs/kvm-stub.c @@ -83,6 +83,18 @@ void kvm_irqchip_change_notify(void) { } +int kvm_irqchip_add_irqfd_notifier(KVMState *s, EventNotifier *n, + EventNotifier *rn, qemu_irq irq) +{ + return -ENOSYS; +} + +int kvm_irqchip_remove_irqfd_notifier(KVMState *s, EventNotifier *n, + qemu_irq irq) +{ + return -ENOSYS; +} + int kvm_irqchip_add_irqfd_notifier_gsi(KVMState *s, EventNotifier *n, EventNotifier *rn, int virq) { From patchwork Fri Mar 7 18:03:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006877 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8533718FC92 for ; Fri, 7 Mar 2025 18:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370676; cv=none; b=Pz0Gn3MjN4RniNrcXPK06G/Ol4JijOS7iDayPWyUZvB9pxTsUvs5HzmaWwnF5JDOQpZDlThQHkGTTJbp1LKU/pFLD9LWVQDNu4LyYYEsu0UP+IDj2+qqS7Ktn/v49cVJBitJsJPmJwsD31kAYBNruL/V7b775ZQ5WWFT8b7NoPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370676; c=relaxed/simple; bh=kGe1bKgwmPQLXCk4SnXQubZT98PZZLS9cooDopgi2XQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uKqZORX6OZ6DNtU0wUmsdit5KAYV0rjgrGOBixzj6bc6k/n9K03XHCwkj+/iQm+bGOPd/Bjz2xx+3QtZ2DIFx/lHmlXZfHBbkFg8oLF6kWL9DA/sgZ4Px77hYl/v5SBpi5owxdE9Qb8+w5xqvDd250RxAxu1maPKl1iAv03qkAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nt/RTd7X; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nt/RTd7X" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-390f69f8083so1829244f8f.0 for ; Fri, 07 Mar 2025 10:04:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370670; x=1741975470; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qgqJlQXPaNCurtKb37o64LFzMpOza3vmaLhco3Sgch0=; b=nt/RTd7XKm4DDQwqcDTQu7/2a05dlz2N8NiEszGY9yTnvvECpOlgmZsUKypOV3Me+v 1pOUoVINzcuK08yWhreGdogZAEMAgnHI610wr9xsTjSxB1EnNB9qU5kWEAquI274RvVr xa4TgL3HBzar7+Z+tfwhcZwSGR9OGA5vXRZm30YcomPMfuMtJ/qnM+yDr9dDKSBYHWj3 zo0wVxWlbEI16h/SyafH89oiWGRYa7/xyxfEE8E73jIn/M5z1soJaXLDobJyvukwiMxu T0zTwwD5GSrhmT/4TAINyxGeoN1MnWPOv1OOaOtJas6UJ7/NO7ttaipDjG/TLrNhupFV rZKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370670; x=1741975470; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qgqJlQXPaNCurtKb37o64LFzMpOza3vmaLhco3Sgch0=; b=NVlQJ4+ihyjKPkQ+DBEshH9azBBgSwrBdkke4PHsiklHgeFiC1bMHg5548HtZmIWem u1alpRJlKz56dhAIMUSAz3D0KYB57FJ2yS9c6dF3n0ETxy/iHxPVQuHQlRtm7O/pVLbh J9NkClsHMQQwoqXJJ/PpZjOsNxiPiWWjUGQSm6Exvb4mvXWd+8XU11CLF9qDpvaDqN3W 7j/WDUOsrFf0Cg/9KyZF1xolJCD8iAU0CD9zBkcfduLs1iXqTvmi7E+QpCpKLBLmaL5i LOpyeIKIGJVq7KIfhVxjxugmNXGRrIQt766LPgzKua29zklv8xd32rY4OT0L5Sns9Ept hTAQ== X-Forwarded-Encrypted: i=1; AJvYcCUugOsF1L8WICUpPNvLyHNqJnJTrX8Gbnsz6FkCH0h9GRq37RRkfAvVvHq/B4R3/6qS59Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxXknfwn3dnLiOq7yZAyWNX++wIO0EjovbfJTK1FaikIVdYB+c9 e4dT7UH8qbu7pD0xWklMPqtrFiq/vBbO8CbBl2nlKY6ODBpGQsZP3DKyOVRkOrw= X-Gm-Gg: ASbGnctHUt9f+zlpitfctEWCfvm4gt/yad84X2CVmMZLRZaVYd0ijBficq+SiMACV97 1jsJ2dBODWi5u1A+AS8Xxn6/S5bDQuvPAfTOjGm8HdjLVvcArv3vkk5lk84ifPDObPsmBMky4Jf xPIAzCYT6EvXTyf0NaJus13EMXvsHTcxctrkYFJly1gL2vvP3zAJFmiW23YCbI+wJjBJu+nm6C0 o252g0gpGos+ZQMNH5fZWmpPEJkBG+ZFIFkKtkIt106ZbY26solxvSI+bUkF9Hm3aLdn4ju1Hl2 otBXRchzkFTaFL8VAw2NAQQbin/01hAiKg207sflHSW2O+QiKKo88V6GWpMLt2SrbOvEq3qQJr0 ModQjfz9oKOjfKbVe/YE= X-Google-Smtp-Source: AGHT+IG86wo6VjNTiB+dsP2CrUpAEcNOBKsuaBqrTPoI1r5vkBrwnV0jTDl16znAZrCu0SDGfxgSlA== X-Received: by 2002:a5d:64a4:0:b0:390:fbdd:994d with SMTP id ffacd0b85a97d-39132d45d52mr2858940f8f.27.1741370669687; Fri, 07 Mar 2025 10:04:29 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c015a29sm5961965f8f.42.2025.03.07.10.04.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 09/14] hw/vfio/pci: Convert CONFIG_KVM check to runtime one Date: Fri, 7 Mar 2025 19:03:32 +0100 Message-ID: <20250307180337.14811-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use the runtime kvm_enabled() helper to check whether KVM is available or not. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Cédric Le Goater --- hw/vfio/pci.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index fdbc15885d4..9872884ff8a 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -118,8 +118,13 @@ static void vfio_intx_eoi(VFIODevice *vbasedev) static bool vfio_intx_enable_kvm(VFIOPCIDevice *vdev, Error **errp) { -#ifdef CONFIG_KVM - int irq_fd = event_notifier_get_fd(&vdev->intx.interrupt); + int irq_fd; + + if (!kvm_enabled()) { + return true; + } + + irq_fd = event_notifier_get_fd(&vdev->intx.interrupt); if (vdev->no_kvm_intx || !kvm_irqfds_enabled() || vdev->intx.route.mode != PCI_INTX_ENABLED || @@ -171,16 +176,13 @@ fail_irqfd: fail: qemu_set_fd_handler(irq_fd, vfio_intx_interrupt, NULL, vdev); vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); + return false; -#else - return true; -#endif } static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) { -#ifdef CONFIG_KVM - if (!vdev->intx.kvm_accel) { + if (!kvm_enabled() || !vdev->intx.kvm_accel) { return; } @@ -211,7 +213,6 @@ static void vfio_intx_disable_kvm(VFIOPCIDevice *vdev) vfio_unmask_single_irqindex(&vdev->vbasedev, VFIO_PCI_INTX_IRQ_INDEX); trace_vfio_intx_disable_kvm(vdev->vbasedev.name); -#endif } static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route) @@ -278,7 +279,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp) vdev->intx.pin = pin - 1; /* Pin A (1) -> irq[0] */ pci_config_set_interrupt_pin(vdev->pdev.config, pin); -#ifdef CONFIG_KVM /* * Only conditional to avoid generating error messages on platforms * where we won't actually use the result anyway. @@ -287,7 +287,6 @@ static bool vfio_intx_enable(VFIOPCIDevice *vdev, Error **errp) vdev->intx.route = pci_device_route_intx_to_irq(&vdev->pdev, vdev->intx.pin); } -#endif ret = event_notifier_init(&vdev->intx.interrupt, 0); if (ret) { From patchwork Fri Mar 7 18:03:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006878 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F055923F29C for ; Fri, 7 Mar 2025 18:04:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370678; cv=none; b=qI9A1VhizhNpQ3KMtzq7YeRoDUad8yBJOguO4OxjK7eexmFDftcjQqCw4lDWlMlVBN/wP3uNPHt4wLoQRFJeTY3DmaPZLFXWmf/E0c+z0thlAXMmUGhg/theIptcFKNvbfmj9Q6lgb96g3+764L9yXVHoCrpXObbQySDNQeJ/yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370678; c=relaxed/simple; bh=U6hkGzDkkh1f4TzbGH4D+UA1K3GyDuZ//h7KhIjCPPE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=biGmWNRMDZ2O0bbQnMWT1oeN3KD9mfDRGZW9YimAINgU3TvQBAh41rprfSUIs0tm1IOZoHVymWHbySDpxAzcX0ThwTQLOvcZjeRHVXXQJomQKjHkitzQtfp9PV5Rsis/nhHbZ0y13rCFAGFrzbtkhvISWmfr7VDycFg8YE4jH90= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZIQM7Tfg; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZIQM7Tfg" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43bb6b0b898so18301285e9.1 for ; Fri, 07 Mar 2025 10:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370675; x=1741975475; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jwX1K0+iQl31BRmPX8xi9KD5c4T56nkQjSQYXLzdF0A=; b=ZIQM7TfgQ0/DTfPkV2sov5pWjpUMXDHM9r3VXNYOpcZKnjMkROhB/5QJXpWeHrhKec z6RliL00FNc2fkY00uOgWXtq80Y4FA2VAwrY9Iu55vKEM/MyCbh/tnqCCPZ8S56esOLo xQZzNfXk7WE38wmmVwE4aYfK8cC0m3E85Xi2zcnIijAA3/i9O/9KLRf5Nq7mw6pDB0je 6O4mJEcEU1MAK7v2SnS4RrH1y/4XIxO8fLN/yhYa9Y+S9lh3Iev5Qc0AS8EcRmymtXUk Mddd4Tu9Nt3sDO0ezIsaYklCTcuQ7abHCoxldH85vuZygDKrfYBMymbt4t6n/K9WS1Dz dRYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370675; x=1741975475; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jwX1K0+iQl31BRmPX8xi9KD5c4T56nkQjSQYXLzdF0A=; b=Jez5+rYvmhKv2GENPwkhuWa4Aq+TvJCAFf4IaGjqRV809IGzCFKhY6UVNC4tuucKpS 7yrhybR+6XdmuBC4F+WW+PykXXkmO1icv/HDmFCaNuoeF8n0BxapxMgeQsC+Di85mnIP bIgh9Ii2FLlwONMr00fn1hAwdBNwmXDIp2WDzbwSfR1To45b/HazlFCZ6jJxOG24idLg 6h7OJopCB4DsdefLdPscbWH1Y5r+7wEmlaHhELyyCGkcJgLPVgCU+WMIsd1kQ4WC/8eV 7oFBcLQ+u5tNG1ydzcDkOmJurKkGKPUIdiQLAncSk5/Sc41I1+10XAVCjpJzgcPPpJ0h voww== X-Forwarded-Encrypted: i=1; AJvYcCUKr1lKs/DqPH4uxU+1Qr2jG4FPny4iTl5KL1VSVYRdmmGsaLKtXTr0NxJ07hSATHkShDA=@vger.kernel.org X-Gm-Message-State: AOJu0Ywe16RfzZyzAf4qDeKRAUFtwdlmGGO3igrLCMlJw7AzxPm0IvWJ bfAXLQZEDnQp0K25mbymtIdZlZvPV6yab8sz6ZkCa1wTO/vED3kUSi+FTYnvfl0= X-Gm-Gg: ASbGncuFGv4cqVhSPmqWn8PCmlZCDl+Bam8gSq3vmVgoElfwzzC5MNH5WFBIL/Vk3Jy D2o0GrgUwdySoD+BRCIfjJg3SPYibxWwowjNAYOKhhUVrhXMWtrTk1VYB2ewcCAn0vM5ZuMB5nT ls6VB5E+2Y2SEwtrzpjVdSfObtC7PGojzwHFcIf4/EmOXtkYW92hh8BkLEAK+cVBKhR15ZLLk6P qi0IOnjQdst2jARVoJskz8HvFNmgiY86KrQ35cm1HgNq2zwvKdxJojT2XZViedr3C9+eNtHdyhx v0I4AEpClaDVH8+uLPj3JF/eB35DV/5LWRdLCrntgLOATXvYq1lUnuIYNHuoL63Zd048P84zu31 Un5vejzyxk5PCLpfqvDI= X-Google-Smtp-Source: AGHT+IFd2dAhiRB8kpwGRBj8I24YTq49QXdG4iwSMQDOtTBB781rulRfrC60gif1x5YVtYtrXppgDw== X-Received: by 2002:a05:600c:350a:b0:439:86fb:7326 with SMTP id 5b1f17b1804b1-43c602082a0mr29865065e9.22.1741370675155; Fri, 07 Mar 2025 10:04:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd8db6c7sm58089865e9.22.2025.03.07.10.04.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 10/14] system/iommufd: Introduce iommufd_builtin() helper Date: Fri, 7 Mar 2025 19:03:33 +0100 Message-ID: <20250307180337.14811-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 iommufd_builtin() can be used to check at runtime whether the IOMMUFD feature is built in a qemu-system binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- docs/devel/vfio-iommufd.rst | 2 +- include/system/iommufd.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/devel/vfio-iommufd.rst b/docs/devel/vfio-iommufd.rst index 3d1c11f175e..08882094eee 100644 --- a/docs/devel/vfio-iommufd.rst +++ b/docs/devel/vfio-iommufd.rst @@ -88,7 +88,7 @@ Step 2: configure QEMU ---------------------- Interactions with the ``/dev/iommu`` are abstracted by a new iommufd -object (compiled in with the ``CONFIG_IOMMUFD`` option). +object (which availability can be checked at runtime using ``iommufd_builtin()``). Any QEMU device (e.g. VFIO device) wishing to use ``/dev/iommu`` must be linked with an iommufd object. It gets a new optional property diff --git a/include/system/iommufd.h b/include/system/iommufd.h index cbab75bfbf6..ce459254025 100644 --- a/include/system/iommufd.h +++ b/include/system/iommufd.h @@ -63,4 +63,12 @@ bool iommufd_backend_get_dirty_bitmap(IOMMUFDBackend *be, uint32_t hwpt_id, Error **errp); #define TYPE_HOST_IOMMU_DEVICE_IOMMUFD TYPE_HOST_IOMMU_DEVICE "-iommufd" + +static inline bool iommufd_builtin(void) +{ + bool ambig = false; + + return object_resolve_path_type("", TYPE_IOMMUFD_BACKEND, &ambig) || ambig; +} + #endif From patchwork Fri Mar 7 18:03:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006879 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8115223E242 for ; Fri, 7 Mar 2025 18:04:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370684; cv=none; b=cWi+mBmgiZG7niOfR9NwQK/3DGn2seyOxWwSO/k3tNZFJlPDhM2rERrEtbHvT+HKceHQ8MWsYZ7TKga0/YSLEDGEnHJoxSpMkKk8tKIMN9ROTnOTDfSgrqj8KSVH9IqAns7DI8HWRMiHDkpY9zEAZFnDTqd7Ug0a3sXUTenINiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370684; c=relaxed/simple; bh=IgvrL0x3pBRxvbI5eiXPj1cGFAic9oG9Jxjne+aCAmw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n6HHKVWWeQsxYU1ty8AUawCO3TkkF1oViBaBB9ykHmeZYme6EWQoPw/GuLDuua0a4SQ2rxFzld15+dJSlKDlQ8FYosU5UARFx/G8IIoYUV7YMarMT/sX5ZZo0P4fvEb+BOdLpm3LJcxFPzbSa2F9cqXjeLWXdwIBI+nB2xT3cuM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=v3+0hoY5; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="v3+0hoY5" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-390e702d481so1168652f8f.1 for ; Fri, 07 Mar 2025 10:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370681; x=1741975481; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=otdB0Dz5nRAMnlnyGAk6/GxyQibbHb9x6DFoSBTI7l0=; b=v3+0hoY58BeKLtWAiHrGtiXrsYAT/BbcS4HfQ0DY8gRBKZqZP7WQ0h2h2ExlHgYXAD a8k1/773eDdkI5JTDrep34WXdIByDp8H/V9RrSZyTeUSDrwMjF577WYtl1sgFfUwVVwK gNUEX0W4Qi31sQWu3s2cQrGFFLbcz1xT4kdfsYgclo6J8tAEj1xpaSgALPdRn28mhEkY 6DNeA2xgXYq5Uj5ziSsXeS18AyJfWAQV7tXXDkj4ciWBhCfRVxaXX5Q9uxU9j7SXw/QY ZbIbutyEroSrTuhWlgRrAldl0YQEiSgFjiI1fx9JwSmUKAQ8K61457vbLtedi7anTpOG xJrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370681; x=1741975481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=otdB0Dz5nRAMnlnyGAk6/GxyQibbHb9x6DFoSBTI7l0=; b=Q4m8JcBMRNg9fO3Wh3fkf6SDigUXzoDsclm4L+KEYmlVBFtMykq97qtjucom9VEAz9 fm/a+twrlK0dszNRNi/1Jroa84YQYx8/x78cOU2lQmZPxNPxHL5KfFcyCxpeqbU2lMh2 Od2RgY/3ZpNoRO3kgrOl21Q+3bx1IKXWarPw8yyy1+KjbN209l2WOAtdP8QSAWnMPoX6 UTlyY40VX7JG1ZTtF2SMYf8NJYvscvDJEsEDgV/v0noRhhefGbvKxz+gW6FwbfyXPEy+ qb1TWcxjw3h7Cl717DuDk5o+uHS/eXTOvdBmwEndLIjw8ypWf2EijkC4LZEOtx3s7PF7 IGYw== X-Forwarded-Encrypted: i=1; AJvYcCU+rx68VdptHMOqeRPNvpGk4Cn1h5pePq+INt4nwauyx5xOArBpkAQEEN0/VXHn2A4EXxk=@vger.kernel.org X-Gm-Message-State: AOJu0YxNm/AQ2ogIDpLvAtSIA8OqSYbaL1rps3ap6DoHq9YPhpHcVrIA xKIDTv6oFeBU403ijC0oD0CN7bVOs8qlbVulCkzsfTLyX+GwrglDsRU0/7gDY4U= X-Gm-Gg: ASbGncupsmuhuROW59M5NMH8Nw/qpyvVEYlWtwDQ3M5gyS05bYuez7HAFhq1jdXf769 omM1kOUfXNq+5jVngmI5cU153abpHsWj9Si1fXbA0P9IbEx8XAouUaNEyEA+xH/PLLS8gc/UYQZ xIQIRLdbnoilxAoKKRjjW6grajEqILnJDGdURd5jbLomZEoJjAn9CnGUSVMtzzKbuSxofZ2Vc+e pEZ7nBnmU9L2VOQ7wGFiLJKTpnN/VEaDJyNZNA+GLymAOetehj8URv7M6bYosfpjPLhtuFsLRuz 3Xv5MB3l65OT0HKU+dG1+svSPJPKjPsE5wTFPZlurcz9agEW1LgeC+jkfYx4CFLL8z1dn0Mekg4 78rJ9D2f+kef+UqTVx0k= X-Google-Smtp-Source: AGHT+IGoXSQiYR+Znceq9QhV/DA24dcXDFRGzeqHnWry6oSbt2EZw73v5ZrTBEMEOa+RqbZY3pfWWQ== X-Received: by 2002:a05:6000:4112:b0:391:d52:d042 with SMTP id ffacd0b85a97d-39132d883f3mr2410120f8f.32.1741370680523; Fri, 07 Mar 2025 10:04:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd8b0425sm58830765e9.3.2025.03.07.10.04.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 11/14] hw/vfio/pci: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:34 +0100 Message-ID: <20250307180337.14811-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/vfio/pci.c | 38 ++++++++++++++++++-------------------- hw/vfio/meson.build | 2 +- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 9872884ff8a..e83252766d1 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -19,7 +19,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include @@ -2973,11 +2972,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) if (!(~vdev->host.domain || ~vdev->host.bus || ~vdev->host.slot || ~vdev->host.function)) { error_setg(errp, "No provided host device"); - error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F " -#ifdef CONFIG_IOMMUFD - "or -device vfio-pci,fd=DEVICE_FD " -#endif - "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n"); + error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F %s" + "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n", + iommufd_builtin() + ? "or -device vfio-pci,fd=DEVICE_FD " : ""); return; } vbasedev->sysfsdev = @@ -3412,19 +3410,18 @@ static const Property vfio_pci_dev_properties[] = { qdev_prop_nv_gpudirect_clique, uint8_t), DEFINE_PROP_OFF_AUTO_PCIBAR("x-msix-relocation", VFIOPCIDevice, msix_relo, OFF_AUTO_PCIBAR_OFF), -#ifdef CONFIG_IOMMUFD - DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd, - TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif DEFINE_PROP_BOOL("skip-vsc-check", VFIOPCIDevice, skip_vsc_check, true), }; -#ifdef CONFIG_IOMMUFD +static const Property vfio_pci_dev_iommufd_properties[] = { + DEFINE_PROP_LINK("iommufd", VFIOPCIDevice, vbasedev.iommufd, + TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), +}; + static void vfio_pci_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_PCI(obj)->vbasedev, str, errp); } -#endif static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) { @@ -3433,9 +3430,10 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) device_class_set_legacy_reset(dc, vfio_pci_reset); device_class_set_props(dc, vfio_pci_dev_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_pci_dev_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_pci_set_fd); + } dc->desc = "VFIO-based PCI device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); pdc->realize = vfio_realize; @@ -3540,11 +3538,11 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data) "vf-token", "Specify UUID VF token. Required for VF when PF is owned " "by another VFIO driver"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } object_class_property_set_description(klass, /* 9.1 */ "x-device-dirty-page-tracking", "Disable device dirty page tracking and use " diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 96e342aa8cb..9a004992c11 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -6,7 +6,6 @@ vfio_ss.add(files( vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', - 'pci.c', )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) @@ -29,4 +28,5 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( )) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', + 'pci.c', )) From patchwork Fri Mar 7 18:03:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006880 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3117421C16A for ; Fri, 7 Mar 2025 18:04:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370690; cv=none; b=hdNkuj+xcsQtTNrcRyObCPYKJLki5RTTp8VdpG3ZXSo1S4jI1CbKb+aCZinnPrjAKsUOVJsBPWv+8uzQ9kG1SSnEiInu4EQVJqws6AGFUYPLeVw/x+yMgDwXJBPmrq2XLHgWQjydxIZhxr+deU8RhEklydlOeP+0R/cvArWNWYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370690; c=relaxed/simple; bh=mfjbKx9AjdlJqKhst2ETEG2d/D5fFQVg0pba5es4eHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IKRpHfQ18o5urnQHbA55AjVklxFKk9zn9TfzxoDXMbCijGycxt7Y4wXStaYnrCaDWpgZgJ4CxJ2A1jKww/2va9Frtvv7BPX2VqDpLZVnOELbS6Fk9cgVau2hO6gQCL1ECFCJFJmUqqTJ3qZ0IYo0D9xjU5im4sIuAZB66AdykR0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=kB5D2Pjv; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kB5D2Pjv" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1126563f8f.0 for ; Fri, 07 Mar 2025 10:04:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370686; x=1741975486; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g0+sj+5fZPDlRh8EKfyzOVB2Z+MoNxqNRQg5EoTr07c=; b=kB5D2PjvGIuKg4czJSP8DSNi6EOw0gVBLrQv5XuudlktZJY592ISPSZuDE3zHL0h4D enu1O16zX3WtdV4L2OBgHBVbRE+CcpapSHTC00D1UumguHt2sPLYk6kx21Sixxz0WiPz jnWJdgQ282bvbeXnYt+qG9GzQYUyymefDHpOJe6NV1d5fLrFnBueIYa9U0+5HWUpJSwE za1lQT25rhZ6n6Umm04eQzLir04DixoL9xIfUnnUNubLqQ34kQbijLRA4ZqZUUKC/prB h94jLnHKmkbOPRfwNwuAy7bywYNuhNSlQHZ7DHQjDmp1dOw3Zrx3G0L+PxUOE1TRgrPK w1bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370686; x=1741975486; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g0+sj+5fZPDlRh8EKfyzOVB2Z+MoNxqNRQg5EoTr07c=; b=wUkD8wCxsGnwo8SWEfUqJ1+WMnVcXfoFZNn5y6oj7HGCAHW1HaawnwXstLrj5FUNNy vvUC1WgQRlfA1EJdMrkp5BYbB3QXinQvY3XzX2+NXmmdwDn4n0M0MwfW5M2MZEvff9IA 3MmqbaYSfumKTEfrckvQ9Kr9bxAoWWys5SM2SM0k5EDA1sP/6FDQQrw3IRabbxh+2N+l mXSaC5mgLp0h6HTBZcVREDlBKEeFJYKt4XxqcGECBklGCu0gY+HJ4wJFsoJ0QsPvXITK LxjETFfEF+zx/+OmjsIJfQDD4MPk/n13scedlVVJsPuCXqZSGdF3pC7LaHukT4NyaEM1 ebRw== X-Forwarded-Encrypted: i=1; AJvYcCUDYSkO7HSPCXis8wGTDe2XVLTxE7++SKGzJWz7Uzib8jU9QMBs/9eHveKRgtzM8kERl0g=@vger.kernel.org X-Gm-Message-State: AOJu0YzdJBZGIjgMtfoNd1OiVDRXG7lnYaKcyJmhWwnf9ZW8lHdoZcKI rfHgzvDQjXR7zyWGUOzMdks/9wuR0JQfPXM63IRfbUUiIVTivoxYinuYVD7IbC8= X-Gm-Gg: ASbGncu7BZK+qfavdtMjW3SuNiAv4RwFMSuPLBVDlHKLdGI2I+D+J4dyBGdVmLaeX6g QPsujvTqn8KeXWoocR+QI4Qh7IzbWmsh0jsZ1jc7ofRmoOLdfm77k+AiHkRM5+5s9MRj2MVx2iC S0+ipFY78o/XG834Rt98TioxkAXuGRXUsOd0Dnx0f7N8e05S2tmtDjnL43B09jJPDvuRH2UTrSJ eKrtqqraBUUDPkpm7dBoTJxuLbYEvsufG+NTTVAm4S4LtQtdx8kJ0074bPf+VUnpaR/cy1yMOYK RrSeTK5EZC2F6aoEAxcvj2QHpQG6LJyv5EPlAYM89toYz1GHlDf9EGPwoBxwb2PHZxyFb8dVTBo kc6NFnZlgYrr5IRnsGNE= X-Google-Smtp-Source: AGHT+IF97fayJY/yW6R5BSvdDohNcmjJuG0p61HA9ekjFXsJOXr24N1zzjiAZ7Wbh8GXE9bLdxWyzw== X-Received: by 2002:a05:6000:402b:b0:38d:e401:fd61 with SMTP id ffacd0b85a97d-39132db746amr2784656f8f.49.1741370686062; Fri, 07 Mar 2025 10:04:46 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bdd8b046dsm58414135e9.5.2025.03.07.10.04.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 12/14] hw/vfio/ap: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:35 +0100 Message-ID: <20250307180337.14811-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- target/s390x/kvm/kvm_s390x.h | 2 +- hw/vfio/ap.c | 27 +++++++++++++-------------- hw/vfio/meson.build | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/target/s390x/kvm/kvm_s390x.h b/target/s390x/kvm/kvm_s390x.h index 649dae5948a..7b1cce3e60d 100644 --- a/target/s390x/kvm/kvm_s390x.h +++ b/target/s390x/kvm/kvm_s390x.h @@ -10,7 +10,7 @@ #ifndef KVM_S390X_H #define KVM_S390X_H -#include "cpu-qom.h" +#include "target/s390x/cpu-qom.h" struct kvm_s390_irq; diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index c7ab4ff57ad..832b98532ea 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -11,7 +11,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include "qapi/error.h" @@ -24,7 +23,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "qemu/config-file.h" -#include "kvm/kvm_s390x.h" +#include "target/s390x/kvm/kvm_s390x.h" #include "migration/vmstate.h" #include "hw/qdev-properties.h" #include "hw/s390x/ap-bridge.h" @@ -193,10 +192,11 @@ static void vfio_ap_unrealize(DeviceState *dev) static const Property vfio_ap_properties[] = { DEFINE_PROP_STRING("sysfsdev", VFIOAPDevice, vdev.sysfsdev), -#ifdef CONFIG_IOMMUFD +}; + +static const Property vfio_ap_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOAPDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif }; static void vfio_ap_reset(DeviceState *dev) @@ -234,21 +234,20 @@ static void vfio_ap_instance_init(Object *obj) vbasedev->mdev = true; } -#ifdef CONFIG_IOMMUFD static void vfio_ap_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_AP_DEVICE(obj)->vdev, str, errp); } -#endif static void vfio_ap_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); device_class_set_props(dc, vfio_ap_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_ap_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_ap_set_fd); + } dc->vmsd = &vfio_ap_vmstate; dc->desc = "VFIO-based AP device assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -261,11 +260,11 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 3.1 */ "sysfsdev", "Host sysfs path of assigned device"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } } static const TypeInfo vfio_ap_info = { diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 9a004992c11..510ebe6d720 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -9,7 +9,6 @@ vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( )) vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) -vfio_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: 'CONFIG_VFIO', if_true: files( system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) +system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c', From patchwork Fri Mar 7 18:03:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006881 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3408621C16A for ; Fri, 7 Mar 2025 18:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370696; cv=none; b=NK0zccWc1kWCcfzxoKJOggG1XDlgbkCVpbpyg/Js1KkxIJF9Sqao3I2itS3VA8fNHPEAFBy1g3ZswZv4bbT6hHAfSfupmqcN8AXDjX7fuR7rWruVIEUR0DsBbi/kNGQwudpExvr55ejKRMu52/7wSJP/y5mlj7GQhnA5Q/c8ju0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370696; c=relaxed/simple; bh=PRENhG8Qgi+x3e0hUqFmPUauD6MCuNXlKrO670tBoWU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aKNiBP4PuJW5i0CbmcuT5e+DziiGoiXQnZQdUaKx7ZnJ966oDQWqsEr5dCYzZwTXFU4qTYbX/t61CwiZewls1HUkLrKEscAlRIsgJCMTc/d05OI371S2xXuGB+fVhWfLp3TFACB/ybTi977/ffMS7/a2YX4G/lBPQ0q3vEdzjpY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VcTqM9Bm; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VcTqM9Bm" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4393dc02b78so13617245e9.3 for ; Fri, 07 Mar 2025 10:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370692; x=1741975492; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9PjjtPvH9M8tF9GLUHgsFKP3TRPxe4Etbg8NvJxAgPo=; b=VcTqM9BmyIeMn/FmsgHNIcy+yeyH4sHnZScuKT7HG+eo/OJl3Z/70KusLZYaX3/I2f 9GntPYlxZjCjyQ3SfCuBYqzkaEB79jbgESJPVDD24nusp9q/if7x4smkQ84AJUwtwEYb JIVWEQh52owdD8Y+jTmuaj/lHUiI43eJ0nhhukFY89t++RHgA9Fz7g1fRngr0m5V1Ix6 6pjT5qhtnhEGL/vH08GfoTBuk/7LUYWnt7V64QGr/FX1if0+6prBW7zxJ1LXpbMQrOT3 4KyCgDnkOYR2m7uELr5sd/q8UyB93xhP2Sg5eF4diXK2mdv0Y/1qCDjNcC0L7fOW6Hvp dQYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370692; x=1741975492; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9PjjtPvH9M8tF9GLUHgsFKP3TRPxe4Etbg8NvJxAgPo=; b=Dm0TcFK51DahOo+iqIle6fKj+d5JZxYUY4q1XBJEpH1LX+v2pyYts5Fgljyzfh8b4N rPeIlnPXnMG9ko/05v4F4LfKYURk4n91M9QkvmImp30c3sbSyLiuIwiIV5Fyef0DeN2X Na9iEoB8/Y/YEC20huhtxb7dqEwBaHMWz7VzfoKqrtv3zjl0L6V2NvUiPICbHeDGSMN6 RhDWlS3xGX9k+ABV+Ur3KuCC/gpDiR1Vuui76qIn/2gYN8eO4mk4GipRoxk3n1s92hIz 1nsBqnCJA8LB1jEuY4Qwvkca9TGuW1J6IFWMAUX+ORWKXw+uzEBzjtjRUBpFlXtwPrjm EMpg== X-Forwarded-Encrypted: i=1; AJvYcCW4DVfCjQk2rZlKXli1CpaMwiIjRZj0Dnscq9SWo+FeEr073tV3S8ayi01M4E9Y8T4gzXk=@vger.kernel.org X-Gm-Message-State: AOJu0Yyc9KOmQrcUq8OfGa8FR1hdDqnSdY9Iean6X6uny0Uk/0zXP7mv Z/h0QI7Ov9CbxRmJhQeRQB0vhNCHtXmf2E8BOcV+pAqTdhkD69BQ4F1Qtfh8mWs= X-Gm-Gg: ASbGncvOc31CO+xkn4QCoe4QC/Ekqk3+EWxr3Z9e3hBxeLocCl9UrIjf4koCkJTK0Tr QKPZ+rBRPzz3p9AUdykR3Czv/hmC9hNhXq+cZpG1bLvFDRNkIg7id/8pjNsl/fW+uszxx+lFZoJ U0xt89aO0dtVKyahcvtZ7b5n6SRl8EW869SlI3wZwcdPpiK0XQ2vftyfb7+GASzQJh/m7c3+9wn K93deSXM5dh0Rw8J4z9qrNbL/WmTiOSbuONTYPLKkbc/al0GFQGKScIOko7UbFI2WmHg+9otcoq JW3Xyxe22VXWhjYvCS9MAznznx2kStN7WmaaB1lLbCEIuRPalGwKmXRBtgody86d6R0Z1VJR1Ew /Rp7cW7hNbKqp4DdzleM= X-Google-Smtp-Source: AGHT+IH9V77Jk8RO698QbiKv+F+gtIcqVl1iG13X0gUKZUfwL0hC3/rmYcr31Z4Epankft7r7WAhHw== X-Received: by 2002:a05:600c:5108:b0:43b:c0fa:f9dd with SMTP id 5b1f17b1804b1-43c5c6a4137mr27636815e9.25.1741370692182; Fri, 07 Mar 2025 10:04:52 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd435c9c7sm86670675e9.38.2025.03.07.10.04.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 13/14] hw/vfio/ccw: Check CONFIG_IOMMUFD at runtime using iommufd_builtin() Date: Fri, 7 Mar 2025 19:03:36 +0100 Message-ID: <20250307180337.14811-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/vfio/ccw.c | 27 +++++++++++++-------------- hw/vfio/meson.build | 2 +- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index e5e0d9e3e7e..84d1437a568 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -15,7 +15,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include #include #include @@ -650,11 +649,12 @@ static void vfio_ccw_unrealize(DeviceState *dev) static const Property vfio_ccw_properties[] = { DEFINE_PROP_STRING("sysfsdev", VFIOCCWDevice, vdev.sysfsdev), DEFINE_PROP_BOOL("force-orb-pfch", VFIOCCWDevice, force_orb_pfch, false), -#ifdef CONFIG_IOMMUFD + DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), +}; + +static const Property vfio_ccw_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOCCWDevice, vdev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif - DEFINE_PROP_CCW_LOADPARM("loadparm", CcwDevice, loadparm), }; static const VMStateDescription vfio_ccw_vmstate = { @@ -682,12 +682,10 @@ static void vfio_ccw_instance_init(Object *obj) DEVICE(vcdev), true); } -#ifdef CONFIG_IOMMUFD static void vfio_ccw_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_CCW(obj)->vdev, str, errp); } -#endif static void vfio_ccw_class_init(ObjectClass *klass, void *data) { @@ -695,9 +693,10 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data) S390CCWDeviceClass *cdc = S390_CCW_DEVICE_CLASS(klass); device_class_set_props(dc, vfio_ccw_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_ccw_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_ccw_set_fd); + } dc->vmsd = &vfio_ccw_vmstate; dc->desc = "VFIO-based subchannel assignment"; set_bit(DEVICE_CATEGORY_MISC, dc->categories); @@ -716,11 +715,11 @@ static void vfio_ccw_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 3.0 */ "force-orb-pfch", "Force unlimited prefetch"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } object_class_property_set_description(klass, /* 9.2 */ "loadparm", "Define which devices that can be used for booting"); diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index 510ebe6d720..bd6e1d999e4 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', )) -vfio_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( 'iommufd.c', )) system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) +system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c', From patchwork Fri Mar 7 18:03:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 14006882 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 442EA21C16A for ; Fri, 7 Mar 2025 18:04:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370701; cv=none; b=cd2Av7ZqPeBDYe+vKvKddKGCy9X+r5to4OFsjDKBmklg4OESfiSatvaSZICqdFZCqql2O4fopcQe7QYM6bJ9EJD9PKN52t9wfDdq07QHmevviIgng14vqwu/84AFwL9b+TDlFOLmp9+0ov8feRCBO5kyinD7NwxWepauvMsgZT8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741370701; c=relaxed/simple; bh=FLHCLIM0b/6kSuMtYeSVqyvlLRhLbxGSard/uvGGcU4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CCqwJHd/1g9K0soDBy8lEnWe3OCw6iUZzc9MftZg8bqikUwlSZm4oyVC1r2lBovQ0Q2itrTZr5Xe/PipSwNdc9T7j9V0U4PZSffb5fIu47PfqojSWTn49dGlKNNWkEIPetqyQ+VhG9NHwu/2nyv6HecQwMvRSECcgcnMSdnx2bw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=yE+Kd8r5; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yE+Kd8r5" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-43bcb1a9890so21414555e9.0 for ; Fri, 07 Mar 2025 10:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741370697; x=1741975497; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=agcsT+LijTsdk7Aq19MciJhNx25N7TH6CXZbFxHQbqw=; b=yE+Kd8r58HbL+hicnfIoWppBM3KlrIzHhjXrEnwvxRfOuoho9RI2wDurc0QMgLS28Q GuN+gKdeeQNTHifGhYS2RoDMFLZu2sHfeFWkc1a6WqSAGpsnWzzn7tUFnCewBmJiF7xI OUgDDLKh+hX6eMvlnkarQ/pY9SVjx9Js6qUFbIoXqzbWz9h/JMBb5f/H1KfFt5TSH+DB aQYWTNMfOZa4oZ2czQjbcM3dOGqR226EPFDNapMmzMQGwdxBHXar40eSE0IYmd9t+uX8 wPQWL3B323m0XCOqEgxVOrO+S4v/ivTCapsRwGxb0cXRNzdJTfQo1zaiKXM7Os1eJTLQ Wg+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741370697; x=1741975497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=agcsT+LijTsdk7Aq19MciJhNx25N7TH6CXZbFxHQbqw=; b=W7Uke9450x0QhWQ2Se+y+5TCcGD0jJJmxEFSW153HoZpASsCQgZOqu7WWVLzU6EAat Ji/d6EIyEu+8VlrKDmkBMj/twtzYQE23U03EOVzm+qIItza7VC+YpuDNHbqfSnhtqUAd lmPBc6hMx8oc4VVR+PCsCTl3PR6b7m6D7avtCZ/xhlbdLG3bKHrxM3uLoXCOo0M1MLUX ibEcr9fQjlK1O4iBgR99aBgFcnw6upJnk2hsVw26lKt9lANsWH3EbN6yMHJ2nnk18cep H1JBzj0WeBHeFrMtJ4BtPScIgBTAsQ1FKqp5E+hS6a5oM5RvmmrQ7Fc2v225zUObVRLd 7jVg== X-Forwarded-Encrypted: i=1; AJvYcCWH04FVQNmrvzuWfZJJrVy+m/30HWx73X0lgMiWt1EU8hw+Us46wyWqdl98gQuf+5m1nsQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywml+69Gi40OsaP5x+FDwAXtkLKEaPl0oXg6EkPLOxGzcuF1wnH NGS14dDoGpDPwD5V4TIGeFJ7iX5rZKSOFGbWwVxIhfJAinE5KXB9g5fLLuffOnk= X-Gm-Gg: ASbGncvsoU1rtoWr/2WvRvXhSPxZQB2MN63503EChOiozJJvPP+nKRsuWZ9D6UOyGUA wb/hCQ8n5Q77rXAN6jQ7N6FoXszKwyAzToeRqddp6RpRX985Gowq2lbg8N/4pew6ciQi450RjJr 9/lfo0sKavlFaATkcUtXD37/8q2K/u8kQfnz6RAFjvdOAIngLJTRrSDzepd2ZgMQBYG8CTm5wes iHgibUi729jonSUgNNLOYZFVC1p+CHCnUxrPZq2ILDNKKYQ4437MS60jNKi0EpC6j3uOVDLOM3a dWtu7uXFJienkeYmeFnbtH6DGTw5YoJjrh+Vq5RMuboRqW6d+MFcOVjM8+w5yB3uhPXa9jq3IaZ teXrcDYu/vXKPMmI27ZI= X-Google-Smtp-Source: AGHT+IE+YfUTsyezmJk1O/V7rJmU3VYke7MWbvI0vhhGZxFwIjiesECECfkOBaEgpCq1WPQAC5PfkA== X-Received: by 2002:a05:6000:1f8f:b0:391:952:c74a with SMTP id ffacd0b85a97d-3913aeee2d7mr346949f8f.8.1741370697461; Fri, 07 Mar 2025 10:04:57 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4352eb1sm86964935e9.31.2025.03.07.10.04.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 07 Mar 2025 10:04:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Igor Mammedov , qemu-ppc@nongnu.org, Thomas Huth , Richard Henderson , Tony Krowiak , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org, Yi Liu , Paolo Bonzini , Zhenzhong Duan , Matthew Rosato , Eric Farman , Peter Xu , Pierrick Bouvier , Daniel Henrique Barboza , Eric Auger , qemu-s390x@nongnu.org, Jason Herne , =?utf-8?q?C=C3=A9dric_Le_Goater?= , David Hildenbrand , =?utf-8?q?Alex_Benn=C3=A9e?= , Harsh Prateek Bora , Nicholas Piggin , Halil Pasic , Christian Borntraeger Subject: [PATCH 14/14] hw/vfio/platform: Check CONFIG_IOMMUFD at runtime using iommufd_builtin Date: Fri, 7 Mar 2025 19:03:37 +0100 Message-ID: <20250307180337.14811-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250307180337.14811-1-philmd@linaro.org> References: <20250307180337.14811-1-philmd@linaro.org> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Convert the compile time check on the CONFIG_IOMMUFD definition by a runtime one by calling iommufd_builtin(). Since the file doesn't use any target-specific knowledge anymore, move it to system_ss[] to build it once. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier --- hw/vfio/platform.c | 25 ++++++++++++------------- hw/vfio/meson.build | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 67bc57409c1..265c550b747 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -15,7 +15,6 @@ */ #include "qemu/osdep.h" -#include CONFIG_DEVICES /* CONFIG_IOMMUFD */ #include "qapi/error.h" #include #include @@ -637,10 +636,11 @@ static const Property vfio_platform_dev_properties[] = { DEFINE_PROP_UINT32("mmap-timeout-ms", VFIOPlatformDevice, mmap_timeout, 1100), DEFINE_PROP_BOOL("x-irqfd", VFIOPlatformDevice, irqfd_allowed, true), -#ifdef CONFIG_IOMMUFD +}; + +static const Property vfio_platform_dev_iommufd_properties[] = { DEFINE_PROP_LINK("iommufd", VFIOPlatformDevice, vbasedev.iommufd, TYPE_IOMMUFD_BACKEND, IOMMUFDBackend *), -#endif }; static void vfio_platform_instance_init(Object *obj) @@ -652,12 +652,10 @@ static void vfio_platform_instance_init(Object *obj) DEVICE(vdev), false); } -#ifdef CONFIG_IOMMUFD static void vfio_platform_set_fd(Object *obj, const char *str, Error **errp) { vfio_device_set_fd(&VFIO_PLATFORM_DEVICE(obj)->vbasedev, str, errp); } -#endif static void vfio_platform_class_init(ObjectClass *klass, void *data) { @@ -666,9 +664,10 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) dc->realize = vfio_platform_realize; device_class_set_props(dc, vfio_platform_dev_properties); -#ifdef CONFIG_IOMMUFD - object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd); -#endif + if (iommufd_builtin()) { + device_class_set_props(dc, vfio_platform_dev_iommufd_properties); + object_class_property_add_str(klass, "fd", NULL, vfio_platform_set_fd); + } dc->vmsd = &vfio_platform_vmstate; dc->desc = "VFIO-based platform device assignment"; sbc->connect_irq_notifier = vfio_start_irqfd_injection; @@ -692,11 +691,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) object_class_property_set_description(klass, /* 2.6 */ "sysfsdev", "Host sysfs path of assigned device"); -#ifdef CONFIG_IOMMUFD - object_class_property_set_description(klass, /* 9.0 */ - "iommufd", - "Set host IOMMUFD backend device"); -#endif + if (iommufd_builtin()) { + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device"); + } } static const TypeInfo vfio_platform_dev_info = { diff --git a/hw/vfio/meson.build b/hw/vfio/meson.build index bd6e1d999e4..e5010db2c71 100644 --- a/hw/vfio/meson.build +++ b/hw/vfio/meson.build @@ -7,7 +7,6 @@ vfio_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr.c')) vfio_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'pci-quirks.c', )) -vfio_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) specific_ss.add_all(when: 'CONFIG_VFIO', if_true: vfio_ss) @@ -26,6 +25,7 @@ system_ss.add(when: ['CONFIG_VFIO', 'CONFIG_IOMMUFD'], if_true: files( )) system_ss.add(when: 'CONFIG_VFIO_AP', if_true: files('ap.c')) system_ss.add(when: 'CONFIG_VFIO_CCW', if_true: files('ccw.c')) +system_ss.add(when: 'CONFIG_VFIO_PLATFORM', if_true: files('platform.c')) system_ss.add(when: 'CONFIG_VFIO_PCI', if_true: files( 'display.c', 'pci.c',