Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1885142imu; Sat, 8 Dec 2018 09:12:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjT9c6AdB4tnCIbIZvtzj758yEANyLhy8EY5F9HnPPsuX55DniNGtz0Rqg9YMfqPIaWk8M X-Received: by 2002:a63:ae01:: with SMTP id q1mr5552681pgf.402.1544289172805; Sat, 08 Dec 2018 09:12:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544289172; cv=none; d=google.com; s=arc-20160816; b=xTEMFcr+GX7DgVlOul51JhhjY0bjUk7oYs1r0uDYd/4fl48QW3F/O9ULisrnanwNTA DdTkuwjqA6DeXfyKhW21r6EobN20JZ57BJIVkNCd98c3Yumb43wmIECsUQw9ng66jaod ZNoI4HoIu/Lh6mLPt+sRhEYdZPmuTxPodzVlDbneuycj3p8T20vxovmk9sE38EudWEfM ljWtwkk+/zq6fiJAaAuqc52voXWahG4r/EaQFje4K9P7nTEXMhSJ17o2CNMMS/Glm26/ eXL0SoFnMbY1EbB3V6zqNilxfdylA40TUA2lUPzVAfdTFT2ke3jDhBnyaH20gIW9URft QlKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=kMYKlNz6XT18PkpRm6LDqIhBnDufPvlo/jdFBd5In24=; b=xRNV/bsSQxd3vsOk+VCEYWtwCjdQN7I37pDztR+tprfv2kPvXhoZRWJ1Lyzl9tkmKa 2aOLDBGWFSyvmLDmfjm7iDjLVSfmUhOku4jpS1FLVjBo+QO+x7mdbejc4bDrTmYV96XP Gt2/BOO/ouzcqALVTUJjL3NDki3NQX1AgQE7hDK78WpdIoQOOsq9/QR0VkYiooPckYbV QfMVQkKvmM8Mavks+t3s6rcM9TWMj/pVwBNEAdYFY6+9qBzQTKWDTsqPKP6dS6TGYKSF WijOYoDecVibyAd/lwyx9dH1KoKiUw9hS0ltqb6S45KXzjrcv+v6CqdpX8rpq6zPNK1/ p/iA== 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 q20si5592300pll.255.2018.12.08.09.12.36; Sat, 08 Dec 2018 09:12:52 -0800 (PST) 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 S1726186AbeLHRMC (ORCPT + 99 others); Sat, 8 Dec 2018 12:12:02 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48596 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726159AbeLHRMC (ORCPT ); Sat, 8 Dec 2018 12:12:02 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB8H3tDs100924 for ; Sat, 8 Dec 2018 12:12:00 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p87sst1ek-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 08 Dec 2018 12:12:00 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 8 Dec 2018 17:11:59 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 8 Dec 2018 17:11:55 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB8HBsRM45678824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sat, 8 Dec 2018 17:11:55 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDD4EA4040; Sat, 8 Dec 2018 17:11:54 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A2935A404D; Sat, 8 Dec 2018 17:11:53 +0000 (GMT) Received: from rapoport-lnx (unknown [9.148.204.137]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sat, 8 Dec 2018 17:11:53 +0000 (GMT) Date: Sat, 8 Dec 2018 19:11:50 +0200 From: Mike Rapoport To: Geert Uytterhoeven Cc: Andreas Schwab , Michael Schmitz , Sam Creasey , Greg Ungerer , linux-m68k , Linux Kernel Mailing List Subject: Re: [PATCH v3] m68k: Fix memblock-related crashes References: <20181207165011.31497-1-geert@linux-m68k.org> <20181207210224.GA19067@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-TM-AS-GCONF: 00 x-cbid: 18120817-0008-0000-0000-0000029EBBFD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120817-0009-0000-0000-000022092B62 Message-Id: <20181208171143.GB19067@rapoport-lnx> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-08_05:,, 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812080160 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 08, 2018 at 11:51:38AM +0100, Geert Uytterhoeven wrote: > Hi Mike, > > On Fri, Dec 7, 2018 at 10:02 PM Mike Rapoport wrote: > > On Fri, Dec 07, 2018 at 05:50:11PM +0100, Geert Uytterhoeven wrote: > > > Sun-3 must be broken before this fix, as it fills in m68k_memory[0] in > > > config_sun3(), i.e. after m68k_parse_bootinfo(). > > > Sun-3 is not fixed by this fix, as it uses its own paging_init(), not > > > the one in motorola.c. > > > Fixing Sun-3 requires adding memblock_add()/memblock_reserve() calls to > > > the Sun-3 memory management code. > > > > I think that adding memblock_add() to config_sun3 would be sufficient, > > something like the diff below. This will make memblock aware of the > > available physical memory and it seems there no allocations in sun3 before > > paging_init(). > > > > diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c > > index 542c440..9a5b9dd 100644 > > --- a/arch/m68k/sun3/config.c > > +++ b/arch/m68k/sun3/config.c > > @@ -150,6 +150,7 @@ void __init config_sun3(void) > > > > m68k_num_memory=1; > > m68k_memory[0].size=*(romvec->pv_sun3mem); > > + memblock_add(memory_start, memory_end - memory_start); > > > > sun3_bootmem_alloc(memory_start, memory_end); > > } > > Thanks! > > It doesn't need a memblock_reserve() for the kernel, as memory_start is > already adjusted for that, right? Yes, unless I've missed something. > Anyone who can test this is on Sun-3? Thanks! > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds > -- Sincerely yours, Mike.