Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4820993imm; Mon, 18 Jun 2018 23:56:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ5okhn8Dmmncf8LerKQdgn+VLPYBdIYz53ko2jG8COjUzFe8+10ydAPcijRwpUPkz/dbBF X-Received: by 2002:a17:902:7c84:: with SMTP id y4-v6mr17229799pll.262.1529391376901; Mon, 18 Jun 2018 23:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529391376; cv=none; d=google.com; s=arc-20160816; b=CWg1OYFkowzipUgVOn99L77jtjfLwLafD0yC4Tf3ZoM8ZtMyU4z5YawCXaYX4LGh3F Xccic+dEYEvqp0oq7Rjg9T7T2RiKK1l9fHUYzVlOrmPEaNzOZXcChyk7rLx8Ta9Ky2ow 9otS3VGEE+JwLa+MnOHMoAowqRXi4a+Mm3mHXY/5U47wIdyruHto1n0WfRNcbncINKFk 8NviFQSC1afu5zkLrw9OlD+sgaCBXH+2TQicKc2uY8B3NDg5WPYAvzEOY7hnbom+rLZc eQO3vhOwPW0u3TAfqPAp58VY02q7pABoHuWkX9GMDS+YDhGFiz2w9pyNHw0bUUtdfLfu TO8g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :arc-authentication-results; bh=AgoPE1h2NhCKqKXoOIkTD24PrlsXU0j7X5Q5ckoiOe8=; b=JXfSCGDRwEJJ/beWkeQDwqjakGizB8AC0rnfJxyhYx4uV2xJRJMA2XCPVX+bTavmRt eVR6C9B4dVxoej7MnUuk5fPKDeMv0GRzfKQg4aH8ygcs3v8y/SksuKqD2mVRn/x0B6aN 6kC5japFf/VJddOBGWUp26S+s5rg05oLp1K5fwgyOlSpMSVMRfjm93lnx4AgHEBFhrSz MA1WMKHPHIo0AuZNPgBSuPkQF9xcqoF3ZOBYLJfOxCXvcGLoFDu1QI2AQf9T8YbOQmcW +mfu+3Ob2jPe11tzDAAtjzYl74OSPUJbKvkvU5unreEPAyjNoctQNlYpPxT98Nd72LJo xUhg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z73-v6si13623783pgd.122.2018.06.18.23.56.02; Mon, 18 Jun 2018 23:56:16 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937309AbeFSGxp convert rfc822-to-8bit (ORCPT + 99 others); Tue, 19 Jun 2018 02:53:45 -0400 Received: from mail-vk0-f68.google.com ([209.85.213.68]:38882 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755524AbeFSGxo (ORCPT ); Tue, 19 Jun 2018 02:53:44 -0400 Received: by mail-vk0-f68.google.com with SMTP id b77-v6so11035820vkb.5; Mon, 18 Jun 2018 23:53:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=V7r+pATa6Ig+qglvQVuu7ww7fKlKlT46vyKn2Rqg4YI=; b=PNeNDz2uH7vWh+cnB0aABfAtWEbTeciowhLiJGps7e3oVJ+oq9POf2H8PUJuPvQAW0 aVkjcLJ24z6REGyQdZiLLr0oXxAqR88QqopEiNBxfL36H/DzArQSgucZmVlnUVkx0Zvy GkaEfvpXWzcg9CN67MTNCaaDXnHBvnpYB9Mt4q2NbzHl3JrS0V722STGbiRqvXTQxkUA 4lfX1KZy80O25F7Vi3v+3dxNqZyPjGrP7dQ7WAxNtMs8G66KgJ2WL8uXdnjBkhPkm6O4 EqZMx/bTjPIyLJU4tZUDZnslNX/uitatBWOvT65nV0Hyv86JJVplLm4bOu4SAee104oh H4YA== X-Gm-Message-State: APt69E0DOQfHVnFotsfzscqJIm94Vb49p6xkL8eCdgid8qI4uaVSrEEE 0ayBY1K4BYfUNk58b5QdTe+Mgm+ajFkJcQ5gWgO6SsiY X-Received: by 2002:a1f:8307:: with SMTP id f7-v6mr8825902vkd.3.1529391223583; Mon, 18 Jun 2018 23:53:43 -0700 (PDT) MIME-Version: 1.0 References: <20180619004659.19864-1-gerg@linux-m68k.org> In-Reply-To: <20180619004659.19864-1-gerg@linux-m68k.org> From: Geert Uytterhoeven Date: Tue, 19 Jun 2018 08:53:32 +0200 Message-ID: Subject: Re: [PATCHv2] m68k: fix "bad page state" oops on ColdFire boot To: Greg Ungerer Cc: Matthew Wilcox , "Linux/m68k" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 19, 2018 at 2:47 AM Greg Ungerer wrote: > > Booting a ColdFire m68k core with MMU enabled causes a "bad page state" > oops since commit 1d40a5ea01d5 ("mm: mark pages in use for page tables"): > > BUG: Bad page state in process sh pfn:01ce2 > page:004fefc8 count:0 mapcount:-1024 mapping:00000000 index:0x0 > flags: 0x0() > raw: 00000000 00000000 00000000 fffffbff 00000000 00000100 00000200 00000000 > raw: 039c4000 > page dumped because: nonzero mapcount > Modules linked in: > CPU: 0 PID: 22 Comm: sh Not tainted 4.17.0-07461-g1d40a5ea01d5 #13 > > Fix by calling pgtable_page_dtor() in our __pte_free_tlb() code path, > so that the PG_table flag is cleared before we free the pte page. > > Note that I had to change the type of pte_free() to be static from > extern. Otherwise you get a lot of warnings like this: > > ./arch/m68k/include/asm/mcf_pgalloc.h:80:2: warning: ‘pgtable_page_dtor’ is static but used in inline function ‘pte_free’ which is not static > pgtable_page_dtor(page); > ^ > > And making it static is consistent with our use of this in the other > m68k pgalloc definitions of pte_free(). > > Signed-off-by: Greg Ungerer > CC: Matthew Wilcox CC: Matthew Wilcox Reviewed-by: Geert Uytterhoeven 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