Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp518599ybm; Mon, 20 May 2019 21:54:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFWlCpyowS5bkTijo8zvbsnYsy4hm6q1mLQOCxnAZA1w5XostDR2MsriAlklll3Z11d/We X-Received: by 2002:a65:5cca:: with SMTP id b10mr80063078pgt.444.1558414481481; Mon, 20 May 2019 21:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558414481; cv=none; d=google.com; s=arc-20160816; b=jChJk3/eTZXUlWSz25FRQJozDWGrtivSLahpWE/y+poBDWOtxGEWYf7ODa12vOXCKk 3b4YIs7y/o/CQKbI4ZFMLcnKsxS50H81vTnxWrDxn6jUahfQlGwm0cElZ8cRmoeva5ht 8BIsLqyyA8Poall0EhdeSQRlcFUoXKJW/Tjph8ADf+YuFPiQJqIRxIRjV4EiLqT7vzOR 0PFHxHCKLYph8I7pYpmV3euXrTJ6YqOVdelZqapFVrb7GY3sTLeWCB2DGsBzCXDpmz4d 8bfcrLKU8guc2heJUd69Xyx99wDYTwGOXUDXtgixHCmXFSIgrFak5euZEN+Mg4GKvddq 6SMw== 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=1Xf3vL5DZYe0PVKgR3bazF9U5+hJ651Wo48z4yojY6o=; b=vr9Jq44FRRAbv8qNz62wnXQFaj3Gts4gacpvoudKCj5x9Ag/5Z5G0v5FOgctvMG5JN 9zkwD58vjFcg+hZVJjmYN8JzAFDvyhMoVujXUSNPvtGmFKbzNlk/Zm7ki5hfgWw21GW6 AV/JCMri2GapVc2hjUNEgQQZtE5FhbKTjAEdUpJjdyrzHubRBK1owGjC5EfLWwKHA3eT Y1t7q5EXlcy3wt80f9wp7ne7R7mT/r4W0UteWxgSHGTQfyyBcw6SMqEstJfTeW2n5YIa Eq5CYSw2If2svc+jhS2H0K27jRTit56uMtTpOREEhF0F140ds2ectR/XGs+ix7hIsDve q5Zw== 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 s14si21359889pfa.91.2019.05.20.21.54.26; Mon, 20 May 2019 21:54:41 -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 S1727733AbfEUEw1 (ORCPT + 99 others); Tue, 21 May 2019 00:52:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:39358 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726047AbfEUEw0 (ORCPT ); Tue, 21 May 2019 00:52:26 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4L4qJGn037995 for ; Tue, 21 May 2019 00:52:25 -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 2sm8rakhhe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 21 May 2019 00:52:25 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 21 May 2019 05:52:24 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) 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) Tue, 21 May 2019 05:52:21 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4L4qJrQ10158396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 May 2019 04:52:19 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B2DDC6057; Tue, 21 May 2019 04:52:19 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67EFEC605A; Tue, 21 May 2019 04:52:03 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.80.203.157]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 21 May 2019 04:52:01 +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 , Thiago Jung Bauermann , Alexey Kardashevskiy Subject: [PATCH 05/12] powerpc/pseries: Add and use LPPACA_SIZE constant Date: Tue, 21 May 2019 01:49:05 -0300 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521044912.1375-1-bauerman@linux.ibm.com> References: <20190521044912.1375-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19052104-8235-0000-0000-00000E9C0A2F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011134; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01206343; UDB=6.00633450; IPR=6.00987310; MB=3.00026980; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-21 04:52:23 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052104-8236-0000-0000-000045A84ADE Message-Id: <20190521044912.1375-6-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-20_09:,, 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905210031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 9cc91d03ab62..854105db5cff 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c @@ -56,6 +56,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align, #ifdef CONFIG_PPC_PSERIES +#define LPPACA_SIZE 0x400 + /* * See asm/lppaca.h for more detail. * @@ -69,7 +71,7 @@ static inline void init_lppaca(struct lppaca *lppaca) *lppaca = (struct lppaca) { .desc = cpu_to_be32(0xd397d781), /* "LpPa" */ - .size = cpu_to_be16(0x400), + .size = cpu_to_be16(LPPACA_SIZE), .fpregs_in_use = 1, .slb_count = cpu_to_be16(64), .vmxregs_in_use = 0, @@ -79,19 +81,18 @@ static inline void init_lppaca(struct lppaca *lppaca) static struct lppaca * __init new_lppaca(int cpu, unsigned long limit) { struct lppaca *lp; - size_t size = 0x400; - BUILD_BUG_ON(size < sizeof(struct lppaca)); + BUILD_BUG_ON(sizeof(struct lppaca) > LPPACA_SIZE); if (early_cpu_has_feature(CPU_FTR_HVMODE)) return NULL; - lp = alloc_paca_data(size, 0x400, limit, cpu); + lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu); init_lppaca(lp); return lp; } -#endif /* CONFIG_PPC_BOOK3S */ +#endif /* CONFIG_PPC_PSERIES */ #ifdef CONFIG_PPC_BOOK3S_64