From nobody Wed Nov 27 16:52:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697740335; cv=none; d=zohomail.com; s=zohoarc; b=M/H8II/741XB+7yf+40OcEkaeAAsQX30SOgRNKAZdSnhYFZxGN3Ggsh6aPwbotxCRFoy+fAytEvkd6LHUy5dFw+mw3XLAPIDpWt3fX+a/oK8D8q1PzhMgwYMOswTbMKzbvL0NglSgYHKvqI/Vp87yFxeax5A3lg07/6fRwnkX2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697740335; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Qe9cw8bUuCtqGm/AJ5pwVjkO/Ec49p8b0ZTEQUoDbXo=; b=I+c9x/G1Bgeaf0lOFq0VYG0oCM9MxCjYjvQ9RURHSKCN3i7dJlOZqFjQjBdLGEs1IzzlQAEo77pUo0ve1LEKT+Ckeiy7tR1BVPmqlHY7fy3NbbO8gWw/Xnf4FUJJIk3urj/vuFMY/rXbqY5HVwGuoCC1UgYkTLpiWc7BAk8RYP8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697740335108797.8648487245506; Thu, 19 Oct 2023 11:32:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtXiF-0002QE-03; Thu, 19 Oct 2023 14:25:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXgW-0007yc-UZ for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:23:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtXgV-0001ek-2A for qemu-devel@nongnu.org; Thu, 19 Oct 2023 14:23:52 -0400 Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-147-IQ3-FDgXOoituHFrgkJXTA-1; Thu, 19 Oct 2023 14:23:48 -0400 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-507b0270b7fso5129207e87.3 for ; Thu, 19 Oct 2023 11:23:48 -0700 (PDT) Received: from redhat.com ([2a06:c701:73d2:bf00:e379:826:5137:6b23]) by smtp.gmail.com with ESMTPSA id p10-20020a05600c05ca00b004083729fc14sm4908860wmd.20.2023.10.19.11.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 11:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697739830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Qe9cw8bUuCtqGm/AJ5pwVjkO/Ec49p8b0ZTEQUoDbXo=; b=YcQBcjtPHd7G4SSK6XGBinffg6rB9xPNT06FUXk2p9yTf9DK3SM5yW5Q/2WjvWi9l4nzbo jxzYw8m3hM778lvB2cyarrFd+dnwchmH0mCcC0sRGwxfKKs/wm4jA58av+ngjaLq4f+BIy KHBfMy7Fg2wDtBPWIGarfxhKXnA7rtM= X-MC-Unique: IQ3-FDgXOoituHFrgkJXTA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697739827; x=1698344627; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Qe9cw8bUuCtqGm/AJ5pwVjkO/Ec49p8b0ZTEQUoDbXo=; b=MESWqWY8KzaypvVN5lOJJzJmtf7RZxxin69q79JddwVlHv6ps1h7kynNlXM6Vep//r R0gj7DoK1r/op7ebY61B8xwpy8J5kzzjSSmeqiuQrO13q+S9iy3eVCsdP7R8/6dd1eHo B3KESI6/fSYmwS1xa2hNj7dkLt8y//T/ZnEpW8/AMFiJ8bp9vd17yirZeUd2SE2V5Lt0 WDcSU7aQnIUioW3IEzkBAtVWg7Lef5HwpvRxeOnrHhKVhffWKx8YWByYWFv4ZUS8fjWg aMo1KnhjCGx8XWAb3SBJ7E4dcXGmHI8mNUib6jBkAU/fYDkZ6vmL4Om6wXLicVOnJTNg nYZQ== X-Gm-Message-State: AOJu0YxbyPUxKjLQcRkg13eWBs0PcBu9I+zKTFm3/pMh+ZIcm6Z2Hl0H N274VRHOsKCXbt08Fa+ODkrsNCZc9jTdrnExQDPuwjUz56nZVKCNHY2tiHWT3YSbvXzYFMivGrD LKINGPvzyVkvofCk03tSPIxJoq5nl5RhPZjQai+3vaqS+XIswVZQI3Rh+EmUhXbmLyff5 X-Received: by 2002:a05:6512:459:b0:501:c779:b3bb with SMTP id y25-20020a056512045900b00501c779b3bbmr2038688lfk.60.1697739826756; Thu, 19 Oct 2023 11:23:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHD1CpQcHSqs8quPhusXuairp7oyuSPszcBMU1VbG6/89TyzTPIWuRcKOUFdE9GBeXj9Qm+Xg== X-Received: by 2002:a05:6512:459:b0:501:c779:b3bb with SMTP id y25-20020a056512045900b00501c779b3bbmr2038668lfk.60.1697739826266; Thu, 19 Oct 2023 11:23:46 -0700 (PDT) Date: Thu, 19 Oct 2023 14:23:43 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Bernhard Beschow , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , =?utf-8?B?SGVydsOp?= Poussineau , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Aurelien Jarno Subject: [PULL v2 57/78] hw/isa/piix: Allow for optional PIC creation in PIIX3 Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697740336959100006 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Bernhard Beschow In the PC machine, the PIC is created in board code to allow it to be virtualized with various virtualization techniques. So explicitly disable i= ts creation in the PC machine via a property which defaults to enabled. Once t= he PIIX implementations are consolidated this default will keep Malta working without further ado. Signed-off-by: Bernhard Beschow Message-Id: <20231007123843.127151-21-shentey@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/southbridge/piix.h | 1 + hw/i386/pc_piix.c | 2 ++ hw/isa/piix.c | 21 +++++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/include/hw/southbridge/piix.h b/include/hw/southbridge/piix.h index dd5f7b31c0..08491693b4 100644 --- a/include/hw/southbridge/piix.h +++ b/include/hw/southbridge/piix.h @@ -69,6 +69,7 @@ struct PIIXState { MemoryRegion rcr_mem; =20 bool has_acpi; + bool has_pic; bool has_usb; bool smm_enabled; }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 70cffcfe4f..fa39afd891 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -268,6 +268,8 @@ static void pc_init1(MachineState *machine, object_property_set_bool(OBJECT(pci_dev), "has-acpi", x86_machine_is_acpi_enabled(x86ms), &error_abort); + object_property_set_bool(OBJECT(pci_dev), "has-pic", false, + &error_abort); qdev_prop_set_uint32(DEVICE(pci_dev), "smb_io_base", 0xb100); object_property_set_bool(OBJECT(pci_dev), "smm-enabled", x86_machine_is_smm_enabled(x86ms), diff --git a/hw/isa/piix.c b/hw/isa/piix.c index f6da334c6f..d6d9ac6473 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -106,7 +106,7 @@ static void piix4_set_irq(void *opaque, int irq_num, in= t level) } } =20 -static void piix4_request_i8259_irq(void *opaque, int irq, int level) +static void piix_request_i8259_irq(void *opaque, int irq, int level) { PIIX4State *s =3D opaque; qemu_set_irq(s->cpu_intr, level); @@ -343,6 +343,22 @@ static void pci_piix3_realize(PCIDevice *dev, Error **= errp) memory_region_add_subregion_overlap(pci_address_space_io(dev), PIIX_RCR_IOPORT, &d->rcr_mem, 1); =20 + /* PIC */ + if (d->has_pic) { + qemu_irq *i8259_out_irq =3D qemu_allocate_irqs(piix_request_i8259_= irq, d, + 1); + qemu_irq *i8259 =3D i8259_init(isa_bus, *i8259_out_irq); + size_t i; + + for (i =3D 0; i < ISA_NUM_IRQS; i++) { + d->isa_irqs_in[i] =3D i8259[i]; + } + + g_free(i8259); + + qdev_init_gpio_out_named(DEVICE(dev), &d->cpu_intr, "intr", 1); + } + isa_bus_register_input_irqs(isa_bus, d->isa_irqs_in); =20 i8257_dma_init(isa_bus, 0); @@ -419,6 +435,7 @@ static void pci_piix3_init(Object *obj) static Property pci_piix3_props[] =3D { DEFINE_PROP_UINT32("smb_io_base", PIIXState, smb_io_base, 0), DEFINE_PROP_BOOL("has-acpi", PIIXState, has_acpi, true), + DEFINE_PROP_BOOL("has-pic", PIIXState, has_pic, true), DEFINE_PROP_BOOL("has-usb", PIIXState, has_usb, true), DEFINE_PROP_BOOL("smm-enabled", PIIXState, smm_enabled, false), DEFINE_PROP_END_OF_LIST(), @@ -514,7 +531,7 @@ static void piix4_realize(PCIDevice *dev, Error **errp) PIIX_RCR_IOPORT, &s->rcr_mem, 1); =20 /* initialize i8259 pic */ - i8259_out_irq =3D qemu_allocate_irqs(piix4_request_i8259_irq, s, 1); + i8259_out_irq =3D qemu_allocate_irqs(piix_request_i8259_irq, s, 1); i8259 =3D i8259_init(isa_bus, *i8259_out_irq); =20 for (i =3D 0; i < ISA_NUM_IRQS; i++) { --=20 MST