Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1575233pxa; Thu, 6 Aug 2020 10:37:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc6ipGxlC5zhea1evgh0i2049E1xMGNCEa1e9DqE2djIYajkMNDsdDoIeXWKfnnPuZVDGP X-Received: by 2002:a17:906:f2cb:: with SMTP id gz11mr5270062ejb.58.1596735439777; Thu, 06 Aug 2020 10:37:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596735439; cv=none; d=google.com; s=arc-20160816; b=EGSfFycyzl7WdbRhi9yCHUoo4ge0g+KaevGfGEkN+GL6UKu1jzUvR+QMUaRqqvyG9b wbqm9icT7qwNup/FWAeAK/KxnUtKyu1MU2Dp8QOVDy4Cob2TPB+jak4+5OSTX/KsZ75D BLNNQF3g6trodSokiq/e//xpPbP6Pto5q1OH7+55FGFYJAiMt+zDl8E/0DOL+7Ob9CGu A47eIuQCQWfBjRF8R6xXvejjXX2t0fJeB0NuFYt5i1tQoBYHERiMj7nb4QUrPzEFhOWq 6yDLO9W6XT2OCwMUS28CEF+pJo6Hz1E4Zs8QmBeZR3sg/tsG5/6bslo+VabPRQzrdoMh k/qw== 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=xWs6Ffw3WpIeedVEGxgmLg1+uarFaPgN9gTHSd3ibmg=; b=cWd0ByxlWlGlr0Z3IveqYRMvkEfRTXkrI5scjqW1RFIpQ1fHPgmxu4rWFqnZrT2qXU H1q+CZK1PUVk7jZ4H5r8shy3c0mYj8JyzTB+GuQ1R9txLrnoWhDyadEt83w7+l51dE0B xED6EKRMtfGue+XwFljZh0LDybu6BjIjmfBld4NJBdCZimhblCO2d6ufqYbhXd5z+SXO yFwveS1rrYmQuNtYoBgtB1/+DbpAWlbIhaV6qf9nkfC/HTVyaIDYuXQs6cDJo7PDhRJe QuJndlSGeGuoPoBNhtgkgd4GIFKjcNtrfjwwF9TiBrLzOwUIlwva5MJDfBfaRzcB8GW1 I/bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h7MloIJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me17si3746751ejb.258.2020.08.06.10.36.56; Thu, 06 Aug 2020 10:37:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h7MloIJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730596AbgHFRgp (ORCPT + 99 others); Thu, 6 Aug 2020 13:36:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730443AbgHFRg3 (ORCPT ); Thu, 6 Aug 2020 13:36:29 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C01C061574 for ; Thu, 6 Aug 2020 10:36:29 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id k12so19983628otr.1 for ; Thu, 06 Aug 2020 10:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xWs6Ffw3WpIeedVEGxgmLg1+uarFaPgN9gTHSd3ibmg=; b=h7MloIJOtgd8oNMv9KiDhQ69SKAd0MGHCzbPV18/Axq05hG/Lf4Yd/8WmCguybwVfi w8eh5OFkmAX/tvplpoaVXn0OvcNNxw7LSnRNnxTdygO42DapwzcYU3bZbGEFdC3I+dHx TVE/M/hePiLA9rUDysYU8NV20KFE4WIEDoDTcvTKeVTGbeiGTDR41qT4yPCW4/q9P+ck NPaGnP70XjfFAWXhUjBGWQpOuR/+4FxscdbYWYMwd9Vd41KBJYDjapTuGIV5pJYHxyyB iCblLMlfT3wipepuRTpqpNBWg7y/0JuovsT4+iR4DqK4NslMxW24i9PNdEWkjES+E9mf qrGg== 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=xWs6Ffw3WpIeedVEGxgmLg1+uarFaPgN9gTHSd3ibmg=; b=nLu+VyGGIoTiEzH0+vb0uW0RMBcLvlNupsf9dvXJrS1IGLr9l55ElKNiogHURDjeEh WwbfNB4oGLGb+dXsztrn5SRZRv5S7Va0+spT/y2Y+SPdSZXY48oWLUYslzvb+6BOuH8M lMdt17OFRX2IIzGe0ZFXdVNEfdJRLo3kFjOwXx1z9D67tOWtXu72kP4rIjjz/ZanpdJ5 9qI6UpDQ2FRP9kU4NHIDAPcotlo1BcsAQMh0TU/FIztsCRA9WjiLrMFld0FqRyepXygJ fV9/4I01NqpkU/ijhmR9Tv5MtbYFHAO2TRFawNfzYN+21QFAWa900koC/t7gmq6Bp06J PLkw== X-Gm-Message-State: AOAM533vvPtiwQ8yoxrfUF2cIGz+gDDG3GTBVLNf2It6sqmRn2zmHGUI tDWYSNCTgQK2MbJxKEbGEOzdXSIu6l49+ZeF7RTRyg== X-Received: by 2002:a9d:22ca:: with SMTP id y68mr8043964ota.56.1596735388579; Thu, 06 Aug 2020 10:36:28 -0700 (PDT) MIME-Version: 1.0 References: <20200728143741.2718593-1-vkuznets@redhat.com> <20200728143741.2718593-3-vkuznets@redhat.com> <20200805201702-mutt-send-email-mst@kernel.org> In-Reply-To: <20200805201702-mutt-send-email-mst@kernel.org> From: Jim Mattson Date: Thu, 6 Aug 2020 10:36:16 -0700 Message-ID: Subject: Re: [PATCH 2/3] KVM: x86: introduce KVM_MEM_PCI_HOLE memory To: "Michael S. Tsirkin" Cc: Vitaly Kuznetsov , kvm list , Paolo Bonzini , Sean Christopherson , Wanpeng Li , Peter Xu , Julia Suvorova , Andy Lutomirski , LKML 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 Wed, Aug 5, 2020 at 5:18 PM Michael S. Tsirkin wrote: > > On Wed, Aug 05, 2020 at 10:05:40AM -0700, Jim Mattson wrote: > > On Tue, Jul 28, 2020 at 7:38 AM Vitaly Kuznetsov wrote: > > > > > > PCIe config space can (depending on the configuration) be quite big but > > > usually is sparsely populated. Guest may scan it by accessing individual > > > device's page which, when device is missing, is supposed to have 'pci > > > hole' semantics: reads return '0xff' and writes get discarded. Compared > > > to the already existing KVM_MEM_READONLY, VMM doesn't need to allocate > > > real memory and stuff it with '0xff'. > > > > Note that the bus error semantics described should apply to *any* > > unbacked guest physical addresses, not just addresses in the PCI hole. > > (Typically, this also applies to the standard local APIC page > > (0xfee00xxx) when the local APIC is either disabled or in x2APIC mode, > > which is an area that kvm has had trouble with in the past.) > > Well ATM from KVM's POV unbacked -> exit to userspace, right? > Not sure what you are suggesting here ... Sometimes, maybe. That's not the way the emulation of most VMX instructions works, should they access unbacked memory. Perhaps that's just a whole slew of bugs to be fixed. :-)