Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3823284ybl; Mon, 13 Jan 2020 03:17:34 -0800 (PST) X-Google-Smtp-Source: APXvYqysXs/tXLuIi6qAC0YJ0qpnSpz+EQ/O82+e558hFAJhYO6y+LDFYlhcaj3AmbnT22H58u8Z X-Received: by 2002:a9d:21f5:: with SMTP id s108mr13541905otb.152.1578914254190; Mon, 13 Jan 2020 03:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578914254; cv=none; d=google.com; s=arc-20160816; b=TP8PVOO0XtZGlJx0K8FFV7x7mZZlyk7y+FDzRC2xJMmYOVDrVeL20KnCfjocL0Hn5c 62IojcnBcIXMqgYPGEsjlRfK9CmLa+9zhMQllkA1bGJeVcjFvZDw+VlCIAnxxsWhCuDE 3a1Q4Vx3wjDQY3MV5ouJvpBzcTqPBcIH5AiX6hlFv8gGWgP9qaHN4YxkW2WAITNQbod+ EGmjxhTcg7rRyYxAFwtIAbDfD5P82iIjNdWZG2RKSzUi1olRyrAvwGbsF+mxOoLqsBVC uCMsKR3hfSRciA5or/9Oj+s6ladjrYJSlJr4Hf6V+cKt6gSjBznsg/yT0yBRIJ6RCOIc 5HHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=tqu7ZvgXhgD0/ztEtEsrtpkp34QvvCiwz8rOYRcndv8=; b=BisjdyhgcpAAiSZNWxfq3qc4Coz5tPVpMbYZ+UTwCYvFs9f7pHD8JAg11TsDUHUAL/ y2TUyclGGCVBabewozagAE+6c7SZqC3DnxvgaIL/xxhcjy4s6L+y8DuwlYfaEtS0zr6O PSc8yrsn3PYeB96pyMpGB4UZ1ohIJQ7/Kj+4h3LUEaEqi0ZRWWXSaLMQwx9BOCthDwQQ ZAH79gKtr6ecRA3Jqz1IA9bdUO97GZZ4ht8EHSsbxm4ZDf29f71j75P1Wft5R9zT5f8n GCLeZM6XZHlQ9gdD09XvO7XYEX3Wy3b3k/efT+gtfRWr6Mpy2wvjIXNzkdWYNIynrdft 1z3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=e3TcvGj3; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si5660409oix.197.2020.01.13.03.17.21; Mon, 13 Jan 2020 03:17:34 -0800 (PST) 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=@kernel.org header.s=default header.b=e3TcvGj3; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbgAMLQ3 (ORCPT + 99 others); Mon, 13 Jan 2020 06:16:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:39780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgAMLQ2 (ORCPT ); Mon, 13 Jan 2020 06:16:28 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E34BD207E0; Mon, 13 Jan 2020 11:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578914188; bh=oQgIRZE3Ca1zvjHWdut6CuVqEaxiZSV5sbQvWLbrvag=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e3TcvGj31AwlkiLT/c2UDThap+MfQ1EwwdLbheey2cC7to/q4SOcYLDkg406rEFf0 LXe9K5ORlRbmcMY05oDtY9CrSsLFr2i4qGS1k3/8tFudNQUDC1T087p4NcCBMYiguz L0ETEtO7VrTs+z8DDuIoxk2Czw4BqJLM9CJopX2A= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iqxhq-0002vN-8G; Mon, 13 Jan 2020 11:16:26 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 13 Jan 2020 11:16:26 +0000 From: Marc Zyngier To: Jianyong Wu Cc: netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, sean.j.christopherson@intel.com, richardcochran@gmail.com, Mark Rutland , will@kernel.org, Suzuki Poulose , Steven Price , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve Capper , Kaly Xin , Justin He , nd Subject: Re: [RFC PATCH v9 6/8] psci: Add hvc call service for ptp_kvm. In-Reply-To: References: <20191210034026.45229-1-jianyong.wu@arm.com> <20191210034026.45229-7-jianyong.wu@arm.com> <7383dc06897bba253f174cd21a19b5c0@kernel.org> <099a26ffef5d554b88a5e33d7f2a6e3a@kernel.org> Message-ID: <22ba1283a7b82f018c1fdf85414e5bfe@kernel.org> X-Sender: maz@kernel.org User-Agent: Roundcube Webmail/1.3.8 X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: Jianyong.Wu@arm.com, netdev@vger.kernel.org, yangbo.lu@nxp.com, john.stultz@linaro.org, tglx@linutronix.de, pbonzini@redhat.com, sean.j.christopherson@intel.com, richardcochran@gmail.com, Mark.Rutland@arm.com, will@kernel.org, Suzuki.Poulose@arm.com, Steven.Price@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, Steve.Capper@arm.com, Kaly.Xin@arm.com, Justin.He@arm.com, nd@arm.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jianyong, On 2020-01-13 10:30, Jianyong Wu wrote: > Hi Marc, > >> -----Original Message----- >> From: Marc Zyngier >> Sent: Friday, January 10, 2020 6:56 PM >> NV breaks that assumtion, because the guest hypervisor is using the >> physical >> counter. Also, let's not forget that the hypercall isn't Linux >> specific. >> I can write my own non-Linux guest and still use this hypercall. >> Nothing in >> there says that I can't use the physical counter if I want to. >> >> So somehow, you need to convey the the hypervisor the notion of >> *which* >> counter the guest uses. >> >> Does it make sense? Or am I missing something? >> > I know what you say. Let me try to solve this problem. > Step 0, summary out all the conditions we should process, which will > sever as branch condition.(now only normal virt and nested virt, I > think) No. You shouldn't think of the various use cases, but of which time references a guest can use. You don't need nested virt to use the physical counter, for example. > Step 1, figure out the set of reference counter value used by guest > in all condition. That should be for the guest to tell you when it calls into the PV service. > Step 2, determine which reference counter value will be used by guest > in a certain condition in hypercall. > In step 1, can we give the set only 2 elements that one is physical > counter the other is virtual counter? I don't think returning the two values is useful. Just return what the guest asks for. > For step 2, I have no idea for that now. can you give me some hint > about it? Just expand your SMC call to take a parameter indicating the reference counter, and return the sampled (or computed) value corresponding to that counter. M. -- Jazz is not dead. It just smells funny...