[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250319152334.GLZ9rhdrBYW2yXRbY3@fat_crate.local>
Date: Wed, 19 Mar 2025 16:23:34 +0100
From: Borislav Petkov <bp@...en8.de>
To: Junaid Shahid <junaids@...gle.com>
Cc: Brendan Jackman <jackmanb@...gle.com>, akpm@...ux-foundation.org,
dave.hansen@...ux.intel.com, yosryahmed@...gle.com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, peterz@...radead.org, seanjc@...gle.com,
tglx@...utronix.de, x86@...nel.org
Subject: Re: [PATCH RFC v2 03/29] mm: asi: Introduce ASI core API
On Tue, Mar 18, 2025 at 03:48:47PM -0700, Junaid Shahid wrote:
> > Oh. Yeah. In my proposal below I had totally forgotten we had
> > asi_exit() in the context_switch() path (it is there in this patch).
> >
> > So we only need the asi_exit() in the KVM code in order to avoid
> > actually hitting e.g. exit_to_user_mode() in the restricted address
> > space.
> >
> > But... we can just put an asi_exit() there explicitly instead of
> > dumping all this weirdness into the "core API" and the KVM codebase.
> >
> > So... I think all we really need is asi_start_critical() and
> > asi_end_critical()? And make everything else happen as part of the
> > normal functioning of the entry and context-switching logic. Am I
> > forgetting something else?
>
> Yes, I think this should work.
Ok, what I read so far makes sense to me. That thing - modulo simplification
but even without it - is kinda clear and straight-forward:
ioctl(KVM_RUN) {
enter_from_user_mode()
asi_start()
while !need_userspace_handling()
asi_start_critical();
vmenter();
asi_end_critical();
}
asi_end()
exit_to_user_mode()
}
Lemme continue through the set.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists