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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EB868C3DA64 for ; Sun, 28 Jul 2024 10:37:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jNEkDHnvbNPp2+ALKmKWmpG/wmJs82CfVJFyAFzqrp4=; b=ZlXq9B0teo0Xvtwd+lcNgZ3bZN IJtIo5ZIe+hh3JaNkJtCkVuTvbPwEG+LQ4U0M0dVJUNuag+ioqm/jQ4vnGxDSX4SrqYllYg3S7ki+ y1rNCCL1UGPsSYC3nsSQaoXHEQWsYrdA97hFXbVbZpSti+NFGN52NZIR1z5jk4lkwccI4Cin6KYsI yfDopzVv5BRypHoR+O5EUHHhOPU+eb+Rnvkr9Xxya1c+X+Sp6dMxX8h9Z95xPQI8jUMERTVTjiVQ+ WhBT4SQOc8xHdKOVDUOiekSxdioL4OHI8ENkr4W5hSr+EglxrOscEYXTA60Rzzs2C+76I9jDhfm/P M5SrEZPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sY1Hb-00000008IhQ-45we; Sun, 28 Jul 2024 10:37:43 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sY1HC-00000008Ic5-289Y for linux-arm-kernel@lists.infradead.org; Sun, 28 Jul 2024 10:37:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722163036; 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; bh=jNEkDHnvbNPp2+ALKmKWmpG/wmJs82CfVJFyAFzqrp4=; b=FS86hUDlfxbSEKqaz+ujlt3FlOxYpq6ZX2XLLbXNupfxSEz19qMvQkjK2Sknwv76xr5R5G iaKMEoatvqrmUHRPX7Uqu9S7JjqqLmDHVspibc522BtNBC5tNUufyyYA2+bOtqXXLidv1t 5CvNA30qCBtbZTe6Or/Gfb0wTEK3fkc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-92-z19-uarAO1eydQz6NmXR0A-1; Sun, 28 Jul 2024 06:37:13 -0400 X-MC-Unique: z19-uarAO1eydQz6NmXR0A-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-427b7a2052bso13733035e9.2 for ; Sun, 28 Jul 2024 03:37:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722163032; x=1722767832; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jNEkDHnvbNPp2+ALKmKWmpG/wmJs82CfVJFyAFzqrp4=; b=Q8rfY41E8AIoYxZba7MzhgMW1Ebrml12LDBun3SMBRQ/WcTJqxT8+Dck596A96F9iF CvMuD9p7E1c6wAIRBL1yFBY/MIjov0thSCAePAqr8p8gpLYLJBxnOoE3MB68J81tiMsp 0P3vjZDHAtUsAXNlUB0tbHKbt14oI2Lqu/qbS1CSZYIy/hFuNyqf6QiX6BMMIbESbxGR cEBmYVpcSbyARXVNf+mGEFN9Tjyrf+K8dF8TwF2APrqF/2xDHaHEAyxaPpn48kg83unP G6iNH3sLaRv5ckJjP6yXO8GUPtdWdAwB5xkUcHPpq6joq3wrjTo4pgH70sBLUikGhmkH iL6Q== X-Forwarded-Encrypted: i=1; AJvYcCWMlzUxa6rM34heNMTMZvxzdAC4ZjC2P54Hz6HjV1g8CUKNYv0iW0cGUym9LOyW5VTSMzmkIi0Unbj4Q2VTZzGp4hicPoWbNQO7XSV8veOYE7NJ7ac= X-Gm-Message-State: AOJu0YyvvjTjqZW4KJ65WuBVhMowoi/m51nwm3odkUHm7cnBTUABsn37 yQ0oDJSMluuKMz6mSPBIKiOHsJ0JoJEH/JjsbPCvqyU4vt1vPc/RWkOyG6P4RVAWUqCPImgYwmg N9uA4y8MszrUlMIUdP3NzFV5fKQ6G0baZVDUk+a8AXtSEzi5jmJ3OL8pgHV3T01NL+VonBaGR X-Received: by 2002:a05:600c:3516:b0:426:59fe:ac27 with SMTP id 5b1f17b1804b1-42811dd3c20mr36594605e9.26.1722163031698; Sun, 28 Jul 2024 03:37:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2cKOXyaw7TL4RhZif2MJdOkxcn73oBa4mUrZIKj4bWWSa0equ1t3D5E9LbDUT+fBtAEsoYw== X-Received: by 2002:a05:600c:3516:b0:426:59fe:ac27 with SMTP id 5b1f17b1804b1-42811dd3c20mr36594045e9.26.1722163030219; Sun, 28 Jul 2024 03:37:10 -0700 (PDT) Received: from redhat.com ([2a02:14f:1f6:f160:13e8:2edc:6ef0:6600]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-428057b645dsm140178495e9.43.2024.07.28.03.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jul 2024 03:37:09 -0700 (PDT) Date: Sun, 28 Jul 2024 06:37:04 -0400 From: "Michael S. Tsirkin" To: David Woodhouse Cc: Jonathan Cameron , Richard Cochran , Peter Hilber , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, "Ridoux, Julien" , virtio-dev@lists.linux.dev, "Luu, Ryan" , "Chashper, David" , "Mohamed Abuelfotoh, Hazem" , "Christopher S . Hall" , Jason Wang , John Stultz , netdev@vger.kernel.org, Stephen Boyd , Thomas Gleixner , Xuan Zhuo , Marc Zyngier , Mark Rutland , Daniel Lezcano , Alessandro Zummo , Alexandre Belloni , qemu-devel , Simon Horman Subject: Re: [PATCH] ptp: Add vDSO-style vmclock support Message-ID: <20240728062521-mutt-send-email-mst@kernel.org> References: <20240725012730-mutt-send-email-mst@kernel.org> <7de7da1122e61f8c64bbaab04a35af93fafac454.camel@infradead.org> <20240725081502-mutt-send-email-mst@kernel.org> <20240725082828-mutt-send-email-mst@kernel.org> <20240725083215-mutt-send-email-mst@kernel.org> <98813a70f6d3377d3a9d502fd175be97334fcc87.camel@infradead.org> <20240726174958.00007d10@Huawei.com> <811E8A25-3DBC-452D-B594-F9B7B0B61335@infradead.org> MIME-Version: 1.0 In-Reply-To: <811E8A25-3DBC-452D-B594-F9B7B0B61335@infradead.org> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240728_033718_653522_61D7E3D2 X-CRM114-Status: GOOD ( 48.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 26, 2024 at 07:28:28PM +0100, David Woodhouse wrote: > On 26 July 2024 17:49:58 BST, Jonathan Cameron wrote: > >On Thu, 25 Jul 2024 14:50:50 +0100 > >David Woodhouse wrote: > > > >> On Thu, 2024-07-25 at 08:33 -0400, Michael S. Tsirkin wrote: > >> > On Thu, Jul 25, 2024 at 01:31:19PM +0100, David Woodhouse wrote: > >> > > On Thu, 2024-07-25 at 08:29 -0400, Michael S. Tsirkin wrote: > >> > > > On Thu, Jul 25, 2024 at 01:27:49PM +0100, David Woodhouse wrote: > >> > > > > On Thu, 2024-07-25 at 08:17 -0400, Michael S. Tsirkin wrote: > >> > > > > > On Thu, Jul 25, 2024 at 10:56:05AM +0100, David Woodhouse wrote: > >> > > > > > > > Do you want to just help complete virtio-rtc then? Would be easier than > >> > > > > > > > trying to keep two specs in sync. > >> > > > > > > > >> > > > > > > The ACPI version is much more lightweight and doesn't take up a > >> > > > > > > valuable PCI slot#. (I know, you can do virtio without PCI but that's > >> > > > > > > complex in other ways). > >> > > > > > > > >> > > > > > > >> > > > > > Hmm, should we support virtio over ACPI? Just asking. > >> > > > > > >> > > > > Given that we support virtio DT bindings, and the ACPI "PRP0001" device > >> > > > > exists with a DSM method which literally returns DT properties, > >> > > > > including such properties as "compatible=virtio,mmio" ... do we > >> > > > > already? > >> > > > > > >> > > > > > >> > > > > >> > > > In a sense, but you are saying that is too complex? > >> > > > Can you elaborate? > >> > > > >> > > No, I think it's fine. I encourage the use of the PRP0001 device to > >> > > expose DT devices through ACPI. I was just reminding you of its > >> > > existence. > >> > > >> > Confused. You said "I know, you can do virtio without PCI but that's > >> > complex in other ways" as the explanation why you are doing a custom > >> > protocol. > >> > >> Ah, apologies, I wasn't thinking that far back in the conversation. > >> > >> If we wanted to support virtio over ACPI, I think PRP0001 can be made > >> to work and isn't too complex (even though it probably doesn't yet work > >> out of the box). > >> > >> But for the VMCLOCK thing, yes, the simple ACPI device is a lot simpler > >> than virtio-rtc and much more attractive. > >> > >> Even if the virtio-rtc specification were official today, and I was > >> able to expose it via PCI, I probably wouldn't do it that way. There's > >> just far more in virtio-rtc than we need; the simple shared memory > >> region is perfectly sufficient for most needs, and especially ours. > >> > >> I have reworked > >> https://git.infradead.org/users/dwmw2/linux.git/shortlog/refs/heads/vmclock > >> to take your other feedback into account. > >> > >> It's now more flexible about the size handling, and explicitly checking > >> that specific fields are present before using them. > >> > >> I think I'm going to add a method on the ACPI device to enable the > >> precise clock information. I haven't done that in the driver yet; it > >> still just consumes the precise clock information if it happens to be > >> present already. The enable method can be added in a compatible fashion > >> (the failure mode is that guests which don't invoke this method when > >> the hypervisor needs them to will see only the disruption signal and > >> not precise time). > >> > >> For the HID I'm going to use AMZNVCLK. I had used QEMUVCLK in the QEMU > >> patches, but I'll change that to use AMZNVCLK too when I repost the > >> QEMU patch. > > > >That doesn't fit with ACPI _HID definitions. > >Second set 4 characters need to be hex digits as this is an > >ACPI style ID (which I assume this is given AMZN is a valid > >vendor ID. 6.1.5 in ACPI v6.5 > > > >Maybe I'm missing something... > > > >J > > > > > > > > Hm, is the same not true for QEMUVGID and AMZNVGID, which I was using as an example? > > QEMU seemed to get to 0002, and AFAICT the VMGENID patches were initially posted using QEMU0003, but what's actually in QEMU now is QEMUVGID. So I presumed that was now the preferred option. Glad you asked :) ACPI 1.0 indeed did not place restrictions on it: 6.1.4 _HID This object is used to supply the OS with the device’s Plug and Play Hardware ID. When describing a platform, use of any _HID objects is optional. However, a _HID object must be used to describe any device that will be enumerated by the ACPI driver. The ACPI driver only enumerates a device when no bus enumerator can detect the device ID. For example, devices on an ISA bus are enumerated by the ACPI driver. Use the _ADR object to describe devices enumerated by bus enumerators other than the ACPI driver. A _HID object evaluates to either a numeric 32-bit compressed EISA type ID or a string. Then 3.0 was very draconic: 6.1.4 _HID (Hardware ID) This object is used to supply OSPM with the device’s Plug and Play hardware ID.8 When describing a platform, use of any _HID objects is optional. However, a _HID object must be used to describe any device that will be enumerated by OSPM. OSPM only enumerates a device when no bus enumerator can detect the device ID. For example, devices on an ISA bus are enumerated by OSPM. Use the _ADR object to describe devices enumerated by bus enumerators other than OSPM. A _HID object evaluates to either a numeric 32-bit compressed EISA type ID or a string. If a string, the format must be an alphanumeric PNP or ACPI ID with no asterisk or other leading characters. A valid PNP ID must be of the form “AAA####” where A is an uppercase letter and # is a hex digit. A valid ACPI ID must be of the form “ACPI####” where # is a hex digit. Then 5.0 changed it to: 6.1.5 _HID (Hardware ID) This object is used to supply OSPM with the device’s Plug and Play hardware ID.1 1. 256 A Plug and Play ID or ACPI ID can be obtained by sending e-mail to pnpid@microsoft.com. Hewlett-Packard/Intel/Microsoft/Phoenix/ToshibaAdvanced Configuration and Power Interface Specification When describing a platform, use of any _HID objects is optional. However, a _HID object must be used to describe any device that will be enumerated by OSPM. OSPM only enumerates a device when no bus enumerator can detect the device ID. For example, devices on an ISA bus are enumerated by OSPM. Use the _ADR object to describe devices enumerated by bus enumerators other than OSPM. Arguments: None Return Value: An Integer or String containing the HID A _HID object evaluates to either a numeric 32-bit compressed EISA type ID or a string. If a string, the format must be an alphanumeric PNP or ACPI ID with no asterisk or other leading characters. A valid PNP ID must be of the form "AAA####" where A is an uppercase letter and # is a hex digit. A valid ACPI ID must be of the form "NNNN####" where N is an uppercase letter or a digit ('0'-'9') and # is a hex digit. This specification reserves the string "ACPI" for use only with devices defined herein. It further reserves all strings representing 4 HEX digits for exclusive use with PCI-assigned Vendor IDs. Long story short, QEMUVGID is indeed out of spec, but it works both because of guest compatibility with ACPI 1.0, and because no one much uses it. -- MST