Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp926290ybe; Wed, 4 Sep 2019 09:45:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlrawITmQqW/nZw3fA+CiHw1QcqZKRHQZ97J+5lDabTZGoNaBVufs1SylRJPfgJoWJIOJ6 X-Received: by 2002:a62:63c1:: with SMTP id x184mr48715298pfb.11.1567615502126; Wed, 04 Sep 2019 09:45:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567615502; cv=pass; d=google.com; s=arc-20160816; b=FtrEsXjvVDQd1QtCY6WHrQhzQsgAUFM7ZQA2oYJoepY3PhMG6xQP5XHctYpwGJfHZB LClneayU4xrS+jvLU9hLOHr6V+iqoLQp8AYEbm6Gzl+diDCv+s5HcTeDzzQKqEyGzAUA AEgkhB5urSZQ9L8tDlF4k1LO8MweJOlQaL2qpJHfRbKe/vdLJasHLvAOmh6qeiU5pOBF Lu7UdFGb0j8EI/jMRiWc9WV5Xcam/2IHUQsAQu31wbPNZv2k5f0zMf93QUWOCxLiLRW4 frf+RAi57mqfLOqKmJJ945DKGqDgdGQJynvqtqdGDxN03BvGqhaMRB3vMdMtjsfQ2MOW 7z2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :msip_labels:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=6Ly3J+pBk2qP9IXiwRthAQWrECQUCKES/BkOiaubCl0=; b=GE7r1oyZUXqKPyohkdGZXllsqTmH1LxzUA5W6pvFHBhgwp5Hkyh5ky0MR2IoRnU/vD jAhb6nlaWkZ0q+7ebJeZUijPmAXLwIELEk0OYHrbFQUxqXkfVUQXtXRqCls6nDOZHmr9 AhJ37oZNpfyx6r8svwaEpio/xL2pKYMDDjy+XtLRj53JwIVZP0bVxBGlqeAY+b7mZnGY T/aUsyD0MRnBTRYNJcNUXvKV9Kl3LJSbI8xRZrnvlz//QXilcRKLObL7qvziYpyzNnDb UMWig8q68AyX8GXt9Y4YC+om3X8i9nn+aygAGZ1FPwxk8+aBtlph3fW8alepHQEPHzQF 689A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=SSfy7ZaS; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i21si17266411pgj.37.2019.09.04.09.44.45; Wed, 04 Sep 2019 09:45:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=SSfy7ZaS; arc=pass (i=1 spf=pass spfdomain=microsoft.com dkim=pass dkdomain=microsoft.com dmarc=pass fromdomain=microsoft.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732087AbfIDQnT (ORCPT + 99 others); Wed, 4 Sep 2019 12:43:19 -0400 Received: from mail-eopbgr720115.outbound.protection.outlook.com ([40.107.72.115]:19353 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731904AbfIDQnT (ORCPT ); Wed, 4 Sep 2019 12:43:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RckszFnA8OBHVYKwyCwtU5mmLAhVdBXimo5Uq4BfTfpwhZGKw84R9i4gwUPBqiulQgzkRyQAsGK3iGpK8ATH1BSzbTtWyoicP90AZ2zDyMQcGWXr8PPZjnyvP4nsKx0gRvPYbLu+Qm8CDABFwH6cA3l7HQ/9308tzdXm0k3dicmt50QOZk82dFw7IyNbkWlUnjBPp6FT0EOo9iTH5bbQCeM3fRNnMlu+Qz3WRX1AA982YtU7zoAd4KuQ/9dZxwpv53h6ZmAbyBbnDAvZ7RYHPvNrepTLjYKzDFjWveAOlShgH8W/vdVk+XmfrxEJ6VTfzaeDLYqqqkTCXlwSuUdedg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Ly3J+pBk2qP9IXiwRthAQWrECQUCKES/BkOiaubCl0=; b=SqHXLzuGtSODxVwVYVW6oU+4kLBreeHJHBkgV65X4y79UCZC2HXK2hAt1ZZZa+YHt4bQZukiMMMSa+KbgDANmGNHf6zi6vZb4xE4M+4kBHJeJnRhVFk1EfTEyv+POYUOo04Vo+G5SucW3gwgGyZdiYqHHN8Bj/hyhssEytaeIHm+wxexpN58WTn/X8d5acS5x3CQNI0Qw/VzuoNZGLONDi1rp2r4jZNDGg2GtdePiHyUOwDgdFPuPwDD8m0wn9mTzc/74Z70JmKKYGhvaHEB10oFi7qugHvq69Z6oH9Yw9020lgZT+JeaDcjY9msBTNHlHq92bzXLL+nr0k5yd1n8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Ly3J+pBk2qP9IXiwRthAQWrECQUCKES/BkOiaubCl0=; b=SSfy7ZaSTpvYLPXX4LGI/LFO28m2t9FNdj4tVoXrFPNOYhuSMH3gafSb5FgYYDFyuK4kJaSZm867F8837rg7ABRjATSAD2emi0CTmCjxbKHXXCNzNLPqWKkU9rtLKWec+ZTGaQuthkOglwVSw2JQ2dbXLn0nWocFAwWfl7N94NQ= Received: from DM5PR21MB0137.namprd21.prod.outlook.com (10.173.173.12) by DM5PR21MB0794.namprd21.prod.outlook.com (10.175.112.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.6; Wed, 4 Sep 2019 16:43:15 +0000 Received: from DM5PR21MB0137.namprd21.prod.outlook.com ([fe80::c437:6219:efcc:fb8a]) by DM5PR21MB0137.namprd21.prod.outlook.com ([fe80::c437:6219:efcc:fb8a%7]) with mapi id 15.20.2263.004; Wed, 4 Sep 2019 16:43:15 +0000 From: Michael Kelley To: Dexuan Cui , "linux-hyperv@vger.kernel.org" , "gregkh@linuxfoundation.org" , Stephen Hemminger , Sasha Levin , "sashal@kernel.org" , Haiyang Zhang , KY Srinivasan , "tglx@linutronix.de" CC: "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v4 02/12] x86/hyper-v: Implement hv_is_hibernation_supported() Thread-Topic: [PATCH v4 02/12] x86/hyper-v: Implement hv_is_hibernation_supported() Thread-Index: AQHVYe3JrHu+0vx33Ua7p5urdffONKcbu4lw Date: Wed, 4 Sep 2019 16:43:15 +0000 Message-ID: References: <1567470139-119355-1-git-send-email-decui@microsoft.com> <1567470139-119355-3-git-send-email-decui@microsoft.com> In-Reply-To: <1567470139-119355-3-git-send-email-decui@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=mikelley@ntdev.microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-09-04T16:43:13.8295179Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=2e65f02c-2ddd-4f84-a66b-e2077f2d8611; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic authentication-results: spf=none (sender IP is ) smtp.mailfrom=mikelley@microsoft.com; x-originating-ip: [2001:4898:80e8:a:c9a6:edf8:bca3:c905] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9cfe4d8b-ede2-43ef-a947-08d73156fbc8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:DM5PR21MB0794; x-ms-traffictypediagnostic: DM5PR21MB0794:|DM5PR21MB0794: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 0150F3F97D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(366004)(136003)(39860400002)(346002)(396003)(376002)(199004)(189003)(10090500001)(6506007)(2906002)(33656002)(1511001)(66446008)(64756008)(66556008)(66476007)(66946007)(186003)(7696005)(76116006)(76176011)(102836004)(110136005)(22452003)(316002)(86362001)(81156014)(6116002)(478600001)(81166006)(5660300002)(2501003)(2201001)(8936002)(10290500003)(8676002)(14454004)(14444005)(256004)(71190400001)(71200400001)(52536014)(486006)(25786009)(476003)(6246003)(53936002)(4326008)(46003)(11346002)(229853002)(446003)(8990500004)(74316002)(55016002)(7736002)(9686003)(305945005)(99286004)(6436002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR21MB0794;H:DM5PR21MB0137.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7YeO/fGHiFW1838SMYQdPVajH2YjkOg/XbqnBISX9IYt7p8p7/8aX05LcilPFSbig7XHb85L1DnBa8P6nB+DPqdqyALUKbaVpyojjKL6Ath94h1B7kKhIVehjti0pw+GMLkNthxfH1buv6QveYDo4rxTc5L8O4jTDxnyCJNcwNo4KO0qKUg5HWmfuBkmrjIqMLsumgqpO4EZ3fvfO0eFZMVh981UtQapPK20P2pUNSVqP3MOPgr3GplxRfebrpSkwp9BuFp6VeOSyqiCg664FGz+eVx1ezvUex4JRgwi3JdbeGw5A7HorcqYhjPKCI3JgyFQY/OT6jgPTfXoVhtOHIg41B4OBtVuivAwEadr71QNMB31pHld5guKjeKt9VTHjqW+WIBrq1H5GOA7y23X6RZvXDz9K0S93UosFKBcfGc= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cfe4d8b-ede2-43ef-a947-08d73156fbc8 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2019 16:43:15.6465 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bR14dce4hOLli7o1D/muRaanExthXk7/RZuTdosMVFHj8O+WWZmrFB7HRPvgFs0DsxGwmFEzKLr8W+FswOJ7CJnjyMhkxZRVwa5Lf8BakhU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0794 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dexuan Cui Sent: Monday, September 2, 2019 5:23= PM >=20 > The API will be used by the hv_balloon and hv_vmbus drivers. >=20 > Balloon up/down and hot-add of memory must not be active if the user > wants the Linux VM to support hibernation, because they are incompatible > with hibernation according to Hyper-V team, e.g. upon suspend the > balloon VSP doesn't save any info about the ballooned-out pages (if any); > so, after Linux resumes, Linux balloon VSC expects that the VSP will > return the pages if Linux is under memory pressure, but the VSP will > never do that, since the VSP thinks it never stole the pages from the VM. >=20 > So, if the user wants Linux VM to support hibernation, Linux must forbid > balloon up/down and hot-add, and the only functionality of the balloon VS= C > driver is reporting the VM's memory pressure to the host. >=20 > Ideally, when Linux detects that the user wants it to support hibernation= , > the balloon VSC should tell the VSP that it does not support ballooning > and hot-add. However, the current version of the VSP requires the VSC > should support these capabilities, otherwise the capability negotiation > fails and the VSC can not load at all, so with the later changes to the > VSC driver, Linux VM still reports to the VSP that the VSC supports these > capabilities, but the VSC ignores the VSP's requests of balloon up/down > and hot add, and reports an error to the VSP, when applicable. BTW, in > the future the balloon VSP driver will allow the VSC to not support the > capabilities of balloon up/down and hot add. >=20 > The ACPI S4 state is not a must for hibernation to work, because Linux is > able to hibernate as long as the system can shut down. However in practic= e > we decide to artificially use the presence of the virtual ACPI S4 state a= s > an indicator of the user's intent of using hibernation, because Linux VM > must find a way to know if the user wants to use the hibernation feature > or not. >=20 > By default, Hyper-V does not enable the virtual ACPI S4 state; on recent > Hyper-V hosts (e.g. RS5, 19H1), the administrator is able to enable the > state for a VM by WMI commands. >=20 > Once all the vmbus and VSC patches for the hibernation feature are > accepted, an extra patch will be submitted to forbid hibernation if the > virtual ACPI S4 state is absent, i.e. hv_is_hibernation_supported() is > false. >=20 > Signed-off-by: Dexuan Cui > --- > arch/x86/hyperv/hv_init.c | 7 +++++++ > include/asm-generic/mshyperv.h | 2 ++ > 2 files changed, 9 insertions(+) Reviewed-by: Michael Kelley