lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 00/30] KVM: hardware enable/disable reorganize
    On Thu, Oct 13, 2022, Sean Christopherson wrote:
    > On Thu, Sep 22, 2022, isaku.yamahata@intel.com wrote:
    > > From: Isaku Yamahata <isaku.yamahata@intel.com>
    > >
    > > This patch series is to implement the suggestion by Sean Christopherson [1]
    > > to reorganize enable/disable cpu virtualization feature by replacing
    > > the arch-generic current enable/disable logic with PM related hooks. And
    > > convert kvm/x86 to use new hooks.
    >
    > Thanks for putting this together, actually seeing code is super helpful!
    >
    > Unfortunately, after seeing the code, I think my suggestion was a bad one. At
    > the end of this series, there's a rather gross amount of duplicate code between
    > x86 and common KVM, and no clear line of sight to improving things.
    >
    > Even if we move ARM, s390, and PPC away from the generic hooks, MIPS and RISC-V
    > still need the generic implementation, i.e. we'll still have duplicate code.
    >
    > Rather than force arch code to implement most/all power management hooks, I think
    > we can achieve a similar outcome (let ARM do its own thing, turn s390 and PPC into
    > nops) by wrapping the hardware enable/disable (and thus PM code) in a Kconfig,
    > e.g. KVM_GENERIC_HARDWARE_ENABLING.
    >
    > I'll throw together a rough prototype tomorrow (got partway through and then got
    > distracted by other stuff) and hopefully post an RFC series.

    Good news and bad news.

    Bad news:
    The KVM_GENERIC_HARDWARE_ENABLING idea is a bit of a bust. It works, but it's
    little more than a nice-to-have for s390 and PPC.

    Good news (from a certain point of view):
    The reason that the "generic h/w enabling" doesn't help much is because after sorting
    out the myriad issues in KVM initialization, which is even more of a bug-ridden mess
    than I initially thought, kvm_init() no longer has _any_ arch hooks. All the compat
    checks and whatnot are handled in x86, so tweaking those for TDX should be easier,
    or at the very least, we should have more options.

    Sorting everything out is proving to be a nightmare, but I think I have the initial
    coding done. Testing will be fun. It'll likely be next week before I can post
    anything.

    \
     
     \ /
      Last update: 2022-10-14 06:05    [W:4.392 / U:0.656 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site