[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e6025e28-ea93-458b-887f-925eab7cf260@redhat.com>
Date: Thu, 2 Nov 2023 12:01:41 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>,
Kai Huang <kai.huang@...el.com>
Cc: "viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
"brauner@...nel.org" <brauner@...nel.org>,
"oliver.upton@...ux.dev" <oliver.upton@...ux.dev>,
"chenhuacai@...nel.org" <chenhuacai@...nel.org>,
"paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
"palmer@...belt.com" <palmer@...belt.com>,
"maz@...nel.org" <maz@...nel.org>,
"mpe@...erman.id.au" <mpe@...erman.id.au>,
"willy@...radead.org" <willy@...radead.org>,
"anup@...infault.org" <anup@...infault.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
Xiaoyao Li <xiaoyao.li@...el.com>,
"kvm-riscv@...ts.infradead.org" <kvm-riscv@...ts.infradead.org>,
"mic@...ikod.net" <mic@...ikod.net>,
"liam.merwick@...cle.com" <liam.merwick@...cle.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
Isaku Yamahata <isaku.yamahata@...el.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"david@...hat.com" <david@...hat.com>,
"tabba@...gle.com" <tabba@...gle.com>,
"amoorthy@...gle.com" <amoorthy@...gle.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"michael.roth@....com" <michael.roth@....com>,
"kvmarm@...ts.linux.dev" <kvmarm@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
Vishal Annapurve <vannapurve@...gle.com>,
"vbabka@...e.cz" <vbabka@...e.cz>,
"mail@...iej.szmigiero.name" <mail@...iej.szmigiero.name>,
"yu.c.zhang@...ux.intel.com" <yu.c.zhang@...ux.intel.com>,
"qperret@...gle.com" <qperret@...gle.com>,
"dmatlack@...gle.com" <dmatlack@...gle.com>,
Yilun Xu <yilun.xu@...el.com>,
"isaku.yamahata@...il.com" <isaku.yamahata@...il.com>,
"ackerleytng@...gle.com" <ackerleytng@...gle.com>,
"jarkko@...nel.org" <jarkko@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
Wei W Wang <wei.w.wang@...el.com>
Subject: Re: [PATCH v13 09/35] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report
faults to userspace
On 11/1/23 18:36, Sean Christopherson wrote:
> A good example is KVM_RUN with -EINTR; if KVM were to return something other than
> -EINTR on a pending signal or vcpu->run->immediate_exit, userspace would fall over.
And dually if KVM were to return KVM_EXIT_INTR together with something
other than -EINTR.
> And purging exit_reason super early is subtly tricky because KVM's
> (again, poorly documented) ABI is that *some* exit reasons are preserved
> across KVM_RUN with vcpu->run->immediate_exit (or with a pending
> signal). https://lore.kernel.org/all/ZFFbwOXZ5uI%2Fgdaf@google.com
vcpu->run->immediate_exit preserves all exit reasons, but it's not a
good idea that immediate_exit behaves different from a pending signal on
entry to KVM_RUN (remember that immediate_exit was meant to be a better
performing alternative to KVM_SET_SIGNAL_MASK).
In principle, vcpu->run->immediate_exit could return KVM_EXIT_INTR
(perhaps even _should_, except that breaks selftests so at this point it
is ABI).
Paolo
Powered by blists - more mailing lists