From nobody Mon Feb 9 08:44:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1584032919; cv=none; d=zohomail.com; s=zohoarc; b=mBHQ3yyB3kZeRVPDdlxgxH83bFOblp59IhWjPoMk2TBIilpwTO6QGr0kBekq8pGuQwCWvbpiQj9+riOiL2AzwXJTjtAaYOafu5dppO0mB+gICdxASb3eKh++pr7ytE3HglKvIrM/2nTI3pSyQhnPq2sW6Oy3YZhEy5S+89hKEWQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584032919; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g6qY4i4vgHefsZSdoW4iuGQifGKkSLq71edUG4ox0Vk=; b=UgUIjIYbFpv0Bz7ltZQtMw6UHNWRt3QbutvrItl5I6XFd8QSK4XydB3ERpxGk6ZlKF7tG/N8cATpxdrcmagSn3iDsh4Jsen1DtyzS+A+FXLfKLoVJp5bJLRUK0FOPIZmnXAra6HLxNXAy1I5pyZG7ofARw4x1eMGGwUV8mus+Z4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584032919365904.2995460771991; Thu, 12 Mar 2020 10:08:39 -0700 (PDT) Received: from localhost ([::1]:46154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCRK2-00050a-Ak for importer@patchew.org; Thu, 12 Mar 2020 13:08:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37122) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCR4v-0003MM-Vy for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCR4u-0000nb-VN for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:53:01 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:38142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCR4u-0000mY-Og for qemu-devel@nongnu.org; Thu, 12 Mar 2020 12:53:00 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02CGn1I8177998; Thu, 12 Mar 2020 16:52:58 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2yp9v6dw5w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Mar 2020 16:52:58 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 02CGoHv4122238; Thu, 12 Mar 2020 16:52:57 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2yp8r0snxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Mar 2020 16:52:57 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 02CGquRS032444; Thu, 12 Mar 2020 16:52:56 GMT Received: from spark.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 12 Mar 2020 09:52:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=g6qY4i4vgHefsZSdoW4iuGQifGKkSLq71edUG4ox0Vk=; b=tAeKQReQzOnJXrcp9gL8dxdPtFUk/MhJ9+WLTMPfveiH2M2tAoH0PXVbmUD4wKDn6iDt b/uihJCv01PGM2sRn6AMjT2s8QELuF7wOmLFLz0ht+o+68yPeDbqsrnyjc7TOJPFXGOt d4W9fHetSAltU+P+HR8pQ16eoWeEjFhzaLwTR/cem4wk3c3vHThSi2kqqYUG0ysIIyAg AyR0URSfvMDpgMgl1+58UjXz6LeHHSFk8r1a/N27fHtLf0Ik14v8lZqfHNNbgd0HDU3S NZXMHse7xdA5HJUKswf4yb+tyd2zQ95JIFKYSAKx/V64VfvxdDEP8w12BjAKHEkjy/EA 8Q== From: Liran Alon To: qemu-devel@nongnu.org Subject: [PATCH v3 13/16] hw/i386/vmport: Allow x2apic without IR Date: Thu, 12 Mar 2020 18:54:28 +0200 Message-Id: <20200312165431.82118-14-liran.alon@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200312165431.82118-1-liran.alon@oracle.com> References: <20200312165431.82118-1-liran.alon@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9558 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=1 bulkscore=0 spamscore=0 mlxlogscore=784 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003120085 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9558 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 spamscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 mlxlogscore=848 phishscore=0 adultscore=0 clxscore=1015 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003120085 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, Liran Alon , Nikita Leshenko , pbonzini@redhat.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signal to guest that hypervisor supports x2apic without VT-d/IOMMU Interrupt-Remapping support. This allows guest to use x2apic in case all APIC IDs fits in 8-bit (i.e. Max APIC ID < 255). See Linux kernel commit 4cca6ea04d31 ("x86/apic: Allow x2apic without IR on VMware platform") and Linux try_to_enable_x2apic() function. Reviewed-by: Nikita Leshenko Signed-off-by: Liran Alon --- hw/i386/vmport.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index 2ce78aaf7b4c..1664a6b97332 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -208,7 +208,14 @@ static uint32_t vmport_cmd_time_full(void *opaque, uin= t32_t addr) =20 static uint32_t vmport_cmd_get_vcpu_info(void *opaque, uint32_t addr) { - return 1 << VCPU_INFO_RESERVED_BIT; + X86CPU *cpu =3D X86_CPU(current_cpu); + uint32_t ret =3D 0; + + if (cpu->env.features[FEAT_1_ECX] & CPUID_EXT_X2APIC) { + ret |=3D 1 << VCPU_INFO_LEGACY_X2APIC_BIT; + } + + return ret; } =20 /* vmmouse helpers */ --=20 2.20.1