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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 77752C433E0 for ; Wed, 3 Feb 2021 23:33:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C72964F43 for ; Wed, 3 Feb 2021 23:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233112AbhBCXdt (ORCPT ); Wed, 3 Feb 2021 18:33:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231817AbhBCXdo (ORCPT ); Wed, 3 Feb 2021 18:33:44 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91115C0613D6 for ; Wed, 3 Feb 2021 15:33:04 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id u15so744925plf.1 for ; Wed, 03 Feb 2021 15:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FpbgW7rtmmjCscKdb8waMS+fqmFonfo2h3bIyix3u8k=; b=HseEMzGwBjHS63hjA97s5FrMFHD49OI7KZPGOrs1GtGF0cPZBTiR66Lg19Zt12L+FF V2O3SpOfg2ottdMeRQXBdO6nOaka/q8HpK1lP8BHDOhaQ+bNSoY+YzXJqlBhEnL8OMts 9zCZx48hM/y/eyNi8C2k6sPonwuXBRfYpgpVYXUIbyjiqgU+HFviQ5sXIfz6wc5tlI0U bNipc+b02aabH1RdA8QGiOI3qHOQaDQZ7RsOWZGV856Rw/Ae+VqGHhWo9f10T9DYD2xj SMAbn5o7+z2FibC8xa4X/jRML9/Aj2EClLlGyMEUV1MygjJiv3LXaJnzdUQLEjUMv2ub sGgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FpbgW7rtmmjCscKdb8waMS+fqmFonfo2h3bIyix3u8k=; b=SpHF+0lOnFJWO5mrjI7WzPIltfDLuoCnJzrh/zlDYFi4Zk1aqQReKsgsqMbzW2IU8N 9rpYBHTLU9h9CrDXu2dT5kDBBPqQ5izDpi9/FzI4M5UeevEz45GlPpFgSQBtwJkjYfT8 qvgivihhfGtHunMjyQ62di/z1mYyQy/v3uRfGz4wgCdrgJ5oXSoHZmwAj24iWgfwPwsp MwyCcXqZHm2k0pEoiwqFYG6porlpMfWGni6lTwwmzrTwdn1uhhKtWnuaVt+kogGes8oy epplMJGRriuowuQSR6JSXAnBeyDXikaXXR1m35LmQ8wdJ/8Oq/ziRL7U5V7MvdpXai8R FfUA== X-Gm-Message-State: AOAM533FNKB6JTANN8hXkqd8RyPE+gztnGWqyp/XieUNPLdyleP9XvAn JUyqGzod3sYHhvogBi0jRi7qwA== X-Google-Smtp-Source: ABdhPJxTt0ohgIKYmq5hgmBxJWbTXdf6Kzz4ZYjcKi/ColjjVbo9TrXxQ8jTBI4gpRuuHuyxAyTDpQ== X-Received: by 2002:a17:90a:fc4:: with SMTP id 62mr5523521pjz.181.1612395183887; Wed, 03 Feb 2021 15:33:03 -0800 (PST) Received: from google.com ([2620:15c:f:10:a9a0:e924:d161:b6cb]) by smtp.gmail.com with ESMTPSA id y21sm3474132pfp.208.2021.02.03.15.33.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 15:33:03 -0800 (PST) Date: Wed, 3 Feb 2021 15:32:56 -0800 From: Sean Christopherson To: Kai Huang Cc: Dave Hansen , Paolo Bonzini , "Edgecombe, Rick P" , "linux-sgx@vger.kernel.org" , "kvm@vger.kernel.org" , "x86@kernel.org" , "corbet@lwn.net" , "luto@kernel.org" , "jethro@fortanix.com" , "wanpengli@tencent.com" , "mingo@redhat.com" , "b.thiel@posteo.de" , "tglx@linutronix.de" , "jarkko@kernel.org" , "joro@8bytes.org" , "hpa@zytor.com" , "jmattson@google.com" , "vkuznets@redhat.com" , "bp@alien8.de" , "Huang, Haitao" Subject: Re: [RFC PATCH v3 00/27] KVM SGX virtualization support Message-ID: References: <4b4b9ed1d7756e8bccf548fc41d05c7dd8367b33.camel@intel.com> <99135352-8e10-fe81-f0dc-8d552d73e3d3@intel.com> <475c5f8b-efb7-629d-b8d2-2916ee150e4f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Thu, Feb 04, 2021, Kai Huang wrote: > On Wed, 2021-02-03 at 09:46 -0800, Dave Hansen wrote: > > On 2/3/21 9:43 AM, Paolo Bonzini wrote: > > > On 03/02/21 18:36, Sean Christopherson wrote: > > > > I'm not at all opposed to preventing KVM from accessing EPC, but I > > > > really don't want to add a special check in KVM to avoid reading EPC. > > > > KVM generally isn't aware of physical backings, and the relevant KVM > > > > code is shared between all architectures. > > > > > > Yeah, special casing KVM is almost always the wrong thing to do. > > > Anything that KVM can do, other subsystems will do as well. > > > > Agreed. Thwarting ioremap itself seems like the right way to go. > > This sounds irrelevant to KVM SGX, thus I won't include it to KVM SGX series. I would say it's relevant, but a pre-existing bug. Same net effect on what's needed for this series.. I say it's a pre-existing bug, because I'm pretty sure KVM can be coerced into accessing the EPC by handing KVM a memslot that's backed by an enclave that was created by host userspace (via /dev/sgx_enclave).