Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp41423img; Thu, 21 Mar 2019 13:37:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZrzsKu5PMw+Q1G555E+t9iY67x+GlhAzY590lrH/LORX0zTDRiDmph5QBL2ke8CUqhyYc X-Received: by 2002:a63:5c66:: with SMTP id n38mr5163259pgm.15.1553200638651; Thu, 21 Mar 2019 13:37:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553200638; cv=none; d=google.com; s=arc-20160816; b=XlMJIYJkcfYnbhAE8asrj+VYHXjENFpxAw4XOBmEvNjriET9x/uOeGfcUnsXlKY+/O dHsieQMMD4lg9Koj4Wqnn+vzwLesswuyp3TnMjoUEdf4pk/DKATs/MCxQYtHmFfbXRlx rFN2/QkwFPw8ny622dzDJyUzlqFfIQ1SUVYYeYW5mVwG+9zfiWdZZcXxHdNKwlHBj1ej nTkNH0DEMPxrzdJg5VPhOVHMld9zLqMF36hWq+/5ubKWG2af5EVncdyo0xhkV/s54u7c zXktHh7Qm9TPKK8HSjw6pHJbwj0RgzIB831PzNqagldF/owsTf2gjT6edQMLzZXz2a8q 0F5g== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=/XaJLHWkDvxZYXIfgkCsei9+hi+vCN/Lk8Ld/C6h3cg=; b=Kxuka6pwSm60pY7C6AbIf5iWJ9dKQSmJpOxXEl3thaCYETPnabdaJOnB0SjSu+o1UA wycVCSC3EN5T0UZTwy/E7UWGjHyo9mwT+aj0+4SNRC4wiyaXW98gwv+v22M9Worv/MDd vrX7kp2LYbXiwXeQcDv8m+a6biYHEOlkEvDY4qaVfF0i946nLhxirWAFggJNm7dHDVPA QY/PmgfYuZQBvZZAxvwZCxtg5RV0auWYs1Hlu3mHk0os8UlYoy3bBmyfPlK4GgkSW6C1 udLCORlyunqDnAtYl0ENVT/wBcSqKZNN9dLU5Ol+0nCX+Z6UUJqwVKD9+umfqftQAvwi 2sgQ== 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 e96si5323687plb.123.2019.03.21.13.37.00; Thu, 21 Mar 2019 13:37:18 -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 S1728900AbfCUUfy convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Mar 2019 16:35:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:39082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728769AbfCUUfx (ORCPT ); Thu, 21 Mar 2019 16:35:53 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A86802183E; Thu, 21 Mar 2019 20:35:51 +0000 (UTC) Date: Thu, 21 Mar 2019 16:35:50 -0400 From: Steven Rostedt To: Andrew Cooper Cc: Andy Lutomirski , Peter Zijlstra , Linus Torvalds , Jan Beulich , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , LKML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Joel Fernandes , He Zhe Subject: Re: [RFC][PATCH] tracing/x86: Save CR2 before tracing irqsoff on error_entry Message-ID: <20190321163550.21b29194@gandalf.local.home> In-Reply-To: References: <20190320221534.165ab87b@oasis.local.home> <20190321083317.GL6058@hirez.programming.kicks-ass.net> <20190321090241.GL6521@hirez.programming.kicks-ass.net> <20190321104517.GM6521@hirez.programming.kicks-ass.net> <20190321093242.4a948198@gandalf.local.home> <20190321172203.GS5996@hirez.programming.kicks-ass.net> <20190321183713.GX5996@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 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 Thu, 21 Mar 2019 20:00:19 +0000 Andrew Cooper wrote: > I'm afraid that I've not got the original context of this thread, but > I'm going to guess that something is resulting in a #PF before %cr2 > before it gets saved on the #PF path, and using a PVOP causes things to > explode? Actually it had nothing to do with PVOPs. It was tracing that caused it. We added tracepoints to irqs off and on (with a config enabled), and there's an option to allow taking user stack traces at any tracepoint. The tracing of irqs off happened at the start of the page fault entry, and by tracing the userspace stack (which can also fault) we corrupted the cr2 for the original page fault. The work now is to store that cr2 early on, but that requires doing it in assembly, and that's where PVOPs makes the solution hard. -- Steve > > If it helps in the short term, Xen will trap and emulate a mov from cr2 > instruction correctly.  Performance will surely suck, but it might be an > option if we need to rethink how this information is made available to > guests. > > Thanks, > > ~Andrew