From nobody Tue May 21 16:21:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1710943128; cv=none; d=zohomail.com; s=zohoarc; b=UL5DPSWIBo5PFqbwIjmwRKUvGHalJQAiFWyP4VpXlOUmGSMAnPS0UR8CpBaCuKnO4xLfIfljsaZ/HVnBJBfe66TeWaiUfTa6UYcWmOc0aPBNNLVZRBcM5eM9rCUAmqVtlISXr5qnZmz3FPg8YBIx9OH9MW7cG1EuCxfVmGvNs9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710943128; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PdPBqG47aaueb+ZzuI4mZsQ5oY2pC9/88VWb9N+cIZI=; b=J/hH+qb+sT1McM69VMA0Z7fhj3aLqSTgA856wM45bVczZj6Jm2/o3HUwKI8bbVHv3q6/gB24tfvafZhH0ubdwiZhP/GpUg+EKbg+EjwehknZMOJiwk4ANcyvPN3GR74eoCxNQZ7XD9s+/+E/twa84CG8ot6glT4RMbWrksNkFhA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1710943128250165.8761982754097; Wed, 20 Mar 2024 06:58:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.695928.1086251 (Exim 4.92) (envelope-from ) id 1rmwSY-0000jw-8f; Wed, 20 Mar 2024 13:58:26 +0000 Received: by outflank-mailman (output) from mailman id 695928.1086251; Wed, 20 Mar 2024 13:58:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmwSY-0000jp-5p; Wed, 20 Mar 2024 13:58:26 +0000 Received: by outflank-mailman (input) for mailman id 695928; Wed, 20 Mar 2024 13:58:24 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rmwSW-0000jj-L7 for xen-devel@lists.xenproject.org; Wed, 20 Mar 2024 13:58:24 +0000 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [2607:f8b0:4864:20::832]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ea4538bd-e6c1-11ee-afdd-a90da7624cb6; Wed, 20 Mar 2024 14:58:23 +0100 (CET) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-430c32c04c7so27459821cf.0 for ; Wed, 20 Mar 2024 06:58:23 -0700 (PDT) Received: from localhost ([85.31.135.62]) by smtp.gmail.com with ESMTPSA id ev15-20020a05622a510f00b00430ea220b32sm1976799qtb.71.2024.03.20.06.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 06:58:21 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ea4538bd-e6c1-11ee-afdd-a90da7624cb6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1710943101; x=1711547901; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PdPBqG47aaueb+ZzuI4mZsQ5oY2pC9/88VWb9N+cIZI=; b=OydYDUzL8B21PIfKzoRCOkcPhIlvoW7ONHjECbTN/+Aw/blh5nfITaEZ7NuNU8NOit nSCRL5Cg4lKdIWrR8sD+Z5VJ4rMxvqfSYBrWcxpUKrSWxU818NkGRFJLibl6dNUPoD/P upBTN7PuuCAfQKcAXBvzp1oicRO431o1SiMzM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710943101; x=1711547901; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PdPBqG47aaueb+ZzuI4mZsQ5oY2pC9/88VWb9N+cIZI=; b=J8NazTdn5mcxkkk33jsFh6v5zIjeOM42A7qkh3q/FCDICaQM1JWg0IhiWPfK2KwTdD C5hgDwXx+vVhXvNEvI9Zne9/5AWeIiAHk03+RhAcdxayNzonO2wqVT/cWbMBC/7h8HHq XHFvHB37IS6I89cJgum0k1i1gmqXork5fK2H+eJSSqISFBkGq26HGBn374lMGGAtG2UM 7ln93viTjh9x/siEgGuK9FgON2z6VyZA6fFxXT4Okht0IhBIjbHy57PGCgBsKHhhwTR9 AD1uUMWhBJgKmuh2oD/C6UWyv05Uo+bnPXuwwKoZI/3XeJez7L6TvvgIubTRsowb3q+M djOg== X-Gm-Message-State: AOJu0Yy3cex1ymLYMWCm+Hk/p0tCjjLX7I8USKLtmvKW4SmBJn1q6tUY VKlpiFdk3xJwe2vHPSYm4R+glymSByWXQ3lk/iUfnKxBz7bSO1DJzBz6WoamPbuKxOnrW2/3gSL E X-Google-Smtp-Source: AGHT+IFRaC/mtYKrPH2Y8fC7/zgDT7MdTedS42YUk2f+z3XdWqpj+faQ7c+ve0RBbBIBmRe08BPR9g== X-Received: by 2002:ac8:58d2:0:b0:430:ce8c:9581 with SMTP id u18-20020ac858d2000000b00430ce8c9581mr10706164qta.22.1710943101377; Wed, 20 Mar 2024 06:58:21 -0700 (PDT) From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH] x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs Date: Wed, 20 Mar 2024 14:57:20 +0100 Message-ID: <20240320135720.68894-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1710943128929100001 There's no reason to force HVM guests to have a valid vcpu_info area when initializing a vCPU, as the vCPU can also be brought online using the local APIC, and on that path there's no requirement for vcpu_info to be setup ahe= ad of the bring up. Note an HVM vCPU can operate normally without making use = of vcpu_info. Restrict the check against dummy_vcpu_info to only apply to PV guests. Fixes: 192df6f9122d ('x86: allow HVM guests to use hypercalls to bring up v= CPUs') Signed-off-by: Roger Pau Monn=C3=A9 --- xen/common/compat/domain.c | 2 +- xen/common/domain.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c index 7ff238cc2656..6b4afc823217 100644 --- a/xen/common/compat/domain.c +++ b/xen/common/compat/domain.c @@ -49,7 +49,7 @@ int compat_common_vcpu_op(int cmd, struct vcpu *v, { case VCPUOP_initialise: { - if ( v->vcpu_info_area.map =3D=3D &dummy_vcpu_info ) + if ( is_pv_domain(d) && v->vcpu_info_area.map =3D=3D &dummy_vcpu_i= nfo ) return -EINVAL; =20 #ifdef CONFIG_HVM diff --git a/xen/common/domain.c b/xen/common/domain.c index f6f557499660..d956dc09eca0 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1817,7 +1817,7 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUES= T_HANDLE_PARAM(void) arg) switch ( cmd ) { case VCPUOP_initialise: - if ( v->vcpu_info_area.map =3D=3D &dummy_vcpu_info ) + if ( is_pv_domain(d) && v->vcpu_info_area.map =3D=3D &dummy_vcpu_i= nfo ) return -EINVAL; =20 rc =3D arch_initialise_vcpu(v, arg); --=20 2.44.0