Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp396558pxb; Tue, 3 Nov 2020 02:27:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+gpeb8BydDyqv2J53LsgrLdVPMxSStLk2IFG4qSCqJg49kChhptXgmpWyfpVbUwcF/jBB X-Received: by 2002:a17:906:4748:: with SMTP id j8mr2441504ejs.22.1604399254629; Tue, 03 Nov 2020 02:27:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604399254; cv=none; d=google.com; s=arc-20160816; b=YWIPi+isWjwv5RvSKiS65MZx8TNzGcv0/x9wSUofMmIYNu07okLs4ZEBXxDvkNEIFH 3JfR5RKtv2pdOa63//Z+hWFgExYdu+ULcevyAYV023pqNW/Aoj5cPnw5tkR3B1i42+AP +01Y5Zm5Ze4itiEUXwIh6MXGpzuI9/MpYd0NNXweLTSFu8RuAuhBDwASsK6GNvDEjYr+ IEzaDp5gQIH8ftoxl7PMX2CzeC62uAkSPsVZy92lPP0KOpIWZ9xfpiQ8Zo2Lo0WxfGLz KdOkm6yr9URZUR448HxXIA2tLs68+M/aK7ECBhdGujHdbTjGbhkz30KqKn0B9egJ9hpM UmeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jmja/QfDPCZEo2TLVBj+4U5mu7pdYN9iPevbinoGNcA=; b=vI1tsYQsER2XN7DWWLsvKDpfedSbu8qQCBSHrBuUWAV/DgPglxC/nVU7i9c3TvTO3r fDyNxi/Lq8Fp8MDyPJiyeo9aLnNtT3ZNx44lBRRF/oPJEaWb/mgbzwsPORrykS50Qvv8 mcaN8yId/uMOITB6nzlrfbYr09RZJtyb2TidP6P/O0PSuaqkO+MDv6e08BOTeol6Evgn ZLme2dWCwTiLNVWbRtCQsgWAR2kEo5IMnn/2fdweZ2u8AaCciWqgMtzhSJyjfnG3u8bQ N69LTFIdmwdhBV+Eqd6ve83y7HXI67iZz2/qq5hjVGd+DE5BOL0woLZtLo84QMmsdMoG Y5ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=HYtVGEtU; 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=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a91si7967279edf.472.2020.11.03.02.27.11; Tue, 03 Nov 2020 02:27:34 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=HYtVGEtU; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727470AbgKCKZu (ORCPT + 99 others); Tue, 3 Nov 2020 05:25:50 -0500 Received: from mail.skyhub.de ([5.9.137.197]:44670 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726058AbgKCKZu (ORCPT ); Tue, 3 Nov 2020 05:25:50 -0500 Received: from zn.tnic (p200300ec2f10e0003c085ddaf11537c5.dip0.t-ipconnect.de [IPv6:2003:ec:2f10:e000:3c08:5dda:f115:37c5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 347511EC03B9; Tue, 3 Nov 2020 11:25:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1604399149; 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:in-reply-to:in-reply-to: references:references; bh=jmja/QfDPCZEo2TLVBj+4U5mu7pdYN9iPevbinoGNcA=; b=HYtVGEtUdzhFkTtrCTTpaPnykto98yNQQN6JlbjQK8eBLHUULD5XdUOwmgVQqjDHboAl6F Khapm2etZvL8Tt08bzJ3oEmrSanPFFMe90eIt8JFsp7CJ6NERusvoJtPvXH+3eQPEMMlUt 9j66961oBHpS0sVF4NU6I5HdysA2WKY= Date: Tue, 3 Nov 2020 11:25:38 +0100 From: Borislav Petkov To: Shuo A Liu Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , Sean Christopherson , Yu Wang , Reinette Chatre , Yin Fengwei , Dave Hansen , Dan Williams , Zhi Wang , Zhenyu Wang Subject: Re: [PATCH v5 03/17] x86/acrn: Introduce an API to check if a VM is privileged Message-ID: <20201103102538.GB6310@zn.tnic> References: <20201019061803.13298-1-shuo.a.liu@intel.com> <20201019061803.13298-4-shuo.a.liu@intel.com> <20201102143707.GC15392@zn.tnic> <20201103062718.GD12408@shuo-intel.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201103062718.GD12408@shuo-intel.sh.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 03, 2020 at 02:27:18PM +0800, Shuo A Liu wrote: > The code just followed KVM style (see kvm_arch_para_features()). Do you see Documentation/virt/kvm/cpuid.rst? Now where is yours explaining what your hypervisor is doing? > I can change to use > cpuid_eax(acrn_cpuid_base() + 1)... > If you prefer to. Yes please. > hypervisor_cpuid_base() implies the base is variable, no? We use > this function to detect the base. Yes, but you need to document all that and make it clear and understandable. If Linux is supposed to run as an acrn guest, that interface better be documented just like KVM does. Also, if there's a bug in the KVM guest/host interface, we might be able to fix it modulo ABI. Is that possible with acrn? I'm guessing the answer to that is yes if I'm looking at https://github.com/projectacrn/acrn-hypervisor ? > OK. Then i will define acrn_cpuid_base() as a static inline function > in asm/acrn.h for callers. Yah, that function is simple enough. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette