From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by kanga.kvack.org (Postfix) with ESMTP id CAE3A6B0073 for ; Fri, 28 Feb 2014 06:52:26 -0500 (EST) Received: by mail-we0-f173.google.com with SMTP id w61so458886wes.32 for ; Fri, 28 Feb 2014 03:52:26 -0800 (PST) Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com. [195.75.94.110]) by mx.google.com with ESMTPS id fu7si1356729wjb.118.2014.02.28.03.52.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 28 Feb 2014 03:52:25 -0800 (PST) Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Feb 2014 11:52:23 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8562617D804E for ; Fri, 28 Feb 2014 11:52:54 +0000 (GMT) Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1SBq8VZ64421952 for ; Fri, 28 Feb 2014 11:52:08 GMT Received: from d06av06.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1SCqKXn011583 for ; Fri, 28 Feb 2014 05:52:20 -0700 Message-ID: <53107872.7030904@de.ibm.com> Date: Fri, 28 Feb 2014 12:52:18 +0100 From: Christian Borntraeger MIME-Version: 1.0 Subject: Re: [PATCH 2/4] mm, s390: Ignore MADV_HUGEPAGE on s390 to prevent SIGSEGV in qemu References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Alex Thorlton , linux-kernel@vger.kernel.org Cc: Gerald Schaefer , Martin Schwidefsky , Heiko Carstens , Andrew Morton , Paolo Bonzini , "Kirill A. Shutemov" , Mel Gorman , Rik van Riel , Ingo Molnar , Peter Zijlstra , Andrea Arcangeli , Oleg Nesterov , "Eric W. Biederman" , Alexander Viro , linux390@de.ibm.com, linux-s390@vger.kernel.org, linux-mm@kvack.org, linux-api@vger.kernel.org On 27/02/14 18:23, Alex Thorlton wrote: > As Christian pointed out, the recent 'Revert "thp: make MADV_HUGEPAGE > check for mm->def_flags"' breaks qemu, it does QEMU_MADV_HUGEPAGE for > all kvm pages but this doesn't work after s390_enable_sie/thp_split_mm. > > Paolo suggested that instead of failing on the call to madvise, we > simply ignore the call (return 0). > > Reported-by: Christian Borntraeger > Suggested-by: Paolo Bonzini > Suggested-by: Oleg Nesterov > Signed-off-by: Alex Thorlton > Cc: Gerald Schaefer > Cc: Martin Schwidefsky > Cc: Heiko Carstens > Cc: Christian Borntraeger > Cc: Andrew Morton > Cc: Paolo Bonzini > Cc: "Kirill A. Shutemov" > Cc: Mel Gorman > Cc: Rik van Riel > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Andrea Arcangeli > Cc: Oleg Nesterov > Cc: "Eric W. Biederman" > Cc: Alexander Viro > Cc: linux390@de.ibm.com > Cc: linux-s390@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-mm@kvack.org > Cc: linux-api@vger.kernel.org > > --- > mm/huge_memory.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index a4310a5..61d234d 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1970,6 +1970,15 @@ int hugepage_madvise(struct vm_area_struct *vma, > { > switch (advice) { > case MADV_HUGEPAGE: > +#ifdef CONFIG_S390 > + /* > + * qemu blindly sets MADV_HUGEPAGE on all allocations, but s390 > + * can't handle this properly after s390_enable_sie, so we simply > + * ignore the madvise to prevent qemu from causing a SIGSEGV. > + */ > + if (mm_has_pgste(vma->vm_mm)) > + return 0; > +#endif > /* > * Be somewhat over-protective like KSM for now! > */ > Tested-by: Christian Borntraeger -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org