Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1266640pxb; Fri, 13 Nov 2020 08:18:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/NrrZw8OacjD5lo2JPfC0o/mwCYhJC7QGTPBpOWvMVtvoJSBaShlQtqzt3ZUrUMqJQ9uh X-Received: by 2002:a50:9f2b:: with SMTP id b40mr3228776edf.20.1605284302936; Fri, 13 Nov 2020 08:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605284302; cv=none; d=google.com; s=arc-20160816; b=EgRLgjxnruK44ysF6d4ixeAPwR3Na9SdA6h60bpmYlFKkJRZgA5Dtjsndo7SdIK9b+ /oY3QrqvSaJCL8vnsjbOFVUHQhidR3szk6DJ9Yn26D1D4nB4rclHH7A1iZnJVQTI4lRD 4ImiJSwFycQjaLh7XIjRg9naYvHFZh0VgdOj3o5zyn3Ce3OBtq99lJpdriYtdfW1jN6i zYRbAXfWV59rTYR76efgvDH3t9j34+mXG8jE+AmVNt34jWoHD/2TxdlC4XnKoknUdF+r l+VIERStTUfoY5NZeR0KtOP4/kEWnVfZpzWacC5k3dRl1Ae+2I5n1JR+Ru9N44h39zaL MWgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=jyN+DRRhVWX4G1okBIOdr3MH4mQtZ4BI+4XoCFZkPBY=; b=Meso0Y1GtLuBNjJLWsPLidzNbj6vdl7Ox728gmmxbomRZfQhxR5ouA2d2fnxUteJBW wfqpF+0bx90/3QqFwe9sxCBSmh8++31H6HEsZAbBnlVbnM5A4KF23p3oqD+lpCrqzLZv LZRj5TNMtHp7glG+ksaR6ugRGIq9BuDI5P595y0dNgOjXYzLOGeUhACaH3DIVfSt1/bc iy3DeIYibo35iS0TcyodsIY/Mf/+f8IYbgO2+jWs+uxmkJGU8oymAVyjnm5S3AFSGpQQ ytPLpGXhzLLGalpreIjIaYLdmJDEjcx1fJaxRnqNCdo02aGFMkaOnOflD/xaqshrQf5q lrmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DkSY0DTS; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x9si6292480ejy.403.2020.11.13.08.17.59; Fri, 13 Nov 2020 08:18:22 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=DkSY0DTS; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726518AbgKMQQ3 (ORCPT + 99 others); Fri, 13 Nov 2020 11:16:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28031 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgKMQQ3 (ORCPT ); Fri, 13 Nov 2020 11:16:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605284188; 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=jyN+DRRhVWX4G1okBIOdr3MH4mQtZ4BI+4XoCFZkPBY=; b=DkSY0DTSRvCu9IEGbFLizm3K3eX+8p/hlAzzpVZB1Tif0/nmhsnTN3bvZRcbJcPChsXv/B QCD9EsXKVMLG5jV7yPi2VVHFO7SdbNRVsHzdNhRyO9dszKd7sy2yb+9I2Kw1JIw232dFrX XfmqR2KfZpvPROxFY4M3xkusL23sJyg= 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-552-N94m8hXJMbi0kq8Jvy3VJQ-1; Fri, 13 Nov 2020 11:16:26 -0500 X-MC-Unique: N94m8hXJMbi0kq8Jvy3VJQ-1 Received: by mail-wr1-f72.google.com with SMTP id h29so3994886wrb.13 for ; Fri, 13 Nov 2020 08:16:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=jyN+DRRhVWX4G1okBIOdr3MH4mQtZ4BI+4XoCFZkPBY=; b=SJ5y/XD+NYP3eoM+cDz8BVarLPSxyrqd5cI3fJb/cMoiZFl8o3p0zqjaZWmTCnAdjo M9jFCEU0WUo7M4YP8Ngf8UaPXvyB15FtlB5jXHwHeU5dfu4q5HqTbWxZifXAVN3QlqvT WJImaGroFPhc6wcKVcnMFl2Rv3t3bg1drwVxvK5bWhyDVlDEkohCDRHw/Rt88l77ExMv 5Gx7HQjfnia6eZWLOyKH7HyVbfpIf9MoDVUQkomMVTMdSc/xmGBGCbqgs8HaMnJmcZnc TqrEPec5bBkkVILSs0W9mAX4oXvcYDVseW34Z74RypibrkjlPyQRramdrp7XUDibQ+FA XKWA== X-Gm-Message-State: AOAM531rjcOI9Q79U3O/6a9gFhuRL17N3dMEVHm6vmQ/XHz91OOYw++L 8LJLJG+PM3OWREfcJvY31Vq5Kpz+seFN4K86p2tHokzuoYW0jL4MCAxzvPZrth8d87/cSweIV/w xKYTpnSKJC+Im436k+h0WRLza X-Received: by 2002:a05:600c:210:: with SMTP id 16mr3226514wmi.122.1605284180498; Fri, 13 Nov 2020 08:16:20 -0800 (PST) X-Received: by 2002:a05:600c:210:: with SMTP id 16mr3226167wmi.122.1605284175430; Fri, 13 Nov 2020 08:16:15 -0800 (PST) Received: from vitty.brq.redhat.com (g-server-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id a131sm10530265wmh.30.2020.11.13.08.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:16:14 -0800 (PST) From: Vitaly Kuznetsov To: Wei Liu Cc: Wei Liu , Linux on Hyper-V List , virtualization@lists.linux-foundation.org, Linux Kernel List , Michael Kelley , Vineeth Pillai , Sunil Muthuswamy , Nuno Das Neves , Lillian Grassin-Drake , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" Subject: Re: [PATCH v2 08/17] x86/hyperv: handling hypercall page setup for root In-Reply-To: <20201113160907.rwgpge3zo53fcgvo@liuwe-devbox-debian-v2> References: <20201105165814.29233-1-wei.liu@kernel.org> <20201105165814.29233-9-wei.liu@kernel.org> <874kluy3o2.fsf@vitty.brq.redhat.com> <20201113153333.yt54enp5dbqjj5nu@liuwe-devbox-debian-v2> <20201113160907.rwgpge3zo53fcgvo@liuwe-devbox-debian-v2> Date: Fri, 13 Nov 2020 17:16:13 +0100 Message-ID: <87wnyput9u.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Wei Liu writes: > On Fri, Nov 13, 2020 at 03:33:33PM +0000, Wei Liu wrote: >> On Thu, Nov 12, 2020 at 04:51:09PM +0100, Vitaly Kuznetsov wrote: >> > Wei Liu writes: >> > >> > > When Linux is running as the root partition, the hypercall page will >> > > have already been setup by Hyper-V. Copy the content over to the >> > > allocated page. >> > > >> > > The suspend, resume and cleanup paths remain untouched because they are >> > > not supported in this setup yet. >> > >> > What about adding BUG_ONs there then? >> >> I generally avoid cluttering code if I'm sure it definitely does not >> work. >> >> In any case, adding BUG_ONs is not the right answer. Both hv_suspend and >> hv_resume can return an error code. I would rather just do >> >> if (hv_root_partition) >> return -EPERM; >> >> in both places. > > Correction: hv_resume is void, so I won't add that code snippet. But we > should still be fine because hv_suspend will have already failed in the > first place. > Works for me. I just very much prefer to get reports like "system doesn't go to sleep" instead of "something crashes when I put my system to sleep") -- Vitaly