Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp5418227ybx; Sun, 10 Nov 2019 12:52:31 -0800 (PST) X-Google-Smtp-Source: APXvYqx+D8p08SK/e9TZz9QTf++jE9HOTQGiLzq2VMdgS4oPQWMArxbviBX4R/gjD64z/X1+a5Ka X-Received: by 2002:aa7:c98f:: with SMTP id c15mr22842495edt.98.1573419151353; Sun, 10 Nov 2019 12:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573419151; cv=none; d=google.com; s=arc-20160816; b=J7GVsIFKPyO/C7aNwMg5fCnPxGVOn9Oaow1Y/H23202gt99Apn+NsRjkWHjsPKhMh7 gEM3DuH7gCE+CShhl9GbS4WqHKkOjj0dEWz80+RE+Espsw706SjtwTqupEpdJJh6QJP0 EHafMLWYvBS/V2L4trE3KwWpuU7ERNKAHqr/GmpNeYKzBKzkuTBidWEVD419gr2E911V zrOpLPW3YeQkhtKXxy1iEQozWx+F35yH1I4uyBrCGbYpEDxtbKIpFGBjDZ5P+w7HCnTv Vt4YnE4F5gZquWhzXtCi0wqF3MgxSy64K5kqfbSVf7F9po+zxMWNIYaRWEnvHABO3Y+F EtGQ== 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=PYkUdq1QNwEYjmWnKj0EdSuQZBm50tV0WRMLPz5fi40=; b=U8mbEAwtnOTep98TSWOyXO9t/lWYBwP6Ho6Jik1MEQ/F6K6IVyLC1SHVXVLL0tpeVo N0VJWTpUQgzR4fCLgoXKqNXCrjRBhOhSSY2aGBLs5mE4LkI46TlgBRmC5ENX1/X+ZMKh 72LjSvbMt+cf9X91xXDrvCWEZ1/nZgoT9zWp8OF3vCTLuUStuw8Bi+lahJ+C+d/KePPr 6u6tAUNFSANfgA/LagcbK5MxvMntwOcU8sXZ3r/M3MCMhNAeW9t3aJtRlk1kixgRos/1 0wqQ7kZ3PClKAB2bNHJgu/Ys9Cb/VGQ++lzPN6LiDxq3Ypv06EhI7uJLsH6HsAoonSIE tvvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YjKrdXSA; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si9993027edb.23.2019.11.10.12.52.08; Sun, 10 Nov 2019 12:52:31 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=YjKrdXSA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbfKJUhC (ORCPT + 99 others); Sun, 10 Nov 2019 15:37:02 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:44402 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727032AbfKJUhC (ORCPT ); Sun, 10 Nov 2019 15:37:02 -0500 Received: by mail-il1-f194.google.com with SMTP id i6so10109337ilr.11 for ; Sun, 10 Nov 2019 12:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PYkUdq1QNwEYjmWnKj0EdSuQZBm50tV0WRMLPz5fi40=; b=YjKrdXSAahH1StV8EmSM0xqq4aLCOmXxLU+j1f4BFwlEJmyrOlP8RZba67nit3HqzZ DM0QOGvUfkHeJ0i1omMyHJ0v9iSEfXl49WzFAq70cWB6KBQF91bZV/aZ7PJDYo5vvjsl m8lqsOILU324B9CX+YylLNIqu+CqkNaL2lm4GmxdverQZZagLlK5LldN8LpbxzuwoOjk 0pPRitP0e2w3MEHCNpLzlYHyIV2jUULL7hRCoXLd6klTDgrgpxBHNxWt5VAJP6m0vOGn wVQVH7CDt3gNJvsHaLfqExGe/GjEMeQLmbEy16STAvESl8tCI9lljvE6NN8rMSnHRdeL S2GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PYkUdq1QNwEYjmWnKj0EdSuQZBm50tV0WRMLPz5fi40=; b=Oyp+9pP/HYHYb1Ej7yJsdAlO6NfontvzCr0PKey2SOssQvqiBEHY02mhFwAxk4SJMN +sCOVbPmeWyC8zYu74WLzz1dXznq402tGekqwUKyIh7SOphjeVV3N/7XUKBOPf7KNrWt 6Ys/D5B63JkaloGoSaXWbvjt1wN/t3oouIzpnb2obLRJvwY+Cte9QCowgblh9WB+p8cY xaBhq9ed66BQyJy6gelTy5uPq0e0rYA9Zll4JjB2qgz4jf0wFWZ7nwUW8S3iMDHZQFxH OA3wzgqg3fcNdDWJrhAaWJY/vjmi6gONO/awm8crYuCmwwZ+NEnSKELzH8pjZjwaDhC4 dG1w== X-Gm-Message-State: APjAAAUwkDG9ROOGZ7Ya+X2ObzM04lUpR65rhor0d/3Ck9g/v7oal1mI zY7p0Kuiw3K8JpxvXKTl2bQYpmrAhreDqOqupKs= X-Received: by 2002:a92:d7c2:: with SMTP id g2mr17371311ilq.81.1573418221372; Sun, 10 Nov 2019 12:37:01 -0800 (PST) MIME-Version: 1.0 References: <20191107205914.10611-1-deepa.kernel@gmail.com> <1672a5861c82c2e3c0c54b5311fd413a8eee5e64.camel@infradead.org> <8D8B600C3EC1B64FAD4503F0B66C61F23BB95B@SHSMSX103.ccr.corp.intel.com> <8D8B600C3EC1B64FAD4503F0B66C61F23BBA24@SHSMSX103.ccr.corp.intel.com> In-Reply-To: From: Deepa Dinamani Date: Sun, 10 Nov 2019 12:36:49 -0800 Message-ID: Subject: Re: [PATCH] intel-iommu: Turn off translations at shutdown To: "Zeng, Jason" Cc: David Woodhouse , "joro@8bytes.org" , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "Tian, Kevin" , Arnd Bergmann , rminnich@google.com 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 Sun, Nov 10, 2019 at 10:24 AM Deepa Dinamani wrote: > > On Fri, Nov 8, 2019 at 2:48 PM Deepa Dinamani wrote: > > > > > > > For VMM live update case, we should be able to detect and bypass > > > > > the shutdown that Deepa introduced here, so keep IOMMU still operating? > > > > > > > > Is that a 'yes' to Deepa's "if someone wants to make it conditional, we > > > > can do that" ? > > > > > > Yes, I think so. Thanks! > > > > Are these changes already part of the kernel like avoiding shutdown of > > the passthrough devices? device_shutdown() doesn't seem to be doing > > anything selectively as of now. > > I've posted the v2 without the conditional for now: > https://lore.kernel.org/patchwork/patch/1151225/ > > As a side topic, I'm trying to support https://www.linuxboot.org/. I > have a couple of more such cleanups coming. The VMM live updates and > linuxboot seem to have contradicting requirements and they both use > kexec. So kexec_in_progress doesn't seem like a sufficient indicator > to distinguish between the two. Do you already have an idea on how to > distiguish between them? Does a separate sys_reboot() command > parameter sound ok? Or, we could use the flags in the sys_kexec_load() > depending on how the live update feature is implemented. Also, the AMD driver disables iommu at shutdown already. So the live update feature is already broken on AMD. -Deepa