Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5545247yba; Mon, 13 May 2019 12:46:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2FfpKy0G7UQLxa/Em2l77deFZ1rw7rK7cAi+QB3qGyKQ2IZ6/KG4zpppA1GHZZImiMxrU X-Received: by 2002:a63:5608:: with SMTP id k8mr34139878pgb.393.1557776816468; Mon, 13 May 2019 12:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557776816; cv=none; d=google.com; s=arc-20160816; b=b7wuar/SXQFBu/ZIff/0DWJpEjv01TayVHXuqANF+1RV6La4H12OppucM59LeLEFwu gxwJ03frbnbnGmpLOb66OKDAH8NACDOI0VUIMSctOBgEs7ld+HLCqKof6vUAJxz3Wg6k xgZG2ml0Wgt3fvTyYiBFqIjH3dPkx9391AUAiAVEg22cimszuWKbjQEDq0/ohRQV/L0w gqxnXTPvXSdToCjSm0B36Dn/nxR2ZzXLyOHMFQdSAHcreQz9fC23OSA0yFH6YAp9jqKB Lw9uXuJn7BawLnOxQU9vZK8x1XoPaPvRongyyt2HeaKmFX9DYOuan0cnTeQz+F4Yn4Cu JRvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LhHnlBi3UxeQKoJppL4krbenEEFMQ12bElAL7PpzgOg=; b=nJzcbfmtgld8AqkBgu6bJeoMN50dk0CIoOU/7JfRkhATWKUeB/UBUON87GV/TZTAzD lax1NQdBS1+qJ7sd0dVU7Id31bKU5u9fB8qFBCoB2stHHOJfCWaoLPaF2/wSrtD95SAt iOkgwOcg7P+mbPRqpioPmWHjx4klaPdOEEmPodetQAaI4zFbHfQ6GnonepUDo8lSARzi O3hWJVzz5ldGsMXaF57uguXqEbQQBxEPmEFeBHdsspoLkHJZr/g3Tg2nXLavC7h9QxiA Sz6r6NHWNsxyyVnx/YIFb1ppRkDnMfC6mvd7yj4TDKFfEikOek6dK4tWnX3nUVLPakGs Ehew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Kr4h++I2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si20220339pgj.590.2019.05.13.12.46.40; Mon, 13 May 2019 12:46:56 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Kr4h++I2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbfEMSNt (ORCPT + 99 others); Mon, 13 May 2019 14:13:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbfEMSNs (ORCPT ); Mon, 13 May 2019 14:13:48 -0400 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AFB7C21473 for ; Mon, 13 May 2019 18:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557771227; bh=xJ43iv8JIVJV06BJOR4VuJn38wWKCPs7W85gx3/vesQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Kr4h++I20RzmmFkfWraxMrcWykCiUWMo5cD7jMZUl9TScjEnTaCNGSOpZQ712x9Es JiAUEzbZ2+437fzGeZMnpa+NXORIleALchDX+pLifwNBmHbDzh9hXNyOOpZK+nIkqf JVQfKpUHOI+nklMyMK7NzcpfAx5+BRYIXL99WiV8= Received: by mail-wm1-f41.google.com with SMTP id h11so275432wmb.5 for ; Mon, 13 May 2019 11:13:47 -0700 (PDT) X-Gm-Message-State: APjAAAUTYGqve5nP+rKXVh5SGPnarj1w9A/uuJ3bYUHuyRsNgqz5dRgw P/9O8QKgby/keRKtX1pWWI6UZVERUVi8TMzkxmzUyw== X-Received: by 2002:a1c:486:: with SMTP id 128mr15655411wme.83.1557771226305; Mon, 13 May 2019 11:13:46 -0700 (PDT) MIME-Version: 1.0 References: <1557758315-12667-1-git-send-email-alexandre.chartre@oracle.com> <1557758315-12667-7-git-send-email-alexandre.chartre@oracle.com> <64c49aa6-e7f2-4400-9254-d280585b4067@oracle.com> In-Reply-To: <64c49aa6-e7f2-4400-9254-d280585b4067@oracle.com> From: Andy Lutomirski Date: Mon, 13 May 2019 11:13:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC KVM 06/27] KVM: x86: Exit KVM isolation on IRQ entry To: Alexandre Chartre Cc: Andy Lutomirski , Paolo Bonzini , Radim Krcmar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , kvm list , X86 ML , Linux-MM , LKML , Konrad Rzeszutek Wilk , jan.setjeeilers@oracle.com, Liran Alon , Jonathan Adams Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 13, 2019 at 9:28 AM Alexandre Chartre wrote: > > > > On 5/13/19 5:51 PM, Andy Lutomirski wrote: > > On Mon, May 13, 2019 at 7:39 AM Alexandre Chartre > > wrote: > >> > >> From: Liran Alon > >> > >> Next commits will change most of KVM #VMExit handlers to run > >> in KVM isolated address space. Any interrupt handler raised > >> during execution in KVM address space needs to switch back > >> to host address space. > >> > >> This patch makes sure that IRQ handlers will run in full > >> host address space instead of KVM isolated address space. > > > > IMO this needs to be somewhere a lot more central. What about NMI and > > MCE? Or async page faults? Or any other entry? > > > > Actually, I am not sure this is effectively useful because the IRQ > handler is probably faulting before it tries to exit isolation, so > the isolation exit will be done by the kvm page fault handler. I need > to check that. > The whole idea of having #PF exit with a different CR3 than was loaded on entry seems questionable to me. I'd be a lot more comfortable with the whole idea if a page fault due to accessing the wrong data was an OOPS and the code instead just did the right thing directly. --Andy