From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: ARM: KVM/XEN: how should we support virt-what? Date: Fri, 27 Mar 2015 11:25:04 +0100 Message-ID: <20150327102503.GA3120@hawk.usersys.redhat.com> References: <20150325094440.GB3163@hawk.usersys.redhat.com> <20150326090150.GA3073@hawk.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Ian Campbell , KVM devel mailing list , Marc Zyngier , tim@xen.org, "xen-devel@lists.xen.org" , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" To: Ard Biesheuvel Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu List-Id: kvm.vger.kernel.org On Thu, Mar 26, 2015 at 07:50:06PM +0100, Ard Biesheuvel wrote: > On 26 March 2015 at 19:49, Ard Biesheuvel wrote: > > On 26 March 2015 at 19:45, Stefano Stabellini > > wrote: > >> On Thu, 26 Mar 2015, Andrew Jones wrote: > >>> On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: > >>> > Hello ARM virt maintainers, > >>> > > >>> > I'd like to start a discussion about supporting virt-what[1]. virt-what > >>> > allows userspace to determine if the system it's running on is running > >>> > in a guest, and of what type (KVM, Xen, etc.). Despite it being a best > >>> > effort tool, see the Caveat emptor in [1], it has become quite a useful > >>> > tool, and is showing up in different places, such as OpenStack. If you > >>> > look at the code[2], specifically [3], then you'll see how it works on > >>> > x86, which is to use the dedicated hypervisor cpuid leaves. I'm > >>> > wondering what equivalent we have, or can develop, for arm. > >>> > Here are some thoughts; > >>> > 0) there's already something we can use, and I just need to be told > >>> > about it. > >>> > 1) be as similar as possible to x86 by dedicating some currently > >>> > undefined sysreg bits. This would take buy-in from lots of parties, > >>> > so is not likely the way to go. > >>> > 2) create a specific DT node that will get exposed through sysfs, or > >>> > somewhere. > >>> > 3) same as (2), but just use the nodes currently in mach-virt's DT > >>> > as the indication we're a guest. This would just be a heuristic, > >>> > i.e. "have virtio mmio" && psci.method == hvc, or something, > >>> > and we'd still need a way to know if we're kvm vs. xen vs. ??. > >>> > > >>> > Thanks, > >>> > drew > >>> > > >>> > [1] http://people.redhat.com/~rjones/virt-what/ > >>> > [2] http://git.annexia.org/?p=virt-what.git;a=summary > >>> > [3] http://git.annexia.org/?p=virt-what.git;a=blob_plain;f=virt-what-cpuid-helper.c;hb=HEAD > >>> > >>> Thanks everyone for their responses. So, the current summary seems to > >>> be; > >>> 1) Xen has both a DT node and an ACPI table, virt-what can learn how > >>> to probe those. > >>> 2) We don't have anything yet for KVM, and we're reluctant to create a > >>> specific DT node. Anyway, we'd still need to address ACPI booted > >>> guests some other way. > >>> > >>> For a short-term, DT-only, approach we could go with a heuristic, one > >>> that includes Marc's "if hypervisor node exists, then xen, else kvm" > >>> condition. > >>> > >>> How about SMBIOS for a long-term solution that works for both DT and > >>> ACPI? We're not populating SMBIOS for arm guests yet in qemu, but now > >>> that AAVMF has fw_cfg, we should be able to. On x86 we already have > >>> smbios populated from qemu, although not in a way that allows us to > >>> determine kvm vs. xen vs. tcg. > >> > >> I don't think that SMBIOS works with DT. > >> > > > > SMBIOS works fine with DT > > ... but it needs UEFI ... Yes. Perhaps the short-term solution will be a long-term solution for DT-only, non-UEFI guests, but we can do better for the guests with UEFI, that may or may not be ACPI, by using SMBIOS. Unless somebody objects to either/both of these paths, then I guess we'll start heading down them both. Thanks, drew From mboxrd@z Thu Jan 1 00:00:00 1970 From: drjones@redhat.com (Andrew Jones) Date: Fri, 27 Mar 2015 11:25:04 +0100 Subject: ARM: KVM/XEN: how should we support virt-what? In-Reply-To: References: <20150325094440.GB3163@hawk.usersys.redhat.com> <20150326090150.GA3073@hawk.usersys.redhat.com> Message-ID: <20150327102503.GA3120@hawk.usersys.redhat.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Mar 26, 2015 at 07:50:06PM +0100, Ard Biesheuvel wrote: > On 26 March 2015 at 19:49, Ard Biesheuvel wrote: > > On 26 March 2015 at 19:45, Stefano Stabellini > > wrote: > >> On Thu, 26 Mar 2015, Andrew Jones wrote: > >>> On Wed, Mar 25, 2015 at 10:44:42AM +0100, Andrew Jones wrote: > >>> > Hello ARM virt maintainers, > >>> > > >>> > I'd like to start a discussion about supporting virt-what[1]. virt-what > >>> > allows userspace to determine if the system it's running on is running > >>> > in a guest, and of what type (KVM, Xen, etc.). Despite it being a best > >>> > effort tool, see the Caveat emptor in [1], it has become quite a useful > >>> > tool, and is showing up in different places, such as OpenStack. If you > >>> > look at the code[2], specifically [3], then you'll see how it works on > >>> > x86, which is to use the dedicated hypervisor cpuid leaves. I'm > >>> > wondering what equivalent we have, or can develop, for arm. > >>> > Here are some thoughts; > >>> > 0) there's already something we can use, and I just need to be told > >>> > about it. > >>> > 1) be as similar as possible to x86 by dedicating some currently > >>> > undefined sysreg bits. This would take buy-in from lots of parties, > >>> > so is not likely the way to go. > >>> > 2) create a specific DT node that will get exposed through sysfs, or > >>> > somewhere. > >>> > 3) same as (2), but just use the nodes currently in mach-virt's DT > >>> > as the indication we're a guest. This would just be a heuristic, > >>> > i.e. "have virtio mmio" && psci.method == hvc, or something, > >>> > and we'd still need a way to know if we're kvm vs. xen vs. ??. > >>> > > >>> > Thanks, > >>> > drew > >>> > > >>> > [1] http://people.redhat.com/~rjones/virt-what/ > >>> > [2] http://git.annexia.org/?p=virt-what.git;a=summary > >>> > [3] http://git.annexia.org/?p=virt-what.git;a=blob_plain;f=virt-what-cpuid-helper.c;hb=HEAD > >>> > >>> Thanks everyone for their responses. So, the current summary seems to > >>> be; > >>> 1) Xen has both a DT node and an ACPI table, virt-what can learn how > >>> to probe those. > >>> 2) We don't have anything yet for KVM, and we're reluctant to create a > >>> specific DT node. Anyway, we'd still need to address ACPI booted > >>> guests some other way. > >>> > >>> For a short-term, DT-only, approach we could go with a heuristic, one > >>> that includes Marc's "if hypervisor node exists, then xen, else kvm" > >>> condition. > >>> > >>> How about SMBIOS for a long-term solution that works for both DT and > >>> ACPI? We're not populating SMBIOS for arm guests yet in qemu, but now > >>> that AAVMF has fw_cfg, we should be able to. On x86 we already have > >>> smbios populated from qemu, although not in a way that allows us to > >>> determine kvm vs. xen vs. tcg. > >> > >> I don't think that SMBIOS works with DT. > >> > > > > SMBIOS works fine with DT > > ... but it needs UEFI ... Yes. Perhaps the short-term solution will be a long-term solution for DT-only, non-UEFI guests, but we can do better for the guests with UEFI, that may or may not be ACPI, by using SMBIOS. Unless somebody objects to either/both of these paths, then I guess we'll start heading down them both. Thanks, drew