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]
Message-ID: <20251118151005.9674Af1-hca@linux.ibm.com>
Date: Tue, 18 Nov 2025 16:10:05 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-s390@...r.kernel.org, borntraeger@...ibm.com,
        frankja@...ux.ibm.com, nsg@...ux.ibm.com, nrb@...ux.ibm.com,
        seiden@...ux.ibm.com, schlameuss@...ux.ibm.com, svens@...ux.ibm.com,
        agordeev@...ux.ibm.com, gor@...ux.ibm.com, david@...hat.com,
        gerald.schaefer@...ux.ibm.com
Subject: Re: [PATCH v3 15/23] KVM: s390: Add helper functions for fault
 handling

On Thu, Nov 06, 2025 at 05:11:09PM +0100, Claudio Imbrenda wrote:
> Add some helper functions for handling multiple guest faults at the
> same time.
> 
> This will be needed for VSIE, where a nested guest access also needs to
> access all the page tables that map it.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
> ---
>  arch/s390/include/asm/kvm_host.h |   1 +
>  arch/s390/kvm/Makefile           |   2 +-
>  arch/s390/kvm/faultin.c          | 148 +++++++++++++++++++++++++++++++
>  arch/s390/kvm/faultin.h          |  92 +++++++++++++++++++
>  arch/s390/kvm/kvm-s390.c         |   2 +-
>  arch/s390/kvm/kvm-s390.h         |   2 +
>  6 files changed, 245 insertions(+), 2 deletions(-)
>  create mode 100644 arch/s390/kvm/faultin.c
>  create mode 100644 arch/s390/kvm/faultin.h

...

> +int kvm_s390_faultin_gfn(struct kvm_vcpu *vcpu, struct kvm *kvm, struct guest_fault *f)
> +{

...

> +		scoped_guard(read_lock, &kvm->mmu_lock) {
> +			if (!mmu_invalidate_retry_gfn(kvm, inv_seq, f->gfn)) {
> +				f->valid = true;
> +				rc = gmap_link(mc, kvm->arch.gmap, f);
> +				kvm_release_faultin_page(kvm, f->page, !!rc, f->write_attempt);
> +				f->page = NULL;
> +			}
> +		}
> +		kvm_release_faultin_page(kvm, f->page, true, false);
> +
> +		if (rc == -ENOMEM) {
> +			rc = kvm_s390_mmu_cache_topup(mc);

If I'm not mistaken then gmap_link() -> dat_link() maps the possible -ENOMEM
return value of dat_entry() to -EAGAIN. So the case where -ENOMEM leads to a
kvm_s390_mmu_cache_topup() call will never happen.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ