Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1728212ybi; Fri, 12 Jul 2019 23:03:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeUe2Wz3XDBDB030hJmzkRcze95hc0TeRa4txhEQVicnSsaVXBtJ9t3P2nalm3HjrigImy X-Received: by 2002:a17:90a:28e4:: with SMTP id f91mr16034131pjd.99.1562997830229; Fri, 12 Jul 2019 23:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562997830; cv=none; d=google.com; s=arc-20160816; b=tw3YYJeneZzR6Y+DRiO7IA8H9yEH+m/eYi0xsvjstd0uvoYOlKtqHiRtuRhqkKkae8 KI9Wcrt8XoLgWTiJ96qHHx8MS12/I1fzym/ijuY/5S546uxxfRxP5d2Ca7sklhVV2dFl +Y64BpzWGPR7SSNMHi0o2PAyKJHEP3dO5szBxN35WMbP+IvxEQjXnY6kolarSCVsUzvU VjeGqizjqPHQdh4PLHJe3rDrzJsAFGb36VsPvY+iOGxnDqe85anBKPXpdLbo6zDRtzAg IYygoY1ntPWSPLdhMjWaqfNlao+2V3IBGVRMvzcDOrY3Cx0aF+VqmFUSKewzFjcsgbA2 xIpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=JS+LOrzK3gSmugkis4wHYRRzQV3uCTgVI4foOuDFIeE=; b=pbT6NwRAgmwehTcnRkIEGUucAfZ+yzs0x0cj8ca7+Gru2Wgz2ay48wNdOLwg+lU4Hh fBhQGXDTw2crINFUsS1KoXfA292Fdig+hGewvLaOyzlcjCPZnykKKSMQDrBd4GJUGZ0S B3WwT0jRk25b3ZClgvQgOQ7f4UflihObmjFFpq0+9NlXXtAmff5/3IJjOs6n5SNr+Omy 2+Cm/YX0L+4rf3930pdkcGd/qCFOdTJTNeddx2zfig2ExUn78yMvs29vbxOBLCjqlQ5X I0SdsvdjjBt5TNpaK0L4RWXwR8EAU2VzNRSpjMAlZqlq/8NZ5kC0hFeOpfDTmYi32qr4 jf+A== 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 w186si4232293pgd.176.2019.07.12.23.03.34; Fri, 12 Jul 2019 23:03:50 -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 S1727717AbfGMGBU (ORCPT + 99 others); Sat, 13 Jul 2019 02:01:20 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:10230 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726274AbfGMGBU (ORCPT ); Sat, 13 Jul 2019 02:01:20 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6D5uTTJ134084 for ; Sat, 13 Jul 2019 02:01:18 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2tq87uaawu-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 13 Jul 2019 02:01:18 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 13 Jul 2019 07:01:17 +0100 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 13 Jul 2019 07:01:15 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6D61ElN15532312 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Jul 2019 06:01:14 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D326DC6059; Sat, 13 Jul 2019 06:01:13 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0F0DC6061; Sat, 13 Jul 2019 06:01:10 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.85.135.203]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Sat, 13 Jul 2019 06:01:10 +0000 (GMT) From: Thiago Jung Bauermann To: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Alexey Kardashevskiy , Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho , Sukadev Bhattiprolu , Thiago Jung Bauermann Subject: [PATCH v2 10/13] powerpc/pseries/svm: Disable doorbells in SVM guests Date: Sat, 13 Jul 2019 03:00:20 -0300 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com> References: <20190713060023.8479-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19071306-8235-0000-0000-00000EB55D3F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011419; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01231434; UDB=6.00648705; IPR=6.01012726; MB=3.00027699; MTD=3.00000008; XFM=3.00000015; UTC=2019-07-13 06:01:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19071306-8236-0000-0000-0000465F36A8 Message-Id: <20190713060023.8479-11-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-13_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=948 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907130070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukadev Bhattiprolu Normally, the HV emulates some instructions like MSGSNDP, MSGCLRP from a KVM guest. To emulate the instructions, it must first read the instruction from the guest's memory and decode its parameters. However for a secure guest (aka SVM), the page containing the instruction is in secure memory and the HV cannot access directly. It would need the Ultravisor (UV) to facilitate accessing the instruction and parameters but the UV currently does not have the support for such accesses. Until the UV has such support, disable doorbells in SVMs. This might incur a performance hit but that is yet to be quantified. With this patch applied (needed only in SVMs not needed for HV) we are able to launch SVM guests with multi-core support. Eg: qemu -smp sockets=2,cores=2,threads=2. Fix suggested by Benjamin Herrenschmidt. Thanks to input from Paul Mackerras, Ram Pai and Michael Anderson. Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/platforms/pseries/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 3df46123cce3..95a5c24a1544 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c @@ -45,6 +45,7 @@ #include #include #include +#include #include "pseries.h" #include "offline_states.h" @@ -225,7 +226,7 @@ static __init void pSeries_smp_probe_xics(void) { xics_smp_probe(); - if (cpu_has_feature(CPU_FTR_DBELL)) + if (cpu_has_feature(CPU_FTR_DBELL) && !is_secure_guest()) smp_ops->cause_ipi = smp_pseries_cause_ipi; else smp_ops->cause_ipi = icp_ops->cause_ipi;