From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C085DC43381 for ; Thu, 21 Mar 2019 20:00:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DD1C218A2 for ; Thu, 21 Mar 2019 20:00:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728711AbfCUUAW (ORCPT ); Thu, 21 Mar 2019 16:00:22 -0400 Received: from smtp.eu.citrix.com ([185.25.65.24]:19493 "EHLO SMTP.EU.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727881AbfCUUAW (ORCPT ); Thu, 21 Mar 2019 16:00:22 -0400 X-IronPort-AV: E=Sophos;i="5.60,254,1549929600"; d="scan'208";a="87682393" Subject: Re: [RFC][PATCH] tracing/x86: Save CR2 before tracing irqsoff on error_entry To: Andy Lutomirski , Peter Zijlstra CC: Linus Torvalds , Jan Beulich , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Steven Rostedt , LKML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Joel Fernandes , He Zhe 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> From: Andrew Cooper Openpgp: preference=signencrypt Autocrypt: addr=andrew.cooper3@citrix.com; prefer-encrypt=mutual; keydata= mQINBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABtClBbmRyZXcgQ29v cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPokCOgQTAQgAJAIbAwULCQgHAwUVCgkI CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4 SAm1UHNvmdfgL2/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/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAYkC HwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== Message-ID: Date: Thu, 21 Mar 2019 20:00:19 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/03/2019 18:39, Andy Lutomirski wrote: > On Thu, Mar 21, 2019 at 11:37 AM Peter Zijlstra wrote: >> On Thu, Mar 21, 2019 at 11:25:44AM -0700, Linus Torvalds wrote: >>> On Thu, Mar 21, 2019 at 11:21 AM Andy Lutomirski wrote: >>>> I dunno. Lots of people at least use to have serious commercial interest in it. >>> Yes, it used to be a big deal. But full virtualization has gotten a >>> lot more common and better. >>> >>>> Hey Xen folks, how close are we to being able to say "if you want to >>>> run a new kernel, you need to switch to PVH or similar"? >>> I'd also like to know if we could perhaps at least limit PV to just >>> the thing that people care most deeply about. >>> >>> For example, maybe people notice that they really deeply care about >>> the PV spinlocks because they help a lot for some loads, but don't >>> care so much about the low-level CPU PV stuff any more because modern >>> CPUs do _those_ things so well these days. >>> >>> So it might not be an all-or-nothing thing, but a gradual "let's stop >>> supporting xyz under PV, because it causes pain and isn't worth it". >> So Juergen recently introduced PARAVIRT_XXL, which are exactly those >> bits of PV we can get rid of. >> >> This paravirt-me-harder config does indeed include the CR2 bits. >> >> I recently talked to Andrew Cooper about this, and he said Xen Dom0 >> still needs all this :/ > There were patches from last year to fix that: > > https://lwn.net/Articles/753982/ > > I have no clue what the status is. I'm sorry to say that Xen PV is not going to die any time soon (as far as Xen is concerned). For customer VMs, using the VT-x/SVM hardware extensions is definitely the way to go, but for host level operations, the difference between syscall vs vmexit, or (not) having to do an EPT flush make an overwhelming difference in performance. Our PVH virtualisation mode, including for dom0, is making good progress.  With Xen 4.12 and Linux 4.19+, a lot of basic functionality now does work.  However, we've got 15 years of legacy problems to try and untangle while doing this, including (but not limited to) Linux (rather than Xen) being OSPM, or the fact that using virtual addresses for hypercalls and mappings should never have propagate beyond the PV ABI when HVM came along. Even with the legacy API/ABI issues fixed, the straight performance difference between root mode operations, and vmexits, means that it is by no means a certainty that a PVH dom0 will be the best option for systems to use. 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? 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