Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5614506imw; Wed, 20 Jul 2022 09:00:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sn21ldfqOgNvpc4aKdJuRAt6b+2yOSUgr/uecJERzoHTYqmKh0yvo3VbPT0sdCMV2FCSwI X-Received: by 2002:a63:1917:0:b0:419:b8e8:233 with SMTP id z23-20020a631917000000b00419b8e80233mr29005748pgl.271.1658332844213; Wed, 20 Jul 2022 09:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658332844; cv=none; d=google.com; s=arc-20160816; b=xYhkBO7W5lD/quD+TnbG0DJfE6LuIr/9Iv+dhoC9ye39/6Iz+bZ555eBaZFqD/VViu YL8oueAR/Ddq9cxIED14sKAfIHPBZmtU0E7jWEMqexQKFSBRIwLBJ9FBPQt/IEz8Jlx2 1p/lUeccsR7CExTWmBDNZzf/NRGWMhfRFOgakixW8UT39crLdhd8OGJ+Z+/SyOwSrrdf ioR4mmDNH68oLPpdt/xf+22bzy9ePgxSaxBTvpet8vWChscjjSCAJvcR7TKlsVThQBkI se1UfyxinDFmrraai26sYXlni8uSjRbxmk1LJHgthpeLLoSQK436GsJ9PsdYTyaj92fV 488w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=PxGJvhLtJuqRKmxgyWTr3dyw5v1u+NUlBmHboKdNo9s=; b=QhXTpVLy5FYAYMM5/XBHXq6vKQAFB6Kq3wMN1SUVoFVms3CiLOSoiWLZZOqmUGSAVR Vh3+GPjpg7GSO9ZZcGWnf/bjsGsb5W0rxKTlT9QBmiHgoGF1d2gp0M8Z8Itl6KwykLze qNXj52ccuXb7uOXWNtQ+F7IJn5M5Qc/VDUYeNA5xTxITdBXFJ5j1vcTvigX7bR8J1SX8 s3ZQ9hzyiF1xOAiLwlEE5myjizbjV8H4h7hbQvBl4FuAlbVPe0HK1A8bRG6LwfkflGuc dw8Z8PL411fnOGHmHZAy6NsuSpbSH2xLja2h34tlqJCFT3CVjMG2JlIfPKyU2KLphuPe x/sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=mWWCpocd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a170902e84700b0016a52b34991si2152578plg.113.2022.07.20.09.00.25; Wed, 20 Jul 2022 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=mWWCpocd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=semihalf.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbiGTPzM (ORCPT + 99 others); Wed, 20 Jul 2022 11:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232557AbiGTPzK (ORCPT ); Wed, 20 Jul 2022 11:55:10 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 517C61004 for ; Wed, 20 Jul 2022 08:55:08 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id 17so6500497pfy.0 for ; Wed, 20 Jul 2022 08:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PxGJvhLtJuqRKmxgyWTr3dyw5v1u+NUlBmHboKdNo9s=; b=mWWCpocdFnO3thggu3OhtEeoCRaOv3M5lOueJvcCQTDYgBpsXplJkCW9pyIUUD1KJo E1hjJYf//4wroHUvXHMsE89HyiUxh2cadFeyDwjm8H3bp+YubwWJMW6md4/xf7QxpeLT OiI539zgmrx3amHbiNUlt4Y+2Acmt60Q3rRp4hqagxGPa1rW250S91jBO3DN3OGjk+pC R5s9iq+e7RljNkCwuICuNxnAv6/U+3x+1uLG5epJ7fNFAjbHsg7h/uj+sQjR3AoxAHlk 4MFxlyk0PIdFFqfJnyzfhaozFX7vBmRSO8fReDtFSyaRdislkq+L19Vf2qT05MkQc8Zf 9Vig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PxGJvhLtJuqRKmxgyWTr3dyw5v1u+NUlBmHboKdNo9s=; b=4n6aGfXTP9RjsiIIWhEBRO10JG10dvdFV3waO5EAiWCRBx+q9zdh51BxElUQ7MlBJj 2Ta/jmkB8kI53NUU1kiejecxK4I39yRA4YBDHVmVsH4nRdP84EJ9rEg/Vqmll0QZf0oe wEykh2UqCWJ9Rd2rIqsjPHvfKb3mq0b0fxXKXek81L5v/BQxrZSc5YL5VFUeJd/OzaaZ qArhAkVpt757SihTrrYCneGErNkCuDvvoa2FiDVS0RM1beKpSHf1nWxc0lwwaUscZ+Z9 DR6mdmo9HeoP8OyMGYEzXoijOxv98jSUz8aCKYP9P9/PudX6DS0Uy/+zj8INdYl66gcB 1X0Q== X-Gm-Message-State: AJIora/+FPEj8sknLGkWBtGJerF99JH9kmreFdBuQ0FrZ0erqPkf63Fv FJFvxPj9fQPSpsRIl1JgfQc8ITel28waxSqjNhWd1Q== X-Received: by 2002:a63:e946:0:b0:41a:7350:6cd5 with SMTP id q6-20020a63e946000000b0041a73506cd5mr1530570pgj.247.1658332507848; Wed, 20 Jul 2022 08:55:07 -0700 (PDT) MIME-Version: 1.0 References: <20220707125329.378277-1-jaz@semihalf.com> <20220707125329.378277-2-jaz@semihalf.com> <352edf44-5983-403f-b8f8-5dfbd92ea32d@amd.com> In-Reply-To: <352edf44-5983-403f-b8f8-5dfbd92ea32d@amd.com> From: Grzegorz Jaszczyk Date: Wed, 20 Jul 2022 17:54:56 +0200 Message-ID: Subject: Re: [RFC PATCH 1/2] suspend: extend S2Idle ops by new notify handler To: "Limonciello, Mario" Cc: "Rafael J. Wysocki" , Linux Kernel Mailing List , Dmytro Maluka , Sean Christopherson , Dominik Behr , upstream@semihalf.com, Zide Chen , Len Brown , Hans de Goede , Mark Gross , Pavel Machek , Mika Westerberg , Sachi King , "open list:ACPI" , "open list:X86 PLATFORM DRIVERS" , "open list:HIBERNATION (aka Software Suspend, aka swsusp)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =C5=9Br., 20 lip 2022 o 17:22 Limonciello, Mario napisa=C5=82(a): > > >> It looks like you want suspend-to-idle to behave like S3 and it won't. > > > > In a way, yes, we compensate for the lack of something like PM1_CNT to > > trap on for detecting that the guest is suspending. > > We could instead force the guest to use S3 but IMO it is undesirable, > > since it generally does make a difference which suspend mode is used > > in the guest, s2idle or S3, e.g some drivers check which suspend type > > is used and based on that behaves differently during suspend. One of > > the example is: > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Feli= xir.bootlin.com%2Flinux%2Fv5.18.12%2Fsource%2Fdrivers%2Fgpu%2Fdrm%2Famd%2Fa= mdgpu%2Famdgpu_drv.c%23L2323&data=3D05%7C01%7Cmario.limonciello%40amd.c= om%7C7bdd972291324d03847e08da6a51ff4f%7C3dd8961fe4884e608e11a82d994e183d%7C= 0%7C0%7C637939197694682503%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ= IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3D5M1s= n3iRybQzSFi3ojQ4YTJuW41DlgJNl5sxbWEvLBQ%3D&reserved=3D0 > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Feli= xir.bootlin.com%2Flinux%2Fv5.18.12%2Fsource%2Fdrivers%2Fgpu%2Fdrm%2Famd%2Fa= mdgpu%2Famdgpu_acpi.c%23L1069&data=3D05%7C01%7Cmario.limonciello%40amd.= com%7C7bdd972291324d03847e08da6a51ff4f%7C3dd8961fe4884e608e11a82d994e183d%7= C0%7C0%7C637939197694682503%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJ= QIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DfIr= LmZAgpIRPYO4to4uYUoBSEWXmz1lr%2BTnR14kAfvM%3D&reserved=3D0 > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Feli= xir.bootlin.com%2Flinux%2Fv5.18.12%2Fsource%2Fdrivers%2Fgpu%2Fdrm%2Famd%2Fa= mdgpu%2Famdgpu_gfx.c%23L583&data=3D05%7C01%7Cmario.limonciello%40amd.co= m%7C7bdd972291324d03847e08da6a51ff4f%7C3dd8961fe4884e608e11a82d994e183d%7C0= %7C0%7C637939197694682503%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQI= joiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DSNsbm= pV4HrgA%2Bkff4JzRodNDzKvwM5tnkGDvrKO44dc%3D&reserved=3D0 > > > > Actually I recently was suggesting a change to add this detection to > another driver to set a policy and Rafael pushed back. He's actively > removing it from other places in the kernel. > > For amdgpu stuff you pointed above, are you wanting to pass through the > PCIe GPU device to a guest and then suspend that guest? Or is this just > illustrative? Just illustrative. I am not focused on amdgpu stuff right now. Thank you, Grzegorz > > For a dGPU I would expect it works, but I don't think passing an APU's > GPU PCIe endpoint would functionally work (there were bugs reported on > this I recall). > > That code path you point out only has special handling for APU when > headed to S0ix and that's because the GPU driver happens to be where the > control point is for some common silicon functions. If the bug I > mentioned about PCIe passthrough of the APU GPU endpoint to the guest is > fixed and the guest needs to do s0ix when the host doesn't we're going > to have other breakage to worry about because of that common silicon > functionality I mentioned.