All of lore.kernel.org
 help / color / mirror / Atom feed
From: Carsten Otte <cotte@de.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tossati <mtosatti@redhat.com>,
	borntrae@linux.vnet.ibm.com, heicars2@linux.vnet.ibm.com,
	mschwid2@linux.vnet.ibm.com, huckc@linux.vnet.ibm.com,
	KVM <kvm@vger.kernel.org>,
	Joachim von Buttlar <joachim_von_buttlar@de.ibm.com>,
	Jens Freimann <jfrei@de.ibm.com>,
	agraf@suse.de
Subject: Re: [patch 07/11] [PATCH] kvm-s390-ucontrol: interface to inject faults on a vcpu page table
Date: Wed, 04 Jan 2012 17:09:43 +0100	[thread overview]
Message-ID: <4F0479C7.4060500@de.ibm.com> (raw)
In-Reply-To: <4F0467BE.8010908@redhat.com>

On 04.01.2012 15:52, Avi Kivity wrote:
> On 01/04/2012 11:25 AM, Carsten Otte wrote:
>> This patch allows the user to fault in pages on a virtual cpus
>> address space for user controlled virtual machines. Typically this
>> is superfluous because userspace can just create a mapping and
>> let the kernel's page fault logic take are of it. There is one
>> exception: SIE won't start if the lowcore is not present. Normally
>> the kernel takes care of this [handle_validity() in
>> arch/s390/kvm/intercept.c] but since the kernel does not handle
>> intercepts for user controlled virtual machines, userspace needs to
>> be able to handle this condition.
>
> There is an alternative, if you can recognize this condition exactly
> from the hardware fault, you can fault the lowcore yourself and retry.
> This eliminates a user interface.  Is this workable?
The situation is very easy to detect, SIE won't start and it'll tell
us in the intercept info (processed in userspace in case of ucontrol) 
that the lowcore is not mapped in. Now userspace can a) create a
mapping of a guest to user space for the vcpu using KVM_S390_UCAS_MAP
which will create an invalid segment table entry (pmd), and b) touch the
page to make the pte for it valid in user space, but it cannot create a
segment table entry (pmd) on the guest table that points to the page
table that is shared between both spaces.
It is an optimization that KVM_S390_UCAS_MAP does'nt create a whole
page table right away. If we did that, we'd run out of memory pretty
fast once our regression runs simulate a couple of mainframes in
parallel with some terabytes of simulated memory each.


  reply	other threads:[~2012-01-04 16:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-04  9:25 [patch 00/11] Ucontrol patchset respin without storage keys Carsten Otte
2012-01-04  9:25 ` [patch 01/11] [PATCH] kvm-s390: add parameter for KVM_CREATE_VM Carsten Otte
2012-01-04  9:25 ` [patch 02/11] [PATCH] kvm-s390-ucontrol: per vcpu address spaces Carsten Otte
2012-01-04  9:25 ` [patch 03/11] [PATCH] kvm-s390-ucontrol: export page faults to user Carsten Otte
2012-01-04  9:25 ` [patch 04/11] [PATCH] kvm-s390-ucontrol: export SIE control block " Carsten Otte
2012-01-04  9:25 ` [patch 05/11] [PATCH] kvm-s390-ucontrol: disable in-kernel handling of SIE intercepts Carsten Otte
2012-01-04  9:25 ` [patch 06/11] [PATCH] kvm-s390-ucontrol: disable in-kernel irq stack Carsten Otte
2012-01-04  9:25 ` [patch 07/11] [PATCH] kvm-s390-ucontrol: interface to inject faults on a vcpu page table Carsten Otte
2012-01-04 14:52   ` Avi Kivity
2012-01-04 16:09     ` Carsten Otte [this message]
2012-01-04 16:34       ` Carsten Otte
2012-01-04 17:25         ` Avi Kivity
2012-01-04  9:25 ` [patch 08/11] [PATCH] kvm-s390-ucontrol: disable sca Carsten Otte
2012-01-04  9:25 ` [patch 09/11] [PATCH] kvm-s390: fix assumption for KVM_MAX_VCPUS Carsten Otte
2012-01-04  9:25 ` [patch 10/11] [PATCH] kvm-s390-ucontrol: announce capability for user controlled vms Carsten Otte
2012-01-04  9:25 ` [patch 11/11] [PATCH] kvm-s390: Fix return code for unknown ioctl numbers Carsten Otte
2012-01-04 14:54 ` [patch 00/11] Ucontrol patchset respin without storage keys Avi Kivity
2012-01-04 14:56   ` Avi Kivity
2012-01-05 13:41 ` Marcelo Tosatti
2012-01-05 13:47   ` Marcelo Tosatti
2012-01-05 15:24     ` Carsten Otte
2012-01-09 12:19 ` Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0479C7.4060500@de.ibm.com \
    --to=cotte@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=borntrae@linux.vnet.ibm.com \
    --cc=heicars2@linux.vnet.ibm.com \
    --cc=huckc@linux.vnet.ibm.com \
    --cc=jfrei@de.ibm.com \
    --cc=joachim_von_buttlar@de.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mschwid2@linux.vnet.ibm.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.