From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754425AbcA0KG7 (ORCPT ); Wed, 27 Jan 2016 05:06:59 -0500 Received: from www.linutronix.de ([62.245.132.108]:42173 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbcA0KGz (ORCPT ); Wed, 27 Jan 2016 05:06:55 -0500 Date: Wed, 27 Jan 2016 11:05:45 +0100 (CET) From: Thomas Gleixner To: Jan Beulich cc: mingo@elte.hu, hpa@zytor.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/mm: avoid premature success when changing page attributes In-Reply-To: <56A6615E02000078000CAC96@prv-mh.provo.novell.com> Message-ID: References: <56A6615E02000078000CAC96@prv-mh.provo.novell.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 25 Jan 2016, Jan Beulich wrote: Sorry, that changelog does not make any sense. > Since successful return from __cpa_process_fault() makes > __change_page_attr() exit early (and successfully), its caller needs to That has nothing to do with a successful return from __cpa_process_fault(). __change_page_attr() always returns immediately after calling __cpa_process_fault() no matter what the return code is. > be instructed to continue its iteration by adjusting ->numpages. And how is that instruction working? > While this already happens on one of __cpa_process_fault()'s successful exit > paths, the other needs this done similarly. Why? > This was in particular a problem when the top level caller passed zero for > "checkalias" (becoming the "primary" value for the other two mentioned > functions), as is the case in change_page_attr_set_clr() when the OR of > "mask_set" and "mask_clr" equals _PAGE_NX, as e.g. passed from > set_memory_{,n}x(). This is completely unparseable. Can you please describe the failure and the solution in a way, which lets one figure out what that means w/o studying the code in detail? Thanks, tglx