From nobody Tue Apr 30 08:01:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576161185; cv=none; d=zohomail.com; s=zohoarc; b=BEle5U3jy0q1Gv6aFntPEnw8cMPq41mMTAhbQsV8UOMecCwXh286QUp7R+3wBIHtPeOLotK0cJM0CcN3ttkaOA3dsYUM2tZTukwa0CzbeM7IxRCE//AEeC6t6usYSWdeYgU6oSyQ+RNsI3Gyuys1DEhoPfd64bmyxTZVDG/emE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576161185; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=cGzZu1dSkbhVKoFntviesvbXQbdj2irYdhRwr8yxjKc=; b=U+utE2VtVDLiV77fpD/FQUozGG/F+iCX8BhcmelZcylrse54AJcDDFJLbQlYepsaoUWL0dJiB75VpLJEV3qLl4yqrHKFUoSC5aR7vRYbB4jCBJ8FmKBmRbbs27dUmP1f4y1xRaEoRRrFZmTb+3YvxTr15CLHj6yldhvOIIDWxbk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576161185587232.64279137267886; Thu, 12 Dec 2019 06:33:05 -0800 (PST) Received: from localhost ([::1]:60712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPWY-0007WK-L5 for importer@patchew.org; Thu, 12 Dec 2019 09:33:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58662) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPU8-0005in-6k for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifPU3-0008Cn-Fi for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:31 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:50518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifPU2-00088S-RT for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:27 -0500 Received: by mail-wm1-x342.google.com with SMTP id a5so2607814wmb.0 for ; Thu, 12 Dec 2019 06:30:25 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm6140505wmc.47.2019.12.12.06.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 06:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=cGzZu1dSkbhVKoFntviesvbXQbdj2irYdhRwr8yxjKc=; b=ZOWkH2CQmQMBxQHWk9zvVoAujN9eJJsdpN+M0Pjiunrz1QXzlHRICpAzWVsLZvCv0G tLpFovrIFGKQEht6yabTeE1bj4upzR93j/UPT+MwoJAHlom0EXWIVhN9xRmJKykzTlW/ uribn+pt2vgcHed4fMPcArzaJgBPo9+yJ2tRqv+LNRlAETktD/rGJKwSfqJl3+4mj+V5 IsMvsCF8ZjDrCsxt38Tn/c0cbjq55RF9I2AJ2Syt8UqINaQFoDtB0vsw2D6FrV3jsz2+ eOOk84MNuhfUc4U9UAG67nBrLXLh1/y31BvRXFVTiGUajqMmorN2mInD64ieBIpJilY6 +s+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=cGzZu1dSkbhVKoFntviesvbXQbdj2irYdhRwr8yxjKc=; b=WsexdFkbcMfq+JSasDaGF9LjHp1UpIVSFsFQc4Pl2eoArNOV7KDbNF4U/YNMdtHZRj tKpyvwLdoO7DOQ4gkioH6yqrFcebt0cGk4Loy7w1o3xLnRpTXAIpL/WRLnfnn6olRtZW /WjLC6A22L9KXCDZm+1X2PNjInsJKFQBcUHkFTR0r/t29YPsgKfL6sJAOE01Dn+/ZN+B US6m63yEfhOC3mOv5sFB7ci139lgqdsHwzVWs3cVM2N8318aAYcdTt9gAgVYK0Td16nr A182r004xdv1DctC/wuuV/jS3hT5OsRy8/EsO9uX7pI/T5k2p/Ze5uKw1167jREvEUE9 KlPQ== X-Gm-Message-State: APjAAAXWhh6HhHbkVPmsp8cDaDXhzczKCKbzT8bNOF4SCSvn6HcMuN7K A0os0f/f0OtWEfDpGU+YZQiZdSM3 X-Google-Smtp-Source: APXvYqzK+d/zM3ghtrRoDTvNVorju97mNAzn2qkm68KRW7asP5s7yBnXF1ebfYML5XDGWOt9tpjI9A== X-Received: by 2002:a05:600c:d7:: with SMTP id u23mr6595335wmm.145.1576161024238; Thu, 12 Dec 2019 06:30:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/5] i386: conditionally compile more files Date: Thu, 12 Dec 2019 15:30:17 +0100 Message-Id: <1576161021-5359-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> References: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, slp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Sergio Lopez --- hw/i386/Makefile.objs | 6 +++--- hw/i386/kvm/Makefile.objs | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index 0d195b5..01ae202 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -1,11 +1,11 @@ obj-$(CONFIG_KVM) +=3D kvm/ obj-y +=3D e820_memory_layout.o multiboot.o obj-y +=3D x86.o -obj-y +=3D pc.o +obj-$(CONFIG_PC) +=3D pc.o pc_sysfw.o obj-$(CONFIG_I440FX) +=3D pc_piix.o obj-$(CONFIG_Q35) +=3D pc_q35.o obj-$(CONFIG_MICROVM) +=3D microvm.o -obj-y +=3D fw_cfg.o pc_sysfw.o +obj-y +=3D fw_cfg.o obj-y +=3D x86-iommu.o obj-$(CONFIG_VTD) +=3D intel_iommu.o obj-$(CONFIG_AMD_IOMMU) +=3D amd_iommu.o @@ -14,4 +14,4 @@ obj-$(CONFIG_VMPORT) +=3D vmport.o obj-$(CONFIG_VMMOUSE) +=3D vmmouse.o =20 obj-y +=3D kvmvapic.o -obj-y +=3D acpi-build.o +obj-$(CONFIG_PC) +=3D acpi-build.o diff --git a/hw/i386/kvm/Makefile.objs b/hw/i386/kvm/Makefile.objs index 4224ed9..0c8d5f2 100644 --- a/hw/i386/kvm/Makefile.objs +++ b/hw/i386/kvm/Makefile.objs @@ -1 +1,5 @@ -obj-y +=3D clock.o apic.o i8259.o ioapic.o i8254.o +obj-y +=3D clock.o +obj-$(CONFIG_APIC) +=3D apic.o +obj-$(CONFIG_IOAPIC) +=3D ioapic.o +obj-$(CONFIG_I8254) +=3D i8254.o +obj-$(CONFIG_I8259) +=3D i8259.o --=20 1.8.3.1 From nobody Tue Apr 30 08:01:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576161179; cv=none; d=zohomail.com; s=zohoarc; b=cRvi3wLO50e8ER19VqZLt8vsR1EvCFmNGtYRdpPUhDdSXKe+Qm9rEqrFZ+xCwbxdb9BYIaIRM9qBVjpIb9OBK1cjxHlKKpy3ZJZEghsQ35V8ARPchdYL5UqxGMzjAejp8LNaavpjJd38r1XoX03pMWJ8KOPtTbcIsTiEuhSUZ2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576161179; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=d+fGHQicJfMCQVgermELgoy5/7QyWO3sNl/PPGYy11M=; b=DcPY4Va8M6pOlntOduCK/IZ6TtyW7G/RB3YJyFlAst7lVqLs/AbQnQsSUpm3tGvZTznobFjZ+K2/cfLkEwlWEvLTWK1wYRkXF9xcanLwA1o1dQ3c6h/7Pl5+Nq07Y5hop11F1he04GGwtTPmNv0QTTQ6jgntBmms6QRgFL1DeYs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576161179445390.1253433034018; Thu, 12 Dec 2019 06:32:59 -0800 (PST) Received: from localhost ([::1]:60706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPWT-0007Pw-Eu for importer@patchew.org; Thu, 12 Dec 2019 09:32:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58826) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPU9-0005iq-4M for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifPU8-0008H1-2T for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:33 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:33098) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifPU3-0008A5-CO for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:27 -0500 Received: by mail-wr1-x443.google.com with SMTP id b6so3006660wrq.0 for ; Thu, 12 Dec 2019 06:30:26 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm6140505wmc.47.2019.12.12.06.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 06:30:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=d+fGHQicJfMCQVgermELgoy5/7QyWO3sNl/PPGYy11M=; b=f5tTkX/oBJRJtlTblwCIZzYIT++yb58irrw25E2QFk4JLqbF49FH5IXpGevUhLchGb rlxzpdz8fdBmE454YXG3MwjlWgmgEL9txWYqMD+bjIvTDIsZhyG8/qLUWVVAyHnm+Bzo RJ8ZQXXUQoLX7D0lbakZlbRVQiiJU9DooYjUnme1sv6IBDoq3EcthBx5c8CyMVaEyoPQ MfoQTqhZ8WNZlwviKwIjFUt1vafKCrFdhO7Aqy5E1eWQlahvLznTirFAgHPM8pJ7tEhy ejbV3xp5s7pkf6K4D885T2GLmCQHIIVt5cDQhYkMzI/w3u4lwR31a55jcce9UT5Ns855 XIFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=d+fGHQicJfMCQVgermELgoy5/7QyWO3sNl/PPGYy11M=; b=TSwxu/bUvMHQw++Z+xrg//QCUpaXEUtfQdNachSdWSLSFmbt4DI1k1Aa3hhIMtsTBh bb1HhrQItxKzAAbHjKLcyZcTb0/NraGMiRPcuP/ZtFrET1uTEZeOi9tV1U6jvKZo8AYD I/rf0ffeOpMocsW4KxpyyTKuJbiJyRf5TvTCzCm6I1uiGKTlDAwjrvx+w6bCCyBsA56+ U5T7yh6tHAIvfY56n3VaVYd8EM7d1QT49yhtG2teBYvxL72w6jo1W9AUed3Vx4XuBE9N zAcT/eWeiImNoXM8nGfMrE7Klcz/L1fRPANOjd40lPt/9IES7H4O3lMmti56YNx3hAta wY6g== X-Gm-Message-State: APjAAAVtJ94d7QL8CK9NRXtth3EEOTgvI5f2dqWqlnxH4Eh0vWopohyh ZQPh12Xx4Bf9Ie3+4212tuYg7Bn0 X-Google-Smtp-Source: APXvYqwHhdPgXiqODZlFJx1LRu/DKz4P1XH0oZGppQNuBKCsyhKA1THPVZ8W5VXF3gLRju9jbBBegg== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr6682043wrr.116.1576161025181; Thu, 12 Dec 2019 06:30:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/5] fw_cfg: allow building without other devices Date: Thu, 12 Dec 2019 15:30:18 +0100 Message-Id: <1576161021-5359-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> References: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, slp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The microvm machine type uses fw_cfg but lacks SMBIOS and ACPI. Do not inc= lude the files if the symbol is not present in QEMU and remove dependencies on machine-specific files. Signed-off-by: Paolo Bonzini Reviewed-by: Sergio Lopez --- hw/i386/fw_cfg.c | 7 +++++++ hw/i386/pc.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 39b6bc6..326e33e 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -22,6 +22,9 @@ #include "hw/nvram/fw_cfg.h" #include "e820_memory_layout.h" #include "kvm_i386.h" +#include "config-devices.h" + +struct hpet_fw_config hpet_cfg =3D {.count =3D UINT8_MAX}; =20 const char *fw_cfg_arch_key_name(uint16_t key) { @@ -46,6 +49,7 @@ const char *fw_cfg_arch_key_name(uint16_t key) =20 void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg) { +#ifdef CONFIG_SMBIOS uint8_t *smbios_tables, *smbios_anchor; size_t smbios_tables_len, smbios_anchor_len; struct smbios_phys_mem_area *mem_array; @@ -83,6 +87,7 @@ void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw= _cfg) fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor", smbios_anchor, smbios_anchor_len); } +#endif } =20 FWCfgState *fw_cfg_arch_create(MachineState *ms, @@ -114,8 +119,10 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, */ fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); +#ifdef CONFIG_ACPI fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES, acpi_tables, acpi_tables_len); +#endif fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override(= )); =20 fw_cfg_add_bytes(fw_cfg, FW_CFG_E820_TABLE, diff --git a/hw/i386/pc.c b/hw/i386/pc.c index b9f3b38..3d2c5d8 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -101,8 +101,6 @@ #define DPRINTF(fmt, ...) #endif =20 -struct hpet_fw_config hpet_cfg =3D {.count =3D UINT8_MAX}; - GlobalProperty pc_compat_4_1[] =3D {}; const size_t pc_compat_4_1_len =3D G_N_ELEMENTS(pc_compat_4_1); =20 --=20 1.8.3.1 From nobody Tue Apr 30 08:01:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576161312; cv=none; d=zohomail.com; s=zohoarc; b=ClbNdghiJSxJpQtz0MieTjXB2v/wf50TUqlvSZsIRxlNqKDDSr6kSSOSz1CuEVsWfSyjwS88R7nXidKYlpOjIQ4obV8ucr+UYYSndsyHsacDfqJN5hFwen3fGdSH9LPnIluuCxiAKvT0psiDSs4TVncNVFhy4sovupS6rJs3roo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576161312; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=9EDJH/BxPkKlhLjKsWHknM6vk0Y8bYaWTnGtJKPkwqA=; b=H2D9LiNs7J52RZBznJlGdExgtU9MP+BV9HfRgLkv0GR1Bqsf3A9QoM4sVT6tvrFxeMY8XA9AScY2dHfQfer+yejTm6RejxUfJMaw9QVx6uIq+988bEME/luf8RkX6moYBmltN7Czo/6rUM1qXKWZnG0xh1U0Hg/4Ss298gnl+jY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576161312706594.5324774029525; Thu, 12 Dec 2019 06:35:12 -0800 (PST) Received: from localhost ([::1]:60742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPYd-000241-Bl for importer@patchew.org; Thu, 12 Dec 2019 09:35:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58965) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPU9-0005jO-U9 for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifPU8-0008HS-5s for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:33 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:34299) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifPU3-0008BY-Jv for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:32 -0500 Received: by mail-wm1-x341.google.com with SMTP id f4so3748511wmj.1 for ; Thu, 12 Dec 2019 06:30:27 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm6140505wmc.47.2019.12.12.06.30.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 06:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=9EDJH/BxPkKlhLjKsWHknM6vk0Y8bYaWTnGtJKPkwqA=; b=JJEXAuh2pZssLNJEJY0y+N1djE2rGkTr5dDpfrFrlt/b1iIM/99Ytr69xV6yXfuT8S FDcp707k5l/70HeDFUJvRYjxMr5gD/03uPVIGH0bJfyH0s638OjUw2II/lRoYQHeEEjK GQoByIUJgH0/ZQRoQVDq7pBER3+F6TZ04SvxrfTytJRX/YLM3O+6a4R8oz0JIrogVgXF aezy6Iv6Oc0rIQ3e1ZSaRXslruiXDtk/0G1/QA0Kbz0LLzmaMMyZ8TzxLojSH4yezALI R0Tqn2aB8L4H1gWcqBapvLR7EeHbuNjRaOB92FHkK6sFXeJEfamex0+3+pDoRDarfDeE iW/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=9EDJH/BxPkKlhLjKsWHknM6vk0Y8bYaWTnGtJKPkwqA=; b=LyXaPX/lGxjaU3KqbFSmDN4XyD/uk85FORAQL0gZyhGqil/uJ2hzGOdQ45y+VL6W0F W8ZTnHYv/4bxwyFKDfIfMR7W0EFmTTY8sYCekCuA8wWeanml08dxWXVuevQUh56t/f5x OwYvfoKpE9U0N/vEPHUgE8Xt+8evOPDG7Fr11F3qYFIgdFaSQNJQ4c60/Ho1Lxcch7Z/ PMX5LA0xV4CMCXAe6ReEGySEAv6+Ii98X1SYCtfV/eFtUX9NoPfjJMnLxf2h0lYFE/bT 82lXT3se5/W3FHiWKe2U/WNPC5YR1DmlxHYgMFqV8GDsSgWZJrfVyAWhnPh5WMiHZId9 kR6w== X-Gm-Message-State: APjAAAVlRlJWX4zGFuFujB6S6IxJir0Tqys8vgRGVdJ33928+ztXjFzG B3tQrzrz8CmkmivuA4lzR1Ct9P9G X-Google-Smtp-Source: APXvYqxK9ivQbr6rzDsczuHIBj602drLKASadsEvrPkAi6usJNZki99iULJweMKzdaH5R+zmXzyV2w== X-Received: by 2002:a1c:1d8c:: with SMTP id d134mr7303447wmd.16.1576161026205; Thu, 12 Dec 2019 06:30:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/5] x86: move more functions to X86MachineState and x86.c Date: Thu, 12 Dec 2019 15:30:19 +0100 Message-Id: <1576161021-5359-4-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> References: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, slp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" These are needed by microvm too, so move them outside of PC-specific files. Signed-off-by: Paolo Bonzini --- hw/i386/pc.c | 99 ----------------------------------------------= --- hw/i386/x86.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ include/hw/i386/pc.h | 12 ------ include/hw/i386/x86.h | 13 +++++++ 4 files changed, 114 insertions(+), 111 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3d2c5d8..308248d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -342,17 +342,6 @@ GlobalProperty pc_compat_1_4[] =3D { }; const size_t pc_compat_1_4_len =3D G_N_ELEMENTS(pc_compat_1_4); =20 -void gsi_handler(void *opaque, int n, int level) -{ - GSIState *s =3D opaque; - - DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n); - if (n < ISA_NUM_IRQS) { - qemu_set_irq(s->i8259_irq[n], level); - } - qemu_set_irq(s->ioapic_irq[n], level); -} - GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) { GSIState *s; @@ -392,55 +381,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr add= r, unsigned size) return 0xffffffffffffffffULL; } =20 -/* TSC handling */ -uint64_t cpu_get_tsc(CPUX86State *env) -{ - return cpu_get_ticks(); -} - -/* IRQ handling */ -int cpu_get_pic_interrupt(CPUX86State *env) -{ - X86CPU *cpu =3D env_archcpu(env); - int intno; - - if (!kvm_irqchip_in_kernel()) { - intno =3D apic_get_interrupt(cpu->apic_state); - if (intno >=3D 0) { - return intno; - } - /* read the irq from the PIC */ - if (!apic_accept_pic_intr(cpu->apic_state)) { - return -1; - } - } - - intno =3D pic_read_irq(isa_pic); - return intno; -} - -static void pic_irq_request(void *opaque, int irq, int level) -{ - CPUState *cs =3D first_cpu; - X86CPU *cpu =3D X86_CPU(cs); - - DPRINTF("pic_irqs: %s irq %d\n", level? "raise" : "lower", irq); - if (cpu->apic_state && !kvm_irqchip_in_kernel()) { - CPU_FOREACH(cs) { - cpu =3D X86_CPU(cs); - if (apic_accept_pic_intr(cpu->apic_state)) { - apic_deliver_pic_intr(cpu->apic_state, level); - } - } - } else { - if (level) { - cpu_interrupt(cs, CPU_INTERRUPT_HARD); - } else { - cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); - } - } -} - /* PC cmos mappings */ =20 #define REG_EQUIPMENT_BYTE 0x14 @@ -884,16 +824,6 @@ void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd) nb_ne2k++; } =20 -DeviceState *cpu_get_current_apic(void) -{ - if (current_cpu) { - X86CPU *cpu =3D X86_CPU(current_cpu); - return cpu->apic_state; - } else { - return NULL; - } -} - void pc_acpi_smi_interrupt(void *opaque, int irq, int level) { X86CPU *cpu =3D opaque; @@ -1289,11 +1219,6 @@ uint64_t pc_pci_hole64_start(void) return ROUND_UP(hole64_start, 1 * GiB); } =20 -qemu_irq pc_allocate_cpu_irq(void) -{ - return qemu_allocate_irq(pic_irq_request, NULL, 0); -} - DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) { DeviceState *dev =3D NULL; @@ -1480,30 +1405,6 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i825= 9_irqs) g_free(i8259); } =20 -void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) -{ - DeviceState *dev; - SysBusDevice *d; - unsigned int i; - - if (kvm_ioapic_in_kernel()) { - dev =3D qdev_create(NULL, TYPE_KVM_IOAPIC); - } else { - dev =3D qdev_create(NULL, TYPE_IOAPIC); - } - if (parent_name) { - object_property_add_child(object_resolve_path(parent_name, NULL), - "ioapic", OBJECT(dev), NULL); - } - qdev_init_nofail(dev); - d =3D SYS_BUS_DEVICE(dev); - sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS); - - for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { - gsi_state->ioapic_irq[i] =3D qdev_get_gpio_in(dev, i); - } -} - static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *d= ev, Error **errp) { diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 394edc2..028bbf4 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -41,11 +41,15 @@ #include "hw/i386/fw_cfg.h" =20 #include "hw/acpi/cpu_hotplug.h" +#include "hw/i386/pc.h" +#include "hw/irq.h" #include "hw/nmi.h" #include "hw/loader.h" #include "multiboot.h" #include "elf.h" #include "standard-headers/asm-x86/bootparam.h" +#include "config-devices.h" +#include "kvm_i386.h" =20 #define BIOS_FILENAME "bios.bin" =20 @@ -220,6 +224,103 @@ static long get_file_size(FILE *f) return size; } =20 +/* TSC handling */ +uint64_t cpu_get_tsc(CPUX86State *env) +{ + return cpu_get_ticks(); +} + +/* IRQ handling */ +static void pic_irq_request(void *opaque, int irq, int level) +{ + CPUState *cs =3D first_cpu; + X86CPU *cpu =3D X86_CPU(cs); + + if (cpu->apic_state && !kvm_irqchip_in_kernel()) { + CPU_FOREACH(cs) { + cpu =3D X86_CPU(cs); + if (apic_accept_pic_intr(cpu->apic_state)) { + apic_deliver_pic_intr(cpu->apic_state, level); + } + } + } else { + if (level) { + cpu_interrupt(cs, CPU_INTERRUPT_HARD); + } else { + cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD); + } + } +} + +qemu_irq pc_allocate_cpu_irq(void) +{ + return qemu_allocate_irq(pic_irq_request, NULL, 0); +} + +int cpu_get_pic_interrupt(CPUX86State *env) +{ + X86CPU *cpu =3D env_archcpu(env); + int intno; + + if (!kvm_irqchip_in_kernel()) { + intno =3D apic_get_interrupt(cpu->apic_state); + if (intno >=3D 0) { + return intno; + } + /* read the irq from the PIC */ + if (!apic_accept_pic_intr(cpu->apic_state)) { + return -1; + } + } + + intno =3D pic_read_irq(isa_pic); + return intno; +} + +DeviceState *cpu_get_current_apic(void) +{ + if (current_cpu) { + X86CPU *cpu =3D X86_CPU(current_cpu); + return cpu->apic_state; + } else { + return NULL; + } +} + +void gsi_handler(void *opaque, int n, int level) +{ + GSIState *s =3D opaque; + + if (n < ISA_NUM_IRQS) { + qemu_set_irq(s->i8259_irq[n], level); + } + qemu_set_irq(s->ioapic_irq[n], level); +} + +void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) +{ + DeviceState *dev; + SysBusDevice *d; + unsigned int i; + + if (kvm_ioapic_in_kernel()) { + dev =3D qdev_create(NULL, TYPE_KVM_IOAPIC); + } else { + dev =3D qdev_create(NULL, TYPE_IOAPIC); + } + if (parent_name) { + object_property_add_child(object_resolve_path(parent_name, NULL), + "ioapic", OBJECT(dev), NULL); + } + qdev_init_nofail(dev); + d =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(d, 0, IO_APIC_DEFAULT_ADDRESS); + + for (i =3D 0; i < IOAPIC_NUM_PINS; i++) { + gsi_state->ioapic_irq[i] =3D qdev_get_gpio_in(dev, i); + } +} + struct setup_data { uint64_t next; uint32_t type; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 1f86eba..0ab4a2a 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -3,11 +3,9 @@ =20 #include "exec/memory.h" #include "hw/boards.h" -#include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "hw/block/flash.h" #include "net/net.h" -#include "hw/i386/ioapic.h" #include "hw/i386/x86.h" =20 #include "qemu/range.h" @@ -144,15 +142,6 @@ int pic_get_output(DeviceState *d); =20 /* ioapic.c */ =20 -/* Global System Interrupts */ - -#define GSI_NUM_PINS IOAPIC_NUM_PINS - -typedef struct GSIState { - qemu_irq i8259_irq[ISA_NUM_IRQS]; - qemu_irq ioapic_irq[IOAPIC_NUM_PINS]; -} GSIState; - void gsi_handler(void *opaque, int n, int level); =20 GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled); @@ -217,7 +206,6 @@ void pc_pci_device_init(PCIBus *pci_bus); typedef void (*cpu_set_smm_t)(int smm, void *arg); =20 void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); -void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name); =20 ISADevice *pc_find_fdc0(void); int cmos_get_fd_drive_type(FloppyDriveType fd0); diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 4b84917..a6c23ef 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -23,6 +23,8 @@ =20 #include "hw/boards.h" #include "hw/nmi.h" +#include "hw/isa/isa.h" +#include "hw/i386/ioapic.h" =20 typedef struct { /*< private >*/ @@ -95,4 +97,15 @@ void x86_load_linux(X86MachineState *x86ms, bool pvh_enabled, bool linuxboot_dma_enabled); =20 +/* Global System Interrupts */ + +#define GSI_NUM_PINS IOAPIC_NUM_PINS + +typedef struct GSIState { + qemu_irq i8259_irq[ISA_NUM_IRQS]; + qemu_irq ioapic_irq[IOAPIC_NUM_PINS]; +} GSIState; + +void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name); + #endif --=20 1.8.3.1 From nobody Tue Apr 30 08:01:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576161183; cv=none; d=zohomail.com; s=zohoarc; b=HAD1Ej6iqvSpi0vSupFCa/+KS5s4DfMHvBtbWM1k5AGa6laFFs5iOetgHJVPZBsg7TZTRPjPYoVqsoEDhkN/FKGIszFMx/vaaKe/+BLz3L+9yK1DPO2u+N412t6s+ve+mTN70wksVunUDQ76oF14vcJPgfUoozmGjNkdPZBncBA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576161183; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/f5ttWD0YBBmnXUACo+GHeAmmW3sES58X6wSRbitHaA=; b=PqvEScwLblFE5UwYHXoFmxvRe5PEk80pIPFPmsu89zTT//8dR/PDoUdY+O0Y2hf6w8D2wmckxiQ5V2xoILb26PdsgNP5d4eoQ2feZFeXL7y8qCXWRfSfMmeDEFyUTi7NaAdcZ20CPrfevh8Pxc+h3XXLpdxWtGUfaTPFV445PJg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576161183680166.3393224028531; Thu, 12 Dec 2019 06:33:03 -0800 (PST) Received: from localhost ([::1]:60710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPWW-0007UP-CX for importer@patchew.org; Thu, 12 Dec 2019 09:33:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58936) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPU9-0005jJ-Nt for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifPU8-0008I1-Fl for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:33 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:50519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifPU8-0008Dz-5G for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:32 -0500 Received: by mail-wm1-x342.google.com with SMTP id a5so2608090wmb.0 for ; Thu, 12 Dec 2019 06:30:29 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm6140505wmc.47.2019.12.12.06.30.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 06:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/f5ttWD0YBBmnXUACo+GHeAmmW3sES58X6wSRbitHaA=; b=o4FrjwArxqMH86O/mMAgQptQ4jOwZjvNs5hZq3wCovE2cWsEEwDNQ2TSePAHsQ580V 0RSfPYod3tiloqqzaopd/10Iq3Ag7oHfqZIOYkVlI/lfCZdWA1HIvAIcUNOeP6KRtJKw 1/gscto4bXx9jJO79kObRRwxfq0FPugp6Vdz1g6j1HcGUtWkiZtDvuHhIzwI54b1AgMq Zc11CZj9Azkmr+nOlZIk7jY3zEXFNNlLzruDNV98yTGuM+aIEcwWXAi2w5fkRgGW1jCj NalzErUO6u8EHEYPHW3bdn7FsI/vXNszl4IBAk0NpipMh9Aj4PSxNqT6Qc9Murwnfug/ uUkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/f5ttWD0YBBmnXUACo+GHeAmmW3sES58X6wSRbitHaA=; b=H821YDDoJtkBBIE77O+oeMMa9lDig85La1AmSkJ6V6nvtEVPrsaHULNQI1l62iDJTT 9ZuhfSs2mR1hM0B/Od7XzqlDwEZl3Bd22DcPJab18GkPhE4jJuKpsmv500kDlOwgKUbZ hxaKQ4mkd9aQxKCzqBw9JQUdOpw58Ioble3cP6bMh+ehn0XHPHQCkl3dxaS+q9QGZDMJ an6vbn6AjdA7QySCOfSSXOf95qrCnoXrkA8PZBlNga7Qt8FakKLdChswSmb8fMYqz4eR 4njhTtTY5eGnCGjmPhNc4Spkt+G0qI1CloiO4EzL4PumJP+0phJcLBy/ulJFIbztD0B1 zj7A== X-Gm-Message-State: APjAAAVtKZrTaFLQklQLtJroWeKAFClPuqg75y8y9MDOW91gpvXWVvmG 84T4tCwSqaFSDMSXqdA8RZbJXHD1 X-Google-Smtp-Source: APXvYqwU4QhYnPnRwVh+hj4A/IkstETz+enGCXpONxSS7h0kPeCm8tJxXMkiBLf7nGXY4aHaBJwxdw== X-Received: by 2002:a1c:1d16:: with SMTP id d22mr7234564wmd.158.1576161027307; Thu, 12 Dec 2019 06:30:27 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 4/5] pci-stub: add more MSI functions Date: Thu, 12 Dec 2019 15:30:20 +0100 Message-Id: <1576161021-5359-5-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> References: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, slp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" On x86, KVM needs some function from the PCI subsystem in order to set up interrupt routes. Provide some stubs to support x86 machines that lack PCI. Signed-off-by: Paolo Bonzini Reviewed-by: Sergio Lopez --- hw/pci/pci-stub.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index c04a5df..cc2a2e1 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -26,6 +26,7 @@ #include "qapi/qmp/qerror.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" +#include "hw/pci/msix.h" =20 bool msi_nonbroken; bool pci_available; @@ -64,3 +65,29 @@ void msi_notify(PCIDevice *dev, unsigned int vector) { g_assert_not_reached(); } + +/* Required by target/i386/kvm.c */ +bool msi_is_masked(const PCIDevice *dev, unsigned vector) +{ + g_assert_not_reached(); +} + +MSIMessage msi_get_message(PCIDevice *dev, unsigned int vector) +{ + g_assert_not_reached(); +} + +int msix_enabled(PCIDevice *dev) +{ + return false; +} + +bool msix_is_masked(PCIDevice *dev, unsigned vector) +{ + g_assert_not_reached(); +} + +MSIMessage msix_get_message(PCIDevice *dev, unsigned int vector) +{ + g_assert_not_reached(); +} --=20 1.8.3.1 From nobody Tue Apr 30 08:01:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1576161310; cv=none; d=zohomail.com; s=zohoarc; b=Q1fyr76Z4nlKQX9QEWK2d+61rWhHtKoVQBSKhNdbDTyRT4+juJH0o+6Ag2DwMaXGrsk9jOa631UvPEXp4kuUiy8EA/ZuVfvJFhqITAYzZQgf99RDqLWo/u9nCSwUI2Whh88vLblvgJYf8QtFZB/ygzjU4Enkz20BY5m3RGbNcSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576161310; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=AMjvcNPBoUuuvyW0xFxWLMl0K4YTz84fMxF1PXSjs+g=; b=DxLtnDVJtxFMRAmpdWWsRq9kkUU/cISUl1PKOo7JNYS55xB/6UMqnQb0cow8EuY14t4Omlw4IJWDa6DJC3F4THftri/BJeSRQ5c+/Cg2HumzpHPFuvL9nPeBp6u/peuTZKvMI9H5bExPVACqrUkuRPeK6otSv9VclQO+i0iOPBA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576161310895463.2711531762235; Thu, 12 Dec 2019 06:35:10 -0800 (PST) Received: from localhost ([::1]:60740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPYb-00022K-L8 for importer@patchew.org; Thu, 12 Dec 2019 09:35:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58896) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifPU9-0005j6-Gm for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifPU8-0008Hr-Dy for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:33 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:45009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifPU8-0008ED-5L for qemu-devel@nongnu.org; Thu, 12 Dec 2019 09:30:32 -0500 Received: by mail-wr1-x443.google.com with SMTP id q10so2927591wrm.11 for ; Thu, 12 Dec 2019 06:30:29 -0800 (PST) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id c9sm6140505wmc.47.2019.12.12.06.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Dec 2019 06:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=AMjvcNPBoUuuvyW0xFxWLMl0K4YTz84fMxF1PXSjs+g=; b=V3woC/Ai+to45VtBcnzzCPnDn5J2Tx/HELG9Hv4qeLsNz94Rx4SMO0zfwRjp7OJtxh wP6VHom/0p/uYDCxG9J76Q69Th7Osx3dL0TK8ud+OQuAtvtCE9yFDL++TCMzP5/CTFER ZZEpsEBupgMayd9Y3eVljOLpSBjrB++Y6Z5+W1e8Ey12cC3kYNyhIiC8y8ahYGNa/Q7j 8JMjv28JfpNUa9b98w+MGnJMpnbxRsKdp0tHizrNGhCrfU1IIpmXNczzVTH778SzZcGe QivmlibZ2HKilgCIhFdpU95GaAKHNe5BLSE0o1zwOelcRjv+iqcMi5xO3iPJFhhUWX48 WUUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=AMjvcNPBoUuuvyW0xFxWLMl0K4YTz84fMxF1PXSjs+g=; b=iAGZGl2G9uQ0gZMgiPmxW7g5efjLx7Tv2Z/gSoi/WI9agajKhlFMEFBROY8W5/nmKX 3IfxAN/U8iAL2+F5N6AGse4kIpYCNeAagUIJr5SGi8zuufjRjqdYIz/gunB7tiku7eS8 B6gDqE0QNB1YppKQ3gFMV3HOZ5yx2yiYx5MI34nWLQSTXMU444uv4b2+cFVLipGBmtNd SxO0C5STeXFcNRbR1QWcBcyvNUDWiDpB4Ab36HW6UStjM7OpW966Kzat7RqoD4sF30GD NvD0BBS2Uu2nQ83Cjlzrjqhrf60IwMMorZ/PMc+14n/tVqRyalBbC5t3Osm62SZD8G8M EpXw== X-Gm-Message-State: APjAAAWzgtX4EE9HolGz6g6tsbZcdu5yeumRPFalxozyjMiCA/mMYiWn tQphHhV9U/wZrlkOiZ3P97sacc6Y X-Google-Smtp-Source: APXvYqxzty0wBaMMtq46x1EQbyue6L7gYwJs6KdMGZcf1ukK3LNIhE3k4fvLINxTzmgJwZ2WWWuL8w== X-Received: by 2002:a05:6000:11c5:: with SMTP id i5mr6568723wrx.102.1576161028182; Thu, 12 Dec 2019 06:30:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 5/5] kvm: check before accessing PCMachineState fields Date: Thu, 12 Dec 2019 15:30:21 +0100 Message-Id: <1576161021-5359-6-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> References: <1576161021-5359-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philmd@redhat.com, slp@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini --- roms/SLOF | 2 +- target/i386/kvm.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/roms/SLOF b/roms/SLOF index 8ebf2f5..bcc3c4e 160000 --- a/roms/SLOF +++ b/roms/SLOF @@ -1 +1 @@ -Subproject commit 8ebf2f55e1ba1492b942ba4b682160e644fc0f98 +Subproject commit bcc3c4e5c21a015f4680894c4ec978a90d4a2d69 diff --git a/target/i386/kvm.c b/target/i386/kvm.c index ef63f3a..2ad5a94 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -49,6 +49,7 @@ #include "migration/blocker.h" #include "exec/memattrs.h" #include "trace.h" +#include "config-devices.h" =20 //#define DEBUG_KVM =20 @@ -2172,9 +2173,15 @@ int kvm_arch_init(MachineState *ms, KVMState *s) } } =20 - if (kvm_check_extension(s, KVM_CAP_X86_SMM) && + if ( +#ifdef CONFIG_PC + kvm_check_extension(s, KVM_CAP_X86_SMM) && object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE) && - pc_machine_is_smm_enabled(PC_MACHINE(ms))) { + pc_machine_is_smm_enabled(PC_MACHINE(ms)) +#else + 0 +#endif + ) { smram_machine_done.notify =3D register_smram_listener; qemu_add_machine_init_done_notifier(&smram_machine_done); } --=20 1.8.3.1