* Re: [PATCH 0/5] kvm: fix latent guest entry/exit bugs [not found] ` <20220118131223.GC17938@C02TD0UTHF1T.local> @ 2022-01-18 14:15 ` Christian Borntraeger 2022-01-18 15:43 ` Mark Rutland 0 siblings, 1 reply; 2+ messages in thread From: Christian Borntraeger @ 2022-01-18 14:15 UTC (permalink / raw) To: Mark Rutland, Sven Schnelle, Heiko Carstens, linux-s390 Cc: Paolo Bonzini, linux-kernel, aleksandar.qemu.devel, alexandru.elisei, anup.patel, aou, atish.patra, benh, bp, catalin.marinas, chenhuacai, dave.hansen, david, frankja, frederic, gor, hca, imbrenda, james.morse, jmattson, joro, kvm, maz, mingo, mpe, nsaenzju, palmer, paulmck, paulus, paul.walmsley, seanjc, suzuki.poulose, tglx, tsbogend, vkuznets, wanpengli, will Am 18.01.22 um 14:12 schrieb Mark Rutland: > On Tue, Jan 18, 2022 at 01:42:26PM +0100, Christian Borntraeger wrote: >> >> >> Am 18.01.22 um 13:02 schrieb Mark Rutland: >>> On Mon, Jan 17, 2022 at 06:45:36PM +0100, Paolo Bonzini wrote: >>>> On 1/14/22 16:19, Mark Rutland wrote: >>>>> I also think there is another issue here. When an IRQ is taken from SIE, will >>>>> user_mode(regs) always be false, or could it be true if the guest userspace is >>>>> running? If it can be true I think tha context tracking checks can complain, >>>>> and it*might* be possible to trigger a panic(). >>>> >>>> I think that it would be false, because the guest PSW is in the SIE block >>>> and switched on SIE entry and exit, but I might be incorrect. >>> >>> Ah; that's the crux of my confusion: I had thought the guest PSW would >>> be placed in the regular lowcore *_old_psw slots. From looking at the >>> entry asm it looks like the host PSW (around the invocation of SIE) is >>> stored there, since that's what the OUTSIDE + SIEEXIT handling is >>> checking for. >>> >>> Assuming that's correct, I agree this problem doesn't exist, and there's >>> only the common RCU/tracing/lockdep management to fix. >> >> Will you provide an s390 patch in your next iteration or shall we then do >> one as soon as there is a v2? We also need to look into vsie.c where we >> also call sie64a > > I'm having a go at that now; my plan is to try to have an s390 patch as > part of v2 in the next day or so. > > Now that I have a rough idea of how SIE and exception handling works on > s390, I think the structural changes to kvm-s390.c:__vcpu_run() and > vsie.c:do_vsie_run() are fairly simple. > > The only open bit is exactly how/where to identify when the interrupt > entry code needs to wake RCU. I can add a per-cpu variable or thread > flag to indicate that we're inside that EQS, or or I could move the irq > enable/disable into the sie64a asm and identify that as with the OUTSIDE > macro in the entry asm. What exactly would the low-level interrupt handler need to do? CC Sven, Heiko for the entry.S changes. ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 0/5] kvm: fix latent guest entry/exit bugs 2022-01-18 14:15 ` [PATCH 0/5] kvm: fix latent guest entry/exit bugs Christian Borntraeger @ 2022-01-18 15:43 ` Mark Rutland 0 siblings, 0 replies; 2+ messages in thread From: Mark Rutland @ 2022-01-18 15:43 UTC (permalink / raw) To: Christian Borntraeger Cc: Sven Schnelle, Heiko Carstens, linux-s390, Paolo Bonzini, linux-kernel, aleksandar.qemu.devel, alexandru.elisei, anup.patel, aou, atish.patra, benh, bp, catalin.marinas, chenhuacai, dave.hansen, david, frankja, frederic, gor, imbrenda, james.morse, jmattson, joro, kvm, maz, mingo, mpe, nsaenzju, palmer, paulmck, paulus, paul.walmsley, seanjc, suzuki.poulose, tglx, tsbogend, vkuznets, wanpengli, will On Tue, Jan 18, 2022 at 03:15:51PM +0100, Christian Borntraeger wrote: > Am 18.01.22 um 14:12 schrieb Mark Rutland: > > On Tue, Jan 18, 2022 at 01:42:26PM +0100, Christian Borntraeger wrote: > > > > > > > > > Am 18.01.22 um 13:02 schrieb Mark Rutland: > > > > On Mon, Jan 17, 2022 at 06:45:36PM +0100, Paolo Bonzini wrote: > > > > > On 1/14/22 16:19, Mark Rutland wrote: > > > > > > I also think there is another issue here. When an IRQ is taken from SIE, will > > > > > > user_mode(regs) always be false, or could it be true if the guest userspace is > > > > > > running? If it can be true I think tha context tracking checks can complain, > > > > > > and it*might* be possible to trigger a panic(). > > > > > > > > > > I think that it would be false, because the guest PSW is in the SIE block > > > > > and switched on SIE entry and exit, but I might be incorrect. > > > > > > > > Ah; that's the crux of my confusion: I had thought the guest PSW would > > > > be placed in the regular lowcore *_old_psw slots. From looking at the > > > > entry asm it looks like the host PSW (around the invocation of SIE) is > > > > stored there, since that's what the OUTSIDE + SIEEXIT handling is > > > > checking for. > > > > > > > > Assuming that's correct, I agree this problem doesn't exist, and there's > > > > only the common RCU/tracing/lockdep management to fix. > > > > > > Will you provide an s390 patch in your next iteration or shall we then do > > > one as soon as there is a v2? We also need to look into vsie.c where we > > > also call sie64a > > > > I'm having a go at that now; my plan is to try to have an s390 patch as > > part of v2 in the next day or so. > > > > Now that I have a rough idea of how SIE and exception handling works on > > s390, I think the structural changes to kvm-s390.c:__vcpu_run() and > > vsie.c:do_vsie_run() are fairly simple. > > > > The only open bit is exactly how/where to identify when the interrupt > > entry code needs to wake RCU. I can add a per-cpu variable or thread > > flag to indicate that we're inside that EQS, or or I could move the irq > > enable/disable into the sie64a asm and identify that as with the OUTSIDE > > macro in the entry asm. > What exactly would the low-level interrupt handler need to do? Having looked around a bit, I think the best bet is to have irqentry_enter() check PF_VCPU in addition to PF_IDLE (which it checks via is_idle_task()), at which point nothing needs to change in the s390 entry code. I'm currently implementing that, let me have a go, and then we can see if that looks ok or whether we should do something else. > CC Sven, Heiko for the entry.S changes. I'll make sure you're all Cc'd when I send out vs with s390 patches. Thanks, Mark. ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-18 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220111153539.2532246-1-mark.rutland@arm.com>
[not found] ` <127a6117-85fb-7477-983c-daf09e91349d@linux.ibm.com>
[not found] ` <YeFqUlhqY+7uzUT1@FVFF77S0Q05N>
[not found] ` <ae1a42ab-f719-4a4e-8d2a-e2b4fa6e9580@linux.ibm.com>
[not found] ` <YeF7Wvz05JhyCx0l@FVFF77S0Q05N>
[not found] ` <b66c4856-7826-9cff-83f3-007d7ed5635c@linux.ibm.com>
[not found] ` <YeGUnwhbSvwJz5pD@FVFF77S0Q05N>
[not found] ` <8aa0cada-7f00-47b3-41e4-8a9e7beaae47@redhat.com>
[not found] ` <20220118120154.GA17938@C02TD0UTHF1T.local>
[not found] ` <6b6b8a2b-202c-8966-b3f7-5ce35cf40a7e@linux.ibm.com>
[not found] ` <20220118131223.GC17938@C02TD0UTHF1T.local>
2022-01-18 14:15 ` [PATCH 0/5] kvm: fix latent guest entry/exit bugs Christian Borntraeger
2022-01-18 15:43 ` Mark Rutland
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox