qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, "Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v5 0/5] VIA PM: Implement basic ACPI support
Date: Sun, 29 Oct 2023 01:05:28 +0000	[thread overview]
Message-ID: <9317ABD0-0C39-492C-8408-2EF5580AD7EF@gmail.com> (raw)
In-Reply-To: <56ec4e09-9c81-7d9c-69bf-16a23a0969bd@eik.bme.hu>



Am 28. Oktober 2023 17:47:15 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>On Sat, 28 Oct 2023, Bernhard Beschow wrote:
>> Am 28. Oktober 2023 12:58:32 UTC schrieb BALATON Zoltan <balaton@eik.bme.hu>:
>>> Hello,
>>> 
>>> On Sat, 28 Oct 2023, Bernhard Beschow wrote:
>>>> This series is part of my work to bring the VIA south bridges to the PC machine
>>>> [1]. It implements missing ACPI functionality which ACPI-aware x86 guests
>>>> expect for a smooth experience. The implementation is heavily inspired by PIIX4.
>>> 
>>> I think first the interrupt routing should be fixed because that may change a few things in this series so that should be the next step and then rebase this series on top of that.
>>> 
>>> What I mean by fixing interrupt routing? You may remember this discussion:
>>> 
>>> https://patchew.org/QEMU/cover.1677004414.git.balaton@eik.bme.hu/
>>> 
>>> With pegasos2 your (over)simplification worked only because the firmware of that machine maps everythnig to one ISA IRQ and guests were happy with that. I told you that back then but could not convince you and Mark about that. Now with the amigaone machine the firmware maps VIA devices and PCI interuupt pins to different ISA IRQs so we need to go back either to my otiginal implementation or something else you come up with. You can test this trying to use USB devices with amigaone machine which only works after reverting 4e5a20b6da9b1 and 422a6e8075752. So please either propose something to fix that first or wait with this series until I can update my pathches to solve interrupt routing. I think this series should wait until after that because it adds more interrupt handling which should follow whatever way we come up with for that so it's too early fir this series yet. (If you want to try fixing it keep in mind that in both amigaone and pegasos2 the PCI buses are in the north brid
>ge not in the VIA south bridge so don't try to force the IRQ mapping into the PCI bus. All the VIA chip needs to do is mapping its PIRQ/PINT pins to ISA IRQs as the VIA is only handling ISA IRQs and all other pci stuff is handled in the north bridge. So I think we need a via_set_isa_irq function but we could change it according to Mark's idea to pass the PCI device and use its function number to select itq source instead of the enum I had in my original series.)
>>> 
>>> I have some other comments that I'll add in reply to individual patches for the future/
>> 
>> Hi Zoltan,
>> 
>> The interrupt handling introduced in this series is not related to PCI interrupt routing: The SMI is a dedicated pin on the device and the SCI is mapped internally to an ISA interrupt (note how the power management function lacks the registers for PCI interrupt information). Hence, PCI interrupt routing isn't changed in this series and therefore seems off-topic to me.
>> 
>> Moreover, the SMI is a new interrupt which is therefore not used in any machine yet. The SCI is deactivated if set to IRQ 0 which is the default even. If a guest configures it, it shall be aware to receive an *ISA* interrupt.
>> 
>> So I think this series shouldn't conflict with any previous work and should not be blocked by the PCI IRQ routing topic.
>
>The topic I've raised is not about routing PCI interrupts but routing different IRQ sources in VIA chip (such as different functions plus the PIRQ/PINT pins) to ISA interrupts so that would conflict with how the PM func interrupts are routed. I think only the isa function should have qemu_irqs and it should handle mapping of the different sources to the appropriate ISA IRQ so the different sources (functions) should not have their own qemu_irqs or gpios but they would just call via_isa_set_irq with their PCIDevice, pun and level and then the isa model would do the routing. I plan to do this eventually but it you're adding more things that would need to be reverted then it becomes more difficult.

We've had lenghty discussions about this topic before and we -- together -- ended up with the current solution. This series adds the last missing feature to the VIA south bridges before they can be integrated into the PC machine. Delaying progress by reopening the same topics over and over again really seems unfair to me. Instead, let's be optimistic that we'll end up with a solution that suits all needs well.

That said, I've ran both the pegasos2.rom and the u-boot.bin for amigaone that is used in the Avocado test. I've traced both with '-trace "pci_cfg_*"'. The result is that neither BIOS pokes the SCI routing register in the ISA function which means that the interrupt stays deactivated. Hence, it is very unlikely that the changes introduced in this series would interfer with guests on these machines.

In summary, I don't see any blockers so far for merging this series for the upcoming release.

Best regards,
Bernhard

>
>Regards,
>BALATON Zoltan


  parent reply	other threads:[~2023-10-29  1:06 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  9:16 [PATCH v5 0/5] VIA PM: Implement basic ACPI support Bernhard Beschow
2023-10-28  9:16 ` [PATCH v5 1/5] hw/isa/vt82c686: Respect SCI interrupt assignment Bernhard Beschow
2023-10-28  9:16 ` [PATCH v5 2/5] hw/isa/vt82c686: Add missing initialization of ACPI general purpose event registers Bernhard Beschow
2023-10-28  9:16 ` [PATCH v5 3/5] hw/isa/vt82c686: Reuse acpi_update_sci() Bernhard Beschow
2023-10-28 12:59   ` BALATON Zoltan
2023-10-28 15:40     ` Bernhard Beschow
2023-10-29  0:07   ` BALATON Zoltan
2023-10-29  1:07     ` Bernhard Beschow
2023-10-29  9:47       ` BALATON Zoltan
2023-10-30  9:45     ` Bernhard Beschow
2023-10-30 10:43       ` BALATON Zoltan
2023-10-28  9:16 ` [PATCH v5 4/5] hw/isa/vt82c686: Implement ACPI powerdown Bernhard Beschow
2023-10-28  9:16 ` [PATCH v5 5/5] hw/isa/vt82c686: Implement software-based SMI triggering Bernhard Beschow
2023-10-28 13:03   ` BALATON Zoltan
2023-10-28 15:44     ` Bernhard Beschow
2023-10-28 17:41       ` BALATON Zoltan
2023-10-28 12:58 ` [PATCH v5 0/5] VIA PM: Implement basic ACPI support BALATON Zoltan
2023-10-28 15:20   ` Bernhard Beschow
2023-10-28 17:47     ` BALATON Zoltan
2023-10-29  0:03       ` BALATON Zoltan
2023-10-29  1:05       ` Bernhard Beschow [this message]
2023-10-29  9:46         ` BALATON Zoltan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9317ABD0-0C39-492C-8408-2EF5580AD7EF@gmail.com \
    --to=shentey@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=jiaxun.yang@flygoat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).