Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp328608iol; Thu, 9 Jun 2022 04:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwvkjIf7gXRtqHW7PR50psXXSiLrc0PvAF6gOELUyGNNnFrdQvtYoJcjC4x4MnrygzhBsw X-Received: by 2002:a17:90a:7023:b0:1e8:a692:b3e9 with SMTP id f32-20020a17090a702300b001e8a692b3e9mr3102297pjk.176.1654775453579; Thu, 09 Jun 2022 04:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654775453; cv=none; d=google.com; s=arc-20160816; b=S+sxldxiSAwO2fCefMMqZZ/4OjirqOKCVxOv8UUJbvWCnI+gR183CwutGfpv2z6ndY eoUMIJPotM6ETGDCF9Ke/iWJtNV9btJH0OWrqEHjVTb5jQ8lxGheS4mJAYSA3eG1zHsN 5c3L6wlFiHSeRVCPGpdNVabXqNAHkCsqDlWxFj6GfVfyEqVxnplElh6XuevG9X/7t7ue LWr2lFoj7vAqVgKUo1zfr/Sqvx0vteCDxs5OBuUOkc96gsVSllXRdvXGdDWyycKe4smw 2gIiYeaIZ6TXqWlqNb5g5QbGyKJErsmkwE2XdFzmU7zFEyMg1iIS4Vn6O6PAElCCF21N 7C5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8uYu8lJiNuFARRdH3Dv0gK66JWjRf/8va0hEQMAWSVE=; b=yJ1+3H1jY5ykeGJhn4VDPzGkxyw4SLsjSC3zfrnR3eWwAnxseOab78zJ2NwaFpMv7w uFc94wKRLi1zeH3s+u4ohDuXT8Ds00+8vffQF2lwX37zxyzpQPZjAvn5k6XrMflhFV3H +wKHCibZmyZj37SJ3UurRoVWHXlTu8vl/crR4DNjWFxfxsTgfUTFXhJ5JFGZiKCigvtY e5S+d4V1jhaFquYx/K9PAwS9G+5jdhQ1tpiwwHwt3wj7bQIWxPuDLNkfFIjpDPptEmTW 4zA9EvjvzhLcFTwXDDrYUTJhxelii4puY3wv/G8wGp/kEF1lnrwhmgqhqFboYFWoKtmn S2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=EMsI0ApU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020aa79616000000b0051c72bb7666si4571731pfg.315.2022.06.09.04.50.38; Thu, 09 Jun 2022 04:50:53 -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=EMsI0ApU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243366AbiFILEE (ORCPT + 99 others); Thu, 9 Jun 2022 07:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243353AbiFILEA (ORCPT ); Thu, 9 Jun 2022 07:04:00 -0400 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4FC36E1F for ; Thu, 9 Jun 2022 04:03:56 -0700 (PDT) Received: by mail-lj1-x22a.google.com with SMTP id m25so22405767lji.11 for ; Thu, 09 Jun 2022 04:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8uYu8lJiNuFARRdH3Dv0gK66JWjRf/8va0hEQMAWSVE=; b=EMsI0ApUkRgweNKPg6JQ59+57gorw/10/iLwDPMox+DFf4tFX79NVzId4ZnoYaSeIo ItBVH0yUXDl/dOKnowxrWthfkBO14pmFh/pObvY6R0XlN9RXXcUOJdXlciyD9tbNE/mb 7DoUyRDn5YzZDhSgtQYR+fraUF/bEIhS/QWB0o30u0oAZR49OSDY0FkV1Yg3zUxN0xoD BUuJbojVzCL4rxEeIqfAcpRmngggYe/yr0HDMluZjStSaKFZbviwIT3BhLa2OtxLMKlA 9HWXRq6Wg8xi1TBsjlw/rPqpLweQiO/oDugVTY7SsZXfCNHHWJ2N37A3QNlSw/qAG6QG F+wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8uYu8lJiNuFARRdH3Dv0gK66JWjRf/8va0hEQMAWSVE=; b=yCMbuB6hpv8Sr2XPUOY1V2+vAyBU60bOKP6SOJKoVRBrOUp/bu2tltyW5Dn+cCxS0L t+AUXrLLH2w25sLA2umer29VVvC7YvuReJUTRJ/+t71pIrLvY+LvL0Db7TnHGe/iqPuI mSx81dcF8+KRc0j7B6ovo+lZjhyvuw1V1LVAg91J3CFYtRKbxuXnpygTJqD76cfV7i1W f00KtAaNrlk/+3sGICJN6uLqfCrlqhO0NLz6XvkibLY+dN/dNffUQP77SbtgE/dM/sJx 3lRzzHmwgmxUfdIMFDu9fU71mGc19zqRUP1x3j7Q/oL2b+wzR8a0LoFk6XyELFm5XqJ2 VZYQ== X-Gm-Message-State: AOAM531kc7KDl0rsnGZzYmXFzCkkiVYej797vSg12Xto5/Yj+PilpDVV HYUy1w5WpSIKmeC5m8yYijY91CQJFLn/AwE5 X-Received: by 2002:a2e:b5c5:0:b0:255:5ba4:4892 with SMTP id g5-20020a2eb5c5000000b002555ba44892mr26027566ljn.3.1654772633411; Thu, 09 Jun 2022 04:03:53 -0700 (PDT) Received: from jazctssd.c.googlers.com.com (138.58.228.35.bc.googleusercontent.com. [35.228.58.138]) by smtp.gmail.com with ESMTPSA id a10-20020a194f4a000000b004793605e59dsm2116674lfk.245.2022.06.09.04.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 04:03:52 -0700 (PDT) From: Grzegorz Jaszczyk To: linux-kernel@vger.kernel.org Cc: jaz@semihalf.com, dmy@semihalf.com, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Steve Rutherford , Zide Chen , Peter Fang , Ashish Kalra , Mario Limonciello , Pratik Vishwakarma , Hans de Goede , Alex Deucher , Sachi King , Arnaldo Carvalho de Melo , Wei Wang , Fabiano Rosas , David Dunn , Nicholas Piggin , kvm@vger.kernel.org (open list:KERNEL VIRTUAL MACHINE (KVM)), linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-acpi@vger.kernel.org (open list:ACPI), linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software Suspend, aka swsusp)) Subject: [PATCH 0/2] x86: notify hypervisor/VMM about guest entering s2idle Date: Thu, 9 Jun 2022 11:03:26 +0000 Message-Id: <20220609110337.1238762-1-jaz@semihalf.com> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 This patchset introduces support which allows to notify first the hypervisor about guest entering the s2idle state (patch #1) and second propagate this notification to user-space so the VMM can take advantage of such notification (patch #2). Please see individual patches and commit logs for more verbose description. Zide Chen (2): x86: notify hypervisor about guest entering s2idle state KVM: x86: notify user space about guest entering s2idle Documentation/virt/kvm/api.rst | 21 +++++++++++++++++++++ Documentation/virt/kvm/x86/hypercalls.rst | 7 +++++++ arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/x86.c | 18 ++++++++++++++++++ drivers/acpi/x86/s2idle.c | 8 ++++++++ include/linux/suspend.h | 1 + include/uapi/linux/kvm.h | 2 ++ include/uapi/linux/kvm_para.h | 1 + kernel/power/suspend.c | 4 ++++ tools/include/uapi/linux/kvm.h | 1 + 10 files changed, 65 insertions(+) -- 2.36.1.476.g0c4daa206d-goog