Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp912994pxu; Wed, 6 Jan 2021 07:38:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOe0ZlSunS8A/CrTycw3uTfIU4iDYFBv0mtujc9xQg+LsyNfL5iLHGH9U0PESUl7DAvfKF X-Received: by 2002:aa7:c749:: with SMTP id c9mr4408504eds.3.1609947508419; Wed, 06 Jan 2021 07:38:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609947508; cv=none; d=google.com; s=arc-20160816; b=ZSP63ynVfgDveSFYPeyU4BX69tpduu7AfhGNjhWjT07llaLemva9xWySJODa7/GIGq 1PJgRsaVnkl6LGGJ6knzmkDKYoJP0jwHK9hys9cUfxqtwTsF1FXmimfvI9DnbCTGuMNj X/OcSPRaMdqpaVDk2GGAeDATub/I1lkMNwYZ0kudoXHzZ2DOBTZUJdP6a6CPEGnZyvUh t7TS//1KnmGk3HoeNjdVQEetSWGCtiJ5e4voC+lauKHSc4QwwFrVa04oxf6b8HmhZSlo 4IpmnkhaCWAvpxhkWyignMOUAWnAUprpAnTk0JWu68SePDTxPWb172evpM898h8zj8oh ORGg== 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=5wCpaYTXc1DTEy50SRBqT/5oaJ4kJbKZj5sevS6a4ng=; b=Jx11Zypll+h3chdMIxnOJ/l/wHj62saR4gCyOMpN/soyDO1OTQLJs7MzaTaA0JxyzP FQaB1boN7daI8HHDMyAGBsItdvxA0UtQ0SaGLoRae6Vuf5YzcLh9GAbXUVCEDQnXsBAy V6R/bpMPnUCrfS6j/oh8Bk+CSR1HzDZhIC1FLpBj+XlqkZVPREOPK0+wYHY8gi8s6O23 +Mdff46VcZfvF2c7FifdjYg98lR+A06+fInMLrbgkkmW+Ysa/jbmCwi+bx/FOrAzz8Au elNCXuMOezTcKzrOL346zcsbPJPrj9/0YGxGsmgHbmN3esn3BiNJ0RPFLChLJmaBOriw gETQ== 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 ca6si1025610edb.504.2021.01.06.07.38.04; Wed, 06 Jan 2021 07:38:28 -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 S1727021AbhAFPgH (ORCPT + 99 others); Wed, 6 Jan 2021 10:36:07 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:46526 "EHLO mail-wr1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbhAFPgH (ORCPT ); Wed, 6 Jan 2021 10:36:07 -0500 Received: by mail-wr1-f42.google.com with SMTP id d13so2762010wrc.13; Wed, 06 Jan 2021 07:35:50 -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=5wCpaYTXc1DTEy50SRBqT/5oaJ4kJbKZj5sevS6a4ng=; b=on6fvsWBLq0WxjNHsSeI3AXrAOGEhVYRGjGN80YFbuUW/cIgPRT0n5DadcO9lgT41A ts250n0PDVGutJtTx7UW4QDairE3kD8MyiUmwd03urKzjIqBaRD0RfujuB37zD06MA0s I/h1SXTURbQvdA4wAiA/mAlERKNPc3uqb2VtcutzhU3qfLDymT1WDOESsRyPs2SiD97L uZUw8aZLwMXeoWHWHGTLQvOVkG898tcUaWVPXgX4IccvZrq5cQfCeRNAzc52zMvLzjWt 1egK84XCuXbTLoPSYX9G3BqkqpXhPMWPafUBrvEA7JjOvHCvC0hg2Adq6s77j95APYZP TH7g== X-Gm-Message-State: AOAM531Kw13v/BcRicQNiwWbk1MAienQ1txpm3NUYCr8WVsiquHTFBA/ 5UwXcEawlT2Sb0jJM7vqcsA= X-Received: by 2002:adf:f590:: with SMTP id f16mr4991330wro.40.1609947325228; Wed, 06 Jan 2021 07:35:25 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id h9sm3497210wre.24.2021.01.06.07.35.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jan 2021 07:35:24 -0800 (PST) Date: Wed, 6 Jan 2021 15:35:23 +0000 From: Wei Liu To: Vitaly Kuznetsov Cc: Sunil Muthuswamy , "linux-kernel@vger.kernel.org" , Matheus Castello , KY Srinivasan , "linux-hyperv@vger.kernel.org" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Michael Kelley , Tianyu Lan , Wei Liu Subject: Re: [PATCH v2] x86/Hyper-V: Support for free page reporting Message-ID: <20210106153523.nbnrkp4papebxqwy@liuwe-devbox-debian-v2> References: <87v9cagpor.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v9cagpor.fsf@vitty.brq.redhat.com> User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 02:28:20PM +0100, Vitaly Kuznetsov wrote: [...] > > > +bool hv_query_ext_cap(u64 cap_query) > > +{ > > + u64 *cap; > > + unsigned long flags; > > + u64 ext_cap = 0; > > + > > + /* > > + * Querying extended capabilities is an extended hypercall. Check if the > > + * partition supports extended hypercall, first. > > + */ > > + if (!(ms_hyperv.priv_high & HV_ENABLE_EXTENDED_HYPERCALLS)) > > + return 0; > > + > > + /* > > + * Repurpose the input page arg to accept output from Hyper-V for > > + * now because this is the only call that needs output from the > > + * hypervisor. It should be fixed properly by introducing an > > + * output arg once we have more places that require output. > > + */ > > I remember there was a patch from Wei (realter to running Linux as root > partition) doing the job, we can probably merge it early to avoid this > re-purposing. > We want to be frugal regarding memory usage, so in my patch the output page is only allocated when Linux is running as the root partition. This patch is mostly only useful when Linux is running as a child partition. This is a different use case. Wei.