From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Otte Subject: Re: [PATCH 0/9] S390x KVM support Date: Thu, 22 Oct 2009 13:10:37 +0200 Message-ID: <4AE03DAD.3000602@de.ibm.com> References: <1255963059-10298-1-git-send-email-agraf@suse.de> <4ADDE7E3.9090601@de.ibm.com> <4AE0210D.9020409@redhat.com> <98DC9E4C-7FFA-4F05-A2E8-0B5DF546891C@suse.de> <4AE02B8E.6070202@redhat.com> <8D99A5FD-8A2E-4DA9-90A5-6935F677F9FD@suse.de> <4AE02DE2.7010803@redhat.com> <4AE0327D.7010809@de.ibm.com> <4AE033E2.5090902@redhat.com> <4AE0376A.4070803@de.ibm.com> <4AE038BC.1070107@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: carsteno@linux.vnet.ibm.com, Alexander Graf , qemu-devel , uli@suse.de, Carsten Otte , hare@suse.de, KVM list To: Avi Kivity Return-path: Received: from mtagate1.uk.ibm.com ([194.196.100.161]:36935 "EHLO mtagate1.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753267AbZJVLKb (ORCPT ); Thu, 22 Oct 2009 07:10:31 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate1.uk.ibm.com (8.13.1/8.13.1) with ESMTP id n9MBARaa029588 for ; Thu, 22 Oct 2009 11:10:27 GMT Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id n9MBARSe3006652 for ; Thu, 22 Oct 2009 12:10:27 +0100 Received: from d06av03.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n9MBAQSU013897 for ; Thu, 22 Oct 2009 12:10:27 +0100 In-Reply-To: <4AE038BC.1070107@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > So why not do it for this instruction as well? Instead of updating the > psw, return a success/error code and let the kernel update psw. It's not a single instruction, but a set of reasons we need the psw in userspace: - for logging the instruction address on exits - to check if a wait-type psw is active, and if so to switch between: - enabled wait psws, where interrupts could wake the cpu (aka /halt, which needs to be handled in-kernel) - disabled wait psws, where CPUs are suspended due to cpu hotremove, system dump on panic - to handle cpus in stopped state, typically on regular reboots/shutdowns - for setting the condition code during implementation of: - all s/390 I/O instructions - IPI for restarting remote CPUs (that are not in KVM_RUN) - IPI for storing remote CPU status into the remote cpu's lowcore page - IPI for resetting remote CPUs - for all IPIs where the remote CPU is not known to the kernel, such as the detection loop for all 65535 cpu slots on startup of the guest kernel - for interpretion of service calls (usually to the machine's service processor) - virtio I/O The sweet thing about having the psw in userspace is that for almost all above reasons, there's nothing more than the psw that we need to have in order to perform that operation. Giving the 128-bit psw to userspace does simply save us having special cases for above list, with an exit_reason and a struct for each of them.