Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1236328ybn; Wed, 25 Sep 2019 14:47:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZy91gm9Gr4blm22TeA9P5he0DAOYx56TCiqlqGliiWVvuJPF0dSV3nV/JGmHnwpjgAA/n X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr150349edw.256.1569448026275; Wed, 25 Sep 2019 14:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569448026; cv=none; d=google.com; s=arc-20160816; b=E/lU7OZlbf/2HkD5UwgXLhwFPqzaghEfCt0JB28PlPKIio32biQ0YvXirsCj1fNON1 niGYU6pZZw/ZnHnMcTyXMKUZfKjKCB/82sK3QPfolFgrpslKAoZqqS3JfgvrJIYtUVG1 N/Uqck0x9mF1p1YMFiKNAciTJB1MFpTrAGIdIjNEsG6nINX85ffLO1COWkoM83rlHSxU m+erHiHeLjh5n2/MghQIm+mGjp6vVOWVqXPHIN/h6SCRdDR3VLiJjCUlaeisxrP4JyX0 rTqOuo46nQ/Glz/gdLSzkUEMbFYONRraijcTqaIRNlbRmkFHt3nwCzhG6i8CqM2k0iAi 2+fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zQ+51unLbV9hA3rKMi8aVm2RWbZDEaSVIL9sF9/pHho=; b=mlgwzwoHmQFI09sapUDf6KSLqnG7v/dV7y7dBOGkY6bk2pYhHmkDCDmjr6joRCI/GV RAILc4E5tlaDO8muqjU0pHtfw3UAlDzd8se4umiReGzqZh6PIcDnN8aQ10XFo4VKlzCm Sk9QBnX683p3QQ36eDidTv5p2INrdHxY+dxF7ugHX39kSgnSvq0kF7kyIvUgBaUQIVaz 2hKXxquItP8d1NvWZopn7Ig6UJU1BW6SET+V3aOat1zim757YTpVCFl06cfmZu2dtu/V QxtQLjmko0YvmVquycyofOHV793Zrf9dtH2PDB3YAAmWPp/wi/pVNm9+huAs7H9GaS4K ixaQ== 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 u27si61471ejb.172.2019.09.25.14.46.42; Wed, 25 Sep 2019 14:47:06 -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 S1727376AbfIWSoD (ORCPT + 99 others); Mon, 23 Sep 2019 14:44:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46364 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726206AbfIWSoD (ORCPT ); Mon, 23 Sep 2019 14:44:03 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8NIbVCQ125700; Mon, 23 Sep 2019 14:43:51 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v70mspk4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Sep 2019 14:43:51 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8NIf4VX005965; Mon, 23 Sep 2019 18:43:50 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma02wdc.us.ibm.com with ESMTP id 2v5bg6ntk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Sep 2019 18:43:50 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8NIhnGi32047478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Sep 2019 18:43:49 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97186112061; Mon, 23 Sep 2019 18:43:49 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 98CBB112062; Mon, 23 Sep 2019 18:43:48 +0000 (GMT) Received: from LeoBras.aus.stglabs.ibm.com (unknown [9.18.235.184]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 23 Sep 2019 18:43:48 +0000 (GMT) From: Leonardo Bras To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Leonardo Bras , Paul Mackerras , Benjamin Herrenschmidt , Michael Ellerman Subject: [PATCH 0/3] Replace current->mm by kvm->mm on powerpc/kvm Date: Mon, 23 Sep 2019 15:43:29 -0300 Message-Id: <20190923184332.412-1-leonardo@linux.ibm.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-23_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=710 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909230160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org By replacing, we would reduce the use of 'global' current on code, relying more in the contents of kvm struct. On code, I found that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have tests like that: if (kvm->mm != current->mm) return -EIO; So this change would be safe. I split the changes in 3 patches, so it would be easier to read and reject separated parts. If decided that squashing is better, I see no problem doing that. Best regards, Leonardo Bras (3): powerpc/kvm/book3s: Replace current->mm by kvm->mm powerpc/kvm/book3e: Replace current->mm by kvm->mm powerpc/kvm/e500: Replace current->mm by kvm->mm arch/powerpc/kvm/book3s_64_mmu_hv.c | 4 ++-- arch/powerpc/kvm/book3s_64_vio.c | 6 +++--- arch/powerpc/kvm/book3s_hv.c | 10 +++++----- arch/powerpc/kvm/booke.c | 2 +- arch/powerpc/kvm/e500_mmu_host.c | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) -- 2.20.1