From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3F9AC49ED7 for ; Thu, 19 Sep 2019 12:13:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 96FE221929 for ; Thu, 19 Sep 2019 12:13:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Uoos2eUm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390265AbfISMN2 (ORCPT ); Thu, 19 Sep 2019 08:13:28 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:27381 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390227AbfISMNV (ORCPT ); Thu, 19 Sep 2019 08:13:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1568895200; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp; bh=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=Uoos2eUmdiKzuQlXofjnhJ3p1Nwl4lVhuWcraNySJQ9Fpnp7iV8TrTcjMxZgrhJ8FW/iQg qmCr1g3ZwdqZfsKwbbFuIGoPYSZ73Vw1mUsR0mc+m+79Y9uqU76+/hg6BlyRPz+qY1gC8Z IFTWZqCdNGHCbFXvTreHZvd6SyWyY9o= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-93-o4gALb9vM5GWynNYnhGTnA-1; Thu, 19 Sep 2019 08:13:18 -0400 Received: by mail-wr1-f71.google.com with SMTP id f11so931948wrt.18 for ; Thu, 19 Sep 2019 05:13:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=tIBR9SjRrbOiaXpt4GF8rhYATIXWlUPqNjr1NyphPuIQifT5IUAyq+IDy2T1LlReX3 VtHpB/KsCed2v4etC7ikefFwEaNddPIgjxBgGDvJLMZxgGsKJRwp2mTzZOo0V9ahZQLy isIE6ZSlqqPsQ383ccy0XUUEb8W30d8kbwuLm45l72UUu95QeIMPxxUDw5zyZ9iJeCS0 O5nleRFAgurA7GJMNgXJhYUgOxA7h+TUscYaB+ERH47ZwKJQFRx5M3cSXyRNGBv8Jhrd LcvTdnqZ2K3D1avlGbUy/SxOY0oETuQBBCKIuXyNRE6qs09ld8e3AoNUcjgOJVj211JF jN8g== X-Gm-Message-State: APjAAAWIUaWSlG61ARCGr3vIrEpBTmtzy041gJ3gJdwhgGXT5p8znSP/ V1DKoqEeUb67XOCjTFqsv3lJhUX95Yp64t1XmN9+c2CPy4Ymtm5Xt05ftYOxRnTdv4ebdh5Fmwo SHuHsf9CP0xXX7oZphjMKmR/j X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995242wrt.31.1568895197142; Thu, 19 Sep 2019 05:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoqc728vUxzk+PlHiWZtsz6cgGkTTAs+KWHYRvgq+doGCowWOVSB7hkXrBEQJmElppYJsNwA== X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995221wrt.31.1568895196846; Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c46c:2acb:d8d2:21d8? ([2001:b07:6468:f312:c46c:2acb:d8d2:21d8]) by smtp.gmail.com with ESMTPSA id x6sm7878924wmf.38.2019.09.19.05.13.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: Marc Zyngier , "Jianyong Wu (Arm Technology China)" , "netdev@vger.kernel.org" , "yangbo.lu@nxp.com" , "john.stultz@linaro.org" , "tglx@linutronix.de" , "sean.j.christopherson@intel.com" , "richardcochran@gmail.com" , Mark Rutland , Will Deacon , Suzuki Poulose Cc: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , Steve Capper , "Kaly Xin (Arm Technology China)" , "Justin He (Arm Technology China)" , nd , "linux-arm-kernel@lists.infradead.org" References: <20190918080716.64242-1-jianyong.wu@arm.com> <20190918080716.64242-5-jianyong.wu@arm.com> <83ed7fac-277f-a31e-af37-8ec134f39d26@redhat.com> <629538ea-13fb-e666-8df6-8ad23f114755@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <56a5b885-62c8-c4ef-e2f8-e945c0eb700e@redhat.com> Date: Thu, 19 Sep 2019 14:13:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-MC-Unique: o4gALb9vM5GWynNYnhGTnA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/09/19 13:39, Marc Zyngier wrote: >> I don't think it's ugly but more important, using tk->tkr_mono.clock is >> incorrect. See how the x86 code hardcodes &kvm_clock, it's the same for >> ARM. > Not really. The guest kernel is free to use any clocksource it wishes. Understood, in fact it's the same on x86. However, for PTP to work, the cycles value returned by the clocksource must match the one returned by the hypercall. So for ARM get_device_system_crosststamp must receive the arch timer clocksource, so that it will return -ENODEV if the active clocksource is anything else. Paolo > In some cases, it is actually desirable (like these broken systems that > cannot use an in-kernel irqchip...). Maybe it is that on x86 the guest > only uses the kvm_clock, but that's a much harder sell on ARM. The fact > that ptp_kvm assumes that the clocksource is fixed doesn't seem correct > in that case. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EE16C49ED7 for ; Thu, 19 Sep 2019 12:13:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E60762196F for ; Thu, 19 Sep 2019 12:13:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="L0EMWoyL"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Uoos2eUm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E60762196F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1mX070xEH+9wbSRH2coJAse0mURuHb004p34b9ndPe8=; b=L0EMWoyLNx84WA NxyA4SL7NCAUINubQQUjTy7pH92FlwcYtRR1f5uRxSD+e+PEHZlZK/jxssDSetUBSY4yZyuTXoVzq GQ6iQONRc79zHbVfRcWq8NNL98x7PCZAW7LLejb+R4M53syiRWFhumQGqo7YChl8eOBlVHK219PB5 NybT0050iQEGbRJeF+3geOGhq3fJBBw2DF3ajBJ84nOqjxMQkgE2BUdnYCMg26MGU3IGB3hoNciFT cCtJt7jIwk0GE/+VnHj7NyXcK75zKAFakhOjPxU8FZYhRHCfkHyBPY+DSlwI7XhUrVyiktB8qVdyv iexjaF7XqRqNWALjNp0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAvJO-0004mJ-Iq; Thu, 19 Sep 2019 12:13:26 +0000 Received: from us-smtp-2.mimecast.com ([205.139.110.61] helo=us-smtp-delivery-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAvJK-0004l7-EB for linux-arm-kernel@lists.infradead.org; Thu, 19 Sep 2019 12:13:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1568895200; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp; bh=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=Uoos2eUmdiKzuQlXofjnhJ3p1Nwl4lVhuWcraNySJQ9Fpnp7iV8TrTcjMxZgrhJ8FW/iQg qmCr1g3ZwdqZfsKwbbFuIGoPYSZ73Vw1mUsR0mc+m+79Y9uqU76+/hg6BlyRPz+qY1gC8Z IFTWZqCdNGHCbFXvTreHZvd6SyWyY9o= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-358-5mPcEttBMsmy7S3YU79m9Q-1; Thu, 19 Sep 2019 08:13:18 -0400 Received: by mail-wm1-f71.google.com with SMTP id r21so1490857wme.5 for ; Thu, 19 Sep 2019 05:13:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8upZbcqH4fXkVaLOW2dy/iZBybRVQ5oETpjiRcdE6KE=; b=AABX/wvunHmXtWFK6qX82+GRjQaJsukpCxsSuq5715sPqgU6r8yltdCdVeFcoFUUTg 8D7pEkPcD/Mc7OlOGTjac9w1shzAjJYt0msgRzCpVCx0Zu7CXDYnnAaw2mVE+oyKo7b9 NhwasO0O63Gi0S24lfh+NJLKQlfU8THInJIFW5JB3X9yf5OPBx6u19kbkn/wk/kueh2e A0QAIgfmfxnweMvwlWs51flUP1SzqKRKs7DaP+Q7dxVvA/YQ3+ncDmVRqVreCuXqk74B tr+I4B5JMmjywwvoJTK4QqTvE+IV/j9Iqn9l5PqxK1JllPET3IRdFeqBhLxgKR/Oy0Cr 6TcQ== X-Gm-Message-State: APjAAAX+9LSps0LVQZw3RgJPFvt1x2mqAAjyOEBxWEjZki01+rQBjXfn 9I9qKupiENR5ur5hnSm4+oT2sF4WH2BEr+97w/S91o7a4RG7R+S2/trR2OsSuU/BC++DmdIN4zC kGg0maCDgUUgaWsc1PS+PzSu/9pj9ojmAWD4= X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995252wrt.31.1568895197144; Thu, 19 Sep 2019 05:13:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoqc728vUxzk+PlHiWZtsz6cgGkTTAs+KWHYRvgq+doGCowWOVSB7hkXrBEQJmElppYJsNwA== X-Received: by 2002:a5d:6088:: with SMTP id w8mr6995221wrt.31.1568895196846; Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c46c:2acb:d8d2:21d8? ([2001:b07:6468:f312:c46c:2acb:d8d2:21d8]) by smtp.gmail.com with ESMTPSA id x6sm7878924wmf.38.2019.09.19.05.13.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Sep 2019 05:13:16 -0700 (PDT) Subject: Re: [RFC PATCH v3 4/6] psci: Add hvc call service for ptp_kvm. To: Marc Zyngier , "Jianyong Wu (Arm Technology China)" , "netdev@vger.kernel.org" , "yangbo.lu@nxp.com" , "john.stultz@linaro.org" , "tglx@linutronix.de" , "sean.j.christopherson@intel.com" , "richardcochran@gmail.com" , Mark Rutland , Will Deacon , Suzuki Poulose References: <20190918080716.64242-1-jianyong.wu@arm.com> <20190918080716.64242-5-jianyong.wu@arm.com> <83ed7fac-277f-a31e-af37-8ec134f39d26@redhat.com> <629538ea-13fb-e666-8df6-8ad23f114755@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <56a5b885-62c8-c4ef-e2f8-e945c0eb700e@redhat.com> Date: Thu, 19 Sep 2019 14:13:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-MC-Unique: 5mPcEttBMsmy7S3YU79m9Q-1 X-Mimecast-Spam-Score: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190919_051322_551164_FC5EDD13 X-CRM114-Status: GOOD ( 13.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Justin He \(Arm Technology China\)" , "kvm@vger.kernel.org" , Steve Capper , "linux-kernel@vger.kernel.org" , "Kaly Xin \(Arm Technology China\)" , nd , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 19/09/19 13:39, Marc Zyngier wrote: >> I don't think it's ugly but more important, using tk->tkr_mono.clock is >> incorrect. See how the x86 code hardcodes &kvm_clock, it's the same for >> ARM. > Not really. The guest kernel is free to use any clocksource it wishes. Understood, in fact it's the same on x86. However, for PTP to work, the cycles value returned by the clocksource must match the one returned by the hypercall. So for ARM get_device_system_crosststamp must receive the arch timer clocksource, so that it will return -ENODEV if the active clocksource is anything else. Paolo > In some cases, it is actually desirable (like these broken systems that > cannot use an in-kernel irqchip...). Maybe it is that on x86 the guest > only uses the kvm_clock, but that's a much harder sell on ARM. The fact > that ptp_kvm assumes that the clocksource is fixed doesn't seem correct > in that case. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel