From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA485C433FE for ; Wed, 9 Dec 2020 15:00:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70D6423A5A for ; Wed, 9 Dec 2020 15:00:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70D6423A5A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gkPPEUj9PUl2MHSgOx9z37BeQs30fsPxjDqvdmuzfmQ=; b=Uv9ge1UlyeLlj2L5/28MS2xy0 8OVWglypde8gmK5qrUpzdfobNike4d/sMrxguw2YU3y5+rxYE6KjO11gFgT0NKXisJ6JDHQXfHU0P BXb0JerdIBSYxnKckCV8JK4ttDi28gMsoJu3vBFCJ3iVQ/4z/O7Oz2yX+KD8ivPpZ/Rc+EUTbo/ZQ U81mE3GpmkvByM/5JJfC7hjtlBM+kslVPOPLcfY2OkQo5RhzsjHX9iXMHx8K5nBmQnHi+fV7Ze6GK B6daTerEayfWj5LQMIhwFcZeZM+J+V4+G8s+HojIepUUtjYJcLM/NHKe0a2cquhFMBn3l9QMQb3Qz Py23fRQbA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn0vd-0000PQ-2A; Wed, 09 Dec 2020 14:58:53 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn0va-0000NC-Ig for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 14:58:51 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B9EvbGE047445; Wed, 9 Dec 2020 09:58:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=9rqM1yV5HCd1G1JHSlYx/u8/TFPCo5Lt6nrGr4WlAGg=; b=QHHx/e59DWoxkKOIq6hy3MNMT/oToB8KN0lfZ+NrMdtbNNMVaiT/Yw1wOoNhExXb5Si+ fYbl/Zyx/pOSHOxnsLcZ+fuZQvRsu8OlpgRa5avVb8p1flKYBNE1uRRupc1DkxBk+ZWz xZSikdy/IqTmq8NNWEPDCpJgYm3hjEynDunbg+mq7J2Kk+BqrrU3po+VUPndwLhYgqjj qJUiXWaAeJeTj6BtQayrxLkEKdInE6DdL89kAf+wOd/aCEK5q9+dZhXHD5nG4jxu+bsL ImKlHV2TxqmeJTiMYo5jHOk+4l+9ULN7dfCjq0UXft1vJOvvqsp9mPYw0UzAwqhrphRb yw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 35afekmgkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Dec 2020 09:58:39 -0500 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0B9EvpME049302; Wed, 9 Dec 2020 09:58:38 -0500 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 35afekmgk4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Dec 2020 09:58:38 -0500 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B9EqKQ6001485; Wed, 9 Dec 2020 14:58:36 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03fra.de.ibm.com with ESMTP id 3581u8pyy9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Dec 2020 14:58:35 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B9EvJM811010532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Dec 2020 14:57:19 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0BF24C06A; Wed, 9 Dec 2020 14:57:18 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 814FC4C050; Wed, 9 Dec 2020 14:57:18 +0000 (GMT) Received: from osiris (unknown [9.171.90.105]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 9 Dec 2020 14:57:18 +0000 (GMT) Date: Wed, 9 Dec 2020 15:57:17 +0100 From: Heiko Carstens To: Anshuman Khandual Subject: Re: [PATCH 3/3] s390/mm: Define arch_get_mappable_range() Message-ID: <20201209145717.GD7160@osiris> References: <1607400978-31595-1-git-send-email-anshuman.khandual@arm.com> <1607400978-31595-4-git-send-email-anshuman.khandual@arm.com> <20201208152709.GA26979@osiris> <7484e153-6c77-8325-6195-621fe144011e@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7484e153-6c77-8325-6195-621fe144011e@arm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343, 18.0.737 definitions=2020-12-09_13:2020-12-09, 2020-12-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 priorityscore=1501 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 mlxlogscore=999 suspectscore=1 impostorscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012090100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_095850_801426_D197C97A X-CRM114-Status: GOOD ( 28.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-s390@vger.kernel.org, Vasily Gorbik , david@redhat.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, Will Deacon , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 09, 2020 at 08:07:04AM +0530, Anshuman Khandual wrote: > >> + if (seg->end + 1 > VMEM_MAX_PHYS || seg->end + 1 < seg->start_addr) { > >> + rc = -ERANGE; > >> + goto out_resource; > >> + } > >> + ... > >> +struct range arch_get_mappable_range(void) > >> +{ > >> + struct range memhp_range; > >> + > >> + memhp_range.start = 0; > >> + memhp_range.end = VMEM_MAX_PHYS; > >> + return memhp_range; > >> +} > >> + > >> int arch_add_memory(int nid, u64 start, u64 size, > >> struct mhp_params *params) > >> { > >> @@ -291,6 +300,7 @@ int arch_add_memory(int nid, u64 start, u64 size, > >> if (WARN_ON_ONCE(params->pgprot.pgprot != PAGE_KERNEL.pgprot)) > >> return -EINVAL; > >> > >> + VM_BUG_ON(!memhp_range_allowed(start, size, 1)); > >> rc = vmem_add_mapping(start, size); > >> if (rc) > > Is there a reason why you added the memhp_range_allowed() check call > > to arch_add_memory() instead of vmem_add_mapping()? If you would do > > As I had mentioned previously, memhp_range_allowed() is available with > CONFIG_MEMORY_HOTPLUG but vmem_add_mapping() is always available. Hence > there will be a build failure in vmem_add_mapping() for the range check > memhp_range_allowed() without memory hotplug enabled. > > > that, then the extra code in __segment_load() wouldn't be > > required. > > Even though the error message from memhp_range_allowed() might be > > highly confusing. > > Alternatively leaving __segment_load() and vmem_add_memory() unchanged > will create three range checks i.e two memhp_range_allowed() and the > existing VMEM_MAX_PHYS check in vmem_add_mapping() on all the hotplug > paths, which is not optimal. Ah, sorry. I didn't follow this discussion too closely. I just thought my point of view would be clear: let's not have two different ways to check for the same thing which must be kept in sync. Therefore I was wondering why this next version is still doing that. Please find a way to solve this. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel