lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Jan 2023 07:43:25 +0100
From:   Juergen Gross <jgross@...e.com>
To:     "Srivatsa S. Bhat" <srivatsa@...il.mit.edu>,
        linux-kernel@...r.kernel.org, x86@...nel.org,
        virtualization@...ts.linux-foundation.org
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Alexey Makhalov <amakhalov@...are.com>,
        VMware PV-Drivers Reviewers <pv-drivers@...are.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        xen-devel@...ts.xenproject.org
Subject: Re: [PATCH] x86/paravirt: merge activate_mm and dup_mmap callbacks

On 16.01.23 05:27, Srivatsa S. Bhat wrote:
> 
> Hi Juergen,
> 
> On 1/12/23 7:21 AM, Juergen Gross wrote:
>> The two paravirt callbacks .mmu.activate_mm and .mmu.dup_mmap are
>> sharing the same implementations in all cases: for Xen PV guests they
>> are pinning the PGD of the new mm_struct, and for all other cases
>> they are a NOP.
>>
> 
> I was expecting that the duplicated functions xen_activate_mm() and
> xen_dup_mmap() would be merged into a common one, and that both
> .mmu.activate_mm and .mmu.dup_mmap callbacks would be mapped to that
> common implementation for Xen PV.
> 
>> So merge them to a common callback .mmu.enter_mmap (in contrast to the
>> corresponding already existing .mmu.exit_mmap).
>>
> 
> Instead, this patch seems to be merging the callbacks themselves...
> 
> I see that's not an issue right now since there is no other actual
> user for these callbacks. But are we sure that merging the callbacks
> just because the current user (Xen PV) has the same implementation for
> both is a good idea? The callbacks are invoked at distinct points from
> fork/exec, so wouldn't it be valuable to retain that distinction in
> semantics in the callbacks as well?
> 
> However, if you believe that two separate callbacks are not really
> required here (because there is no significant difference in what they
> mean, rather than because their callback implementations happen to be
> the same right now), then could you please expand on this and call it
> out in the commit message, please?

Would you be fine with:

   In the end both callbacks are meant to register an address space with the
   underlying hypervisor, so there needs to be only a single callback for that
   purpose.


Juergen

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ