Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1261835pxb; Fri, 13 Nov 2020 08:12:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKhK6mrd/fjd/NMmoBvhPeFEppZXRrAxiVIeOYeFAZ7qBiZJyqxDmkt6uUZ6ZpFUNQsJkh X-Received: by 2002:a17:906:2ad3:: with SMTP id m19mr2512372eje.81.1605283939820; Fri, 13 Nov 2020 08:12:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605283939; cv=none; d=google.com; s=arc-20160816; b=sY5+NMeDyPJNmY3jvML+kQWcWz190r104pMA2Vis+gm57Jt9+gYcXae2r4ir4o7mL9 4VMRGJEHiwW9aw5AlqjW90d3QbshaAGSjscqM0ekLNP7YRaGXAhMXS1IhK21BJfrNphP omOhGCsiXUkF+kc72UUkYr4uANrMJ4n9LoHUB2kf0NyoJnXaJRQ/yTq4aQ9KeIrDomSv zk69ITVj9Zn+Hx4gjlA2lzXF37D5RL/SX55YZWEHdrx1sWp1rvYABicGiBA7n11ARJcT HAr8OY3QIG+/yf+LBNZOaqWRNDZbDK5gXzb0p+yRBvbBJ+C2O3uNXaN5jKMQ2WG1lCOW uc3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=zxymz4VLWzgAdHAVQnubnBzAdJF89SBL0L0e0p6yRZ8=; b=DVUG/zl4A2r1c5TW5KtcqETql3WYeFyniyrBee1jXelbBJpUAKfOmvzQpHhS6jMcQi GBlyg59JAEGtYDeGWOKSG2dcjsgv/86SPcwbODu7WIc9mdLtFG91NwPFeYuzIi1JJtI7 gZHi8xrSt94J7C1y9jdhCPE1jVW5v5/FKmpAkCrcED3kQ/Zg7SY5rCY9NIDvjJB25sHp ypFQezzBEeOHtOAfDzPMvSIsUNlUIX7Zs0PMGLH0cZ7lsqmbH4DuHX5dSZAhxCq0q3AX iCn7lQfv4JXpWFgKAvqwU/d2M1909AI8R6yNu2xsfp8dNpRWgmbHfIMeJ648paNh6cAv 60iw== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si55337eja.694.2020.11.13.08.11.54; Fri, 13 Nov 2020 08:12:19 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726711AbgKMQJP (ORCPT + 99 others); Fri, 13 Nov 2020 11:09:15 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34876 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726336AbgKMQJP (ORCPT ); Fri, 13 Nov 2020 11:09:15 -0500 Received: by mail-wr1-f65.google.com with SMTP id k2so10516296wrx.2; Fri, 13 Nov 2020 08:09:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zxymz4VLWzgAdHAVQnubnBzAdJF89SBL0L0e0p6yRZ8=; b=Vxbhxav5seB0FT+Y9mQtYYF4Uw/qwKB4ypa1fNO0S4kh/hZA5sjHovBK4BEiIbbtYA HCwsubIkZAsVpqDJPS5B6BfPvBM639HpF0kX/LKsHyfGohG0eRvOB346ZoSboFWmZno7 e0mCtM6Qeu6XWC8aBzqMaPtJyBqroo4ctLI9kbamVVKqWKRAVrtT2DqyMTpHn0kXNSqh CC7d+H0BodwKWiHQWrKIufDPBl96eOAH3oq1nuL0fzP33RrxloL0mbo7t53IRoJnVqaA vjvzPrN8yFNeI56pVU358w0nG/udaDqVsIkjcvgdvQOQ67bKp476ArlBW0A28qm4/2G5 Vllw== X-Gm-Message-State: AOAM532wgJJ6BpPPIX3FPFNSuhSc9zzwDNbyVpWN9tEIgVEk6u4d8ghC ztSXKDY+WCSAk0mQuswR4A0= X-Received: by 2002:a05:6000:364:: with SMTP id f4mr4315571wrf.290.1605283749327; Fri, 13 Nov 2020 08:09:09 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id a128sm10773950wmf.5.2020.11.13.08.09.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 08:09:08 -0800 (PST) Date: Fri, 13 Nov 2020 16:09:07 +0000 From: Wei Liu To: Vitaly Kuznetsov 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 Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201113153333.yt54enp5dbqjj5nu@liuwe-devbox-debian-v2> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Wei.