Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1303587ybb; Fri, 20 Mar 2020 17:49:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvIk/WzyBdAD+pUmQ/YFcj7N0vBm8KlXxShvAV87Hh7DasmwdBYUITekEWfX0XvD72atu+0 X-Received: by 2002:aca:c70f:: with SMTP id x15mr8608898oif.80.1584751776089; Fri, 20 Mar 2020 17:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584751776; cv=none; d=google.com; s=arc-20160816; b=IpHaxteKbouwysnCFcgZ2ctf7G50wM276/NtvV9MOO/LIRU/LapBb59izZTmDQn+i7 3y4u6hHEKrx6+60EW0eD1MBc315mJqx+bLE6rqkoB3K4isrvRUgjcrGHhUbS2O4Rf9BP VfSgge8GP2EnJksn79RdvCaT1kPZF3MSqzzmL5yU0JsEyJXUaAc5VGQUeUYa5fUzVDUN AYrTYfoRKHPKzICyeh4GbW+3l5os3BR+k424PZ/Sl8kgqOwMziE7/Qnf6AGRrxm4rsDd Uy3A+pfTERbC73OcIS3kg5UxJPwSRseuLu7DA1bNIerDc8fyZGUSU0O76eBORxt6S/3r dvig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:cc:to:from :date; bh=Sr4b/r2tUOD2zln4pc/8aogOAystaQQNUMNobW5JNcc=; b=G2qoJZpl7KHdj9188M9Wk9ZvMEX1T6QKKz8jcBLyZ/+5+XZxwyKFaDfJDEKwWA92qW 9Fxh3pVFK1vDY9BFcX5aNh11G2ajFLcRayTap9exptLmg/UI6+GKJDS85MDmqhFHgaH4 CXuM4vZpy8ClBF8vR/cVQtu9Z4PBESPwJ37Ml9GIX98mY2W8xsOV3t3aQlhK5Z/zcHnb hKsIg1VMh4N29/A82fGlSTq1/JD1qf9hY1K0f38InyVw/EVJNdBDcdNBHEao65V+l+bS 8Y2MUKDm7en0FhWMFkNR1lOVvuE+ebsA+y6ZALtwfOP9tQLIfeiFnu6Yu+pKVwqTX3Af xQdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b68si3846108oii.117.2020.03.20.17.49.23; Fri, 20 Mar 2020 17:49:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727705AbgCUAsD (ORCPT + 99 others); Fri, 20 Mar 2020 20:48:03 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:26810 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726773AbgCUAsD (ORCPT ); Fri, 20 Mar 2020 20:48:03 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02L0aMTV134763 for ; Fri, 20 Mar 2020 20:48:02 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2yu7furs4h-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 20 Mar 2020 20:48:02 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 21 Mar 2020 00:48:00 -0000 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 21 Mar 2020 00:47:57 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 02L0ltuj39911824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Mar 2020 00:47:55 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C38FB11C04C; Sat, 21 Mar 2020 00:47:55 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AC0F11C04A; Sat, 21 Mar 2020 00:47:54 +0000 (GMT) Received: from oc0525413822.ibm.com (unknown [9.85.223.94]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sat, 21 Mar 2020 00:47:54 +0000 (GMT) Date: Fri, 20 Mar 2020 17:47:51 -0700 From: Ram Pai To: Laurent Dufour Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kvm-ppc@vger.kernel.org, Bharata B Rao Reply-To: Ram Pai References: <20200320102643.15516-1-ldufour@linux.ibm.com> <20200320102643.15516-3-ldufour@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200320102643.15516-3-ldufour@linux.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 20032100-4275-0000-0000-000003B005B6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20032100-4276-0000-0000-000038C53882 Message-Id: <20200321004751.GB5243@oc0525413822.ibm.com> Subject: Re: [PATCH 2/2] KVM: PPC: Book3S HV: H_SVM_INIT_START must call UV_RETURN X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.645 definitions=2020-03-20_08:2020-03-20,2020-03-20 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 mlxlogscore=868 suspectscore=2 bulkscore=0 phishscore=0 malwarescore=0 lowpriorityscore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2003200094 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 20, 2020 at 11:26:43AM +0100, Laurent Dufour wrote: > When the call to UV_REGISTER_MEM_SLOT is failing, for instance because > there is not enough free secured memory, the Hypervisor (HV) has to call secure memory, > UV_RETURN to report the error to the Ultravisor (UV). Then the UV will call > H_SVM_INIT_ABORT to abort the securing phase and go back to the calling VM. > > If the kvm->arch.secure_guest is not set, in the return path rfid is called > but there is no valid context to get back to the SVM since the Hcall has > been routed by the Ultravisor. > > Move the setting of kvm->arch.secure_guest earlier in > kvmppc_h_svm_init_start() so in the return path, UV_RETURN will be called > instead of rfid. > > Cc: Bharata B Rao > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Michael Ellerman > Signed-off-by: Laurent Dufour Reviewed-by: Ram Pai