All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>, Julien Grall <julien@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Rahul Singh <Rahul.Singh@arm.com>,
	Peter Griffin <peter.griffin@linaro.org>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Julien Grall <jgrall@amazon.com>
Subject: Re: [PATCH] xen/arm: acpi: Support memory reserve configuration table
Date: Fri, 19 Aug 2022 13:10:10 +0100	[thread overview]
Message-ID: <871qtcsacd.wl-maz@kernel.org> (raw)
In-Reply-To: <CAMj1kXGZ0ThmPT2FU4M07waB=Q9tXxs81TGTysV5dG5fm0D0Gw@mail.gmail.com>

On Thu, 18 Aug 2022 17:24:31 +0100,
Ard Biesheuvel <ardb@kernel.org> wrote:
> 
> On Thu, 18 Aug 2022 at 17:49, Leo Yan <leo.yan@linaro.org> wrote:
> >
> > On Thu, Aug 18, 2022 at 11:04:48AM +0100, Julien Grall wrote:
> >
> > [...]
> >
> > > > > Seems it's broken for kdump/kexec if kernel boots with using DT?
> > > > >
> > > >
> > > > EFI supports both DT and ACPI boot, but only ACPI *requires* EFI.
> > > >
> > > > So DT boot on hardware with affected GICv3 implementations works fine
> > > > with kdump/kexec as long as EFI is being used. Using non-EFI boot and
> > > > kexec on such systems will likely result in a splat on the second
> > > > kernel, unless there is another mechanism being used to reserve the
> > > > memory in DT as well.
> > > >
> > > > Maybe we should wire up the EFI_PARAVIRT flag for Xen dom0 on arm64,
> > > > so that we can filter out the call above. That would mean that
> > > > Xen/arm64/dom0/kexec on affected hardware would result in a splat in
> > > > the second kernel as well, but whether that matters depends on your
> > > > support scope.
> > >
> > > In the context of Xen, dom0 doesn't have direct access to the host ITS
> > > because we are emulating it. So I think it doesn't matter for us because we
> > > can fix our implementation if it is affected.
> > >
> > > That said, kexec-ing dom0 (or any other domain) on Xen on Arm would require
> > > some work to be supported. OOI, @leo is it something you are investigating?
> >
> >
> > Now I am working on automative reference platform; the first thing for
> > me is to resolve the kernel oops.
> >
> > For long term, I think the kexec/kdump would be important to be
> > supported, to be clear, so far supporting kexec/kdump for Xen/Linux is
> > not priority for my work.
> >
> > Also thanks a lot for Ard and Mark's replying. To be honest, I missed
> > many prerequisites (e.g. redistributor configurations for GIC in
> > hypervisor) and seems Xen uses a different way by emulating GICv3
> > controller for guest OS.  So now I am bit puzzle what's for next step
> > or just keep as it is?
> >
> 
> If i understand Julien's remark correctly, the dom0 GICv3 is emulated,
> and so it should not suffer from the issue that we are working around
> here.

The problem is that there is no way to distinguish a system that
suffers from GICR LPI tables being immutable from one that allows the
LPI configuration being changed (either because the HW allows it or
because the hypervisor plays other games).

Once you're in the secondary kernel with the RDs enabled, you have
already lost if there is a chance you could have reused this memory,
and that's irrespective of being a guest or bare metal (interrupt
delivery should still work during kexec).

> Given that this workaround is still the sole user of the MEMRESERVE
> API, we would like to remain free to rip it out and replace it
> completely if we need to, and so implementing it in Xen is a bad idea,
> especially if the issue in question does not even exist in your case.
> This means that even if you do decide to support kexec, things should
> work fine in spite of this warning regarding the failure to perform
> the memory reservation, as the GIC can simply be reconfigured.
> 
> So perhaps we should just [conditionally] tone down the warning?

What we could do instead is to have some form of kexec hook that tries
to go and turn the RDs off before jumping into the secondary kernel.
If the hypervisor allows this (and honours the GICR_CTLR.EnableLPI
bit), then there won't be any screaming in the secondary kernel.

This is probably a new infrastructure though, as I don't think we have
anything of the sort at the moment.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2022-08-19 12:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 10:57 [PATCH] xen/arm: acpi: Support memory reserve configuration table Leo Yan
2022-08-17 13:17 ` Jan Beulich
2022-08-17 13:49   ` Ard Biesheuvel
2022-08-18  9:15     ` Leo Yan
2022-08-18  9:33       ` Ard Biesheuvel
2022-08-18 10:04         ` Julien Grall
2022-08-18 15:49           ` Leo Yan
2022-08-18 16:24             ` Ard Biesheuvel
2022-08-19 12:10               ` Marc Zyngier [this message]
2022-08-25  7:59                 ` Leo Yan
2022-08-25  9:07                   ` Julien Grall
2022-08-25 11:24                     ` Leo Yan
2022-08-25 12:51                       ` Julien Grall
2022-08-25 11:50                     ` Leo Yan
2022-08-25 12:59                       ` Julien Grall
2022-08-25 14:40                         ` Leo Yan
2022-09-06  2:52                           ` Leo Yan
2022-09-06  6:27                             ` Marc Zyngier
2022-09-06  7:17                               ` Leo Yan
2022-09-06  7:22                                 ` Ard Biesheuvel
2022-09-06  7:27                                   ` Leo Yan
2022-09-06  7:43                                     ` Leo Yan
2022-09-06  8:28                                     ` Marc Zyngier
2022-09-06  7:53                                 ` Marc Zyngier
2022-09-06 15:13                                   ` Leo Yan
2022-09-06 15:18                                     ` Marc Zyngier
2022-08-18  9:40       ` Marc Zyngier
2022-08-18  7:34   ` Leo Yan
2022-08-18  7:47     ` Jan Beulich
2022-08-18  8:46       ` Leo Yan
2022-08-18  8:52         ` Jan Beulich
2022-08-18  7:57     ` Julien Grall
2022-08-18  8:28       ` Leo Yan
2022-08-18 13:24       ` Bertrand Marquis

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=871qtcsacd.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Rahul.Singh@arm.com \
    --cc=ardb@kernel.org \
    --cc=jbeulich@suse.com \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --cc=leo.yan@linaro.org \
    --cc=peter.griffin@linaro.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.