Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2826C433EF for ; Sun, 14 Nov 2021 22:37:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D76C261073 for ; Sun, 14 Nov 2021 22:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233593AbhKNWkl (ORCPT ); Sun, 14 Nov 2021 17:40:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28370 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbhKNWkT (ORCPT ); Sun, 14 Nov 2021 17:40:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636929442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x4YT30S8B3Cq0sBg53RRKKFsT3rjgCYg2jd6C8drWHE=; b=GEjgYX+Qn1ojKy58njT5p6xuwS3NXvyOEFYxMjDjyR11tmrGQsUpTJy3DFMr0UC4WXSs78 UTEH1Xk/nwrUFeu1mH0NwjwWWcEAt1jIUek5RszAzWfwSB3/NBBKjZUzHJqFe/x+elATmL d9QsaV/xlSmyFVsdR0zr61EwEiernIk= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-377-3-X8jA-INMm5i5g6L9rqiQ-1; Sun, 14 Nov 2021 17:37:21 -0500 X-MC-Unique: 3-X8jA-INMm5i5g6L9rqiQ-1 Received: by mail-wr1-f72.google.com with SMTP id q5-20020a5d5745000000b00178abb72486so2826423wrw.9 for ; Sun, 14 Nov 2021 14:37:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=x4YT30S8B3Cq0sBg53RRKKFsT3rjgCYg2jd6C8drWHE=; b=CfMj+fqQ4Uj5X+gTPCSzH4ekcbKyKT/Wb9f5eBKmq37PPnldsQMDs0ta9elZw04jZI 1wsZvXbFlmsVqqOtorH9J/NEk99g5dDsJOHQ0KqCziRbjxUooPc6dXUEIiNY6u/ybawK eQYM+brVxIdGdVHdSDmL6ieHfhrIVYcfq9RfsM7Fq3P0jJatjfHP4f271nBAelwGDLg5 TVQlp19rJD9ajQxNgOtzGmUvFbhndaN74dx7OygDyLerIUHaBBUajAdzhRZ8dcVTt4+E m756XIu8blFd2ulnQMshUmGoDKpcYLcTTVEX/DL5zqJESKlZFu/z/bGj3EhSJMM8/Jie 81tA== X-Gm-Message-State: AOAM532+3XXzkKCZ216U1M9Q2beE/MQVT7Y6DMxeUzW0QFKo1S4In+JI fF054dh7mww59bd5lU6ohPhb/FLFQGo6VYqOfNy4bOoLtX7Sl4jEvAhLf8wxLl+RbfjW1r814Na F2lBg9kJqlM8QJ3zVIgIW1u25 X-Received: by 2002:a05:600c:500d:: with SMTP id n13mr23666471wmr.174.1636929440189; Sun, 14 Nov 2021 14:37:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTdPCucF4deLdPv8e0iTIatgJZaRpLkkEqy+Aw1oSxfylMhpeTSFRvKeVkjK9aJjXcpriCuQ== X-Received: by 2002:a05:600c:500d:: with SMTP id n13mr23666459wmr.174.1636929440033; Sun, 14 Nov 2021 14:37:20 -0800 (PST) Received: from redhat.com ([2.55.156.154]) by smtp.gmail.com with ESMTPSA id z11sm12223014wrt.58.2021.11.14.14.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Nov 2021 14:37:19 -0800 (PST) Date: Sun, 14 Nov 2021 17:37:15 -0500 From: "Michael S. Tsirkin" To: Lukas Wunner Cc: Gerd Hoffmann , linux-pci@vger.kernel.org, Bjorn Helgaas , open list Subject: Re: [PATCH] pciehp: fast unplug for virtual machines Message-ID: <20211114173550-mutt-send-email-mst@kernel.org> References: <20211111090225.946381-1-kraxel@redhat.com> <20211114163958.GA7211@wunner.de> <20211114122249-mutt-send-email-mst@kernel.org> <20211114180604.GA23907@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211114180604.GA23907@wunner.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 14, 2021 at 07:06:04PM +0100, Lukas Wunner wrote: > On Sun, Nov 14, 2021 at 12:24:43PM -0500, Michael S. Tsirkin wrote: > > On Sun, Nov 14, 2021 at 05:39:58PM +0100, Lukas Wunner wrote: > > > Why does virtual hardware implement the Attention Button if it's > > > perceived as annoying? Just amend qemu so that it doesn't advertise > > > presence of an Attention Button to get rid of the delay. (Clear the > > > Attention Button Present bit in the Slot Capabilities register.) > > > > Because we want ability to request device removal from outside the > > guest. > > Please elaborate. Does "outside the guest" mean on the host? > How do you represent the Attention Button outside the guest > and route events through to the guest? The usual way, using kvm ioctls. > > > > An Attention Button doesn't make any sense for virtual hardware > > > except to test or debug support for it in the kernel. Just make > > > presence of the Attention Button optional and be done with it. > > > > > > You'll still be able to bring down the slot in software via the > > > "remove" attribute in sysfs. > > > > This requires guest specific code though. Emulating the attention button > > works in a guest independent way. > > It sounds like you're using the Attention Button because it does > almost, but not quite what you want for your specific use case. > Now you're trying to change its behavior in a way that deviates > from the spec to align it with your use case. > > Why don't you just trigger surprise-removal from outside the guest? > > Thanks, > > Lukas Because linux does not handle it well for all devices. Fixing that requires fixing all drivers. -- MST