Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp527648ybl; Fri, 30 Aug 2019 03:25:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPCro7BB+9y2tsYonobAfIYAZtAsOquVZTkMq4+t3RXCCYb2j4Gn34/nDs8FxiE+TdkOma X-Received: by 2002:a63:cc4e:: with SMTP id q14mr1173253pgi.296.1567160754275; Fri, 30 Aug 2019 03:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567160754; cv=none; d=google.com; s=arc-20160816; b=gL0m/W7IsjIvu9rSR9nlKDQ94W6nAPGNCuoMGQ7GPuQqqWRroeq4EbQcrsPQeOk/BV xLVXFABbwD/jnmfOy/m0ADm4UTevO3gfbpYIUgLZWhH2G45qfHeq8WLptnxc7BCXpi2V RnpE/NHt4EVyK+YGwn48KXRB1BQ+oJ3RU4ZFZFUgp8F9jDQJ25Gww/l6+Y9eApM6vORw dyZCUISqdnbTb6gBaOpIYz8iZa7YxWTrirGUVRTucRv+KAjo9PIJul8JiMYWlOx3eNCO 6vkLl970Wuo2vuxhTpWWlGfeF5TbYCCg75/btJSXCrn+nQ6ctnMqDIMBS6qrNlvu7cIG cp5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KXJ36cnx9c2186DBLPWvfY+eo4eeTH0VYHUBKcn6AoA=; b=H6XNfF5+fFvS+LB7cDVfjyxTePO4UNY6Kn3OrFLt8jAbI4b1yVzzpyuRB5P1lHifB4 WUFJyLyOIZMdvBVRDlC4A+ZLzS27vmQfSgyOtaZ2mctQaGQEMbhEaOYbWnFF/SxP/MAk T2mgo+zPaijSvCAuVL9Oo7G8X+d5H0ZaRATz7j6vftXrgMKErBaQ+9PRTqFdsCivWpod GUa6Vs8ONQIRqXv6yo1JJLjXgjUt12xVAwJfYYJ2uwLHNsk3HXZutaolouNRs9uRQS7N TjeVGaROahPmGl40UIn73z5HTPtB72Kqyk+ZBgUPYIQFqOIynQVbFvNU0erJQ6S128Q7 Zeqg== 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 s14si5551770pfc.35.2019.08.30.03.25.39; Fri, 30 Aug 2019 03:25:54 -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 S1727887AbfH3KYk (ORCPT + 99 others); Fri, 30 Aug 2019 06:24:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:59036 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727417AbfH3KYj (ORCPT ); Fri, 30 Aug 2019 06:24:39 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B2AAFAFF1; Fri, 30 Aug 2019 10:24:38 +0000 (UTC) Date: Fri, 30 Aug 2019 12:24:36 +0200 From: Joerg Roedel To: Thomas Gleixner Cc: LKML , x86@kernel.org, Song Liu , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Rik van Riel Subject: Re: [patch V3 1/2] x86/mm/pti: Handle unaligned address gracefully in pti_clone_pagetable() Message-ID: <20190830102436.GG17192@suse.de> References: <20190828142445.454151604@linutronix.de> <20190828143123.971884723@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 28, 2019 at 11:54:55PM +0200, Thomas Gleixner wrote: > --- a/arch/x86/mm/pti.c > +++ b/arch/x86/mm/pti.c > @@ -330,13 +330,15 @@ pti_clone_pgtable(unsigned long start, u > > pud = pud_offset(p4d, addr); > if (pud_none(*pud)) { > - addr += PUD_SIZE; > + WARN_ON_ONCE(addr & ~PUD_MASK); > + addr = round_up(addr + 1, PUD_SIZE); > continue; > } > > pmd = pmd_offset(pud, addr); > if (pmd_none(*pmd)) { > - addr += PMD_SIZE; > + WARN_ON_ONCE(addr & ~PMD_MASK); > + addr = round_up(addr + 1, PMD_SIZE); > continue; > } > Reviewed-by: Joerg Roedel