From patchwork Wed Sep 4 16:15:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=NXweBCCd; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSKn4mjdz1yg3 for ; Thu, 5 Sep 2024 02:16:29 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsfp-0001Ek-43; Wed, 04 Sep 2024 12:16:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfb-0001C4-Lh for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:15:50 -0400 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfY-0002G8-Kc for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:15:47 -0400 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-53560b2b444so885831e87.1 for ; Wed, 04 Sep 2024 09:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466542; x=1726071342; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0FTAVDz3Cw1uxIbhjmeqEYJqdjw34VbylOmDWLTwvx4=; b=NXweBCCdnFU7LLdDAQGUfdqd2uTv52ZlVtS3uh+OudzTtYh+7XCCyyMHY77Zy6+DNO AjTcOC9x/Yb0k8P0dkLEvhI84YY+8xjX8bLUM3ZCp7xbQqXKIMWgmyzxilY8TQwH/0PX +2ZpqqdpgfspqCHoUzBuNuC9Dhqgl70HpNJfpRvIXSmeRZUR4Z5fyqELMK6JhU1yv+6g lwmZHubkW0NykN6lcNt7/VET4h27CG4uB1ZY/tEuVYUT0Q0allqPNSQr+kTu45vRqL+w qnvGEVCRYfaiNgvtkP6cjKjjp0urPNhc+DDi/elypbSvqQxiq1o/6n1CAIFrw3K0llmP 5dvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466542; x=1726071342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0FTAVDz3Cw1uxIbhjmeqEYJqdjw34VbylOmDWLTwvx4=; b=FxFWBCLyMcAsYqpJjb36Cr042GXl3LlMSYmNZ5bjs87yHeUZ0229YO8VRm1Xw7OgPb giqqMiI/8iBQcIITdHHCiXdPnJ1J9IgenfvCIr6C5i6FzVTROmWPhC2YMGILQlhIVpCS 9iYHwmGN/GRedVeyahyfSwQDQqkGP83o5uqSTC8pKpsMW7I+158FlPdIYE5pjLDWxNEU PpqmVrB4Gepzfj+yuzIZervkc3tn2fbs2zrWXMVjpHb8CYD/Urv8HX7BoIn1OAlXJ7gk /v8//8bMTiLnyoFLtrndfLL+KiW2Elc6mR2On8r/i6FboglmHdph/Jmc4YK0bbjlIPY4 ftag== X-Gm-Message-State: AOJu0YxfdAmUEt1EL0+dChOZDoWVrjBR2EzQatdr3zJxIQsWe1+zEigH CDVBGFiqxcm4TcEts0FDgjg5kheuKhPQvKnSJVvPh6sg4R/+tAFnxJCcs9V+ X-Google-Smtp-Source: AGHT+IHC0J9+zgjr7h0VEYt97jGSExgSr1FAsQqqdgyp0zbhmgvQIcgxO+eUjmYELzyzyL1eJMTb6Q== X-Received: by 2002:a05:6512:4004:b0:52f:336:e846 with SMTP id 2adb3069b0e04-53567790120mr922274e87.14.1725466541521; Wed, 04 Sep 2024 09:15:41 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5356827b716sm205130e87.240.2024.09.04.09.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:41 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org Subject: [PULL v1 01/12] MAINTAINERS: Add docs/system/arm/xenpvh.rst Date: Wed, 4 Sep 2024 18:15:25 +0200 Message-ID: <20240904161537.664189-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x12c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Acked-by: Stefano Stabellini --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3584d6a6c6..c2fb0c2f42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -559,6 +559,7 @@ F: include/hw/xen/ F: include/sysemu/xen.h F: include/sysemu/xen-mapcache.h F: stubs/xen-hw-stub.c +F: docs/system/arm/xenpvh.rst Guest CPU Cores (NVMM) ---------------------- From patchwork Wed Sep 4 16:15:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980927 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nVEi3m4V; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSLx3ykZz1yg3 for ; Thu, 5 Sep 2024 02:17:29 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsg2-0001lE-6l; Wed, 04 Sep 2024 12:16:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsff-0001DB-9h; Wed, 04 Sep 2024 12:15:51 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfa-0002GJ-B3; Wed, 04 Sep 2024 12:15:48 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5353d0b7463so11546077e87.3; Wed, 04 Sep 2024 09:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466544; x=1726071344; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=N6K1JnQDB3GxWbgLc2L3O0RRJjZo+EVTDK5d5nCO5jo=; b=nVEi3m4VUT785Tn+uvYQSKtzm35qwqWTjSnRxTAzUU3ydvvIipPfR2pBF5+iwIE1hS H9WSYUrPawi8VavgGzDm3butnsQC/5ohXS/hdaLarXDAqK2hV4jzZc+CmqHp9fa1MEQ8 JpBikQtSbErx031ZKwQnGFZb57Dr+wIeth+DB2hSON6vAHJrILcrezYFt/pG4T5ye0fk alat4VWJRIY8QpY/dGUAFldNOgL/svDZFmJ42g0qkWX52nAu0DJR4qJ6LtUQ3bXaCcrX uE3sYCxrt+QYUF8vtJGUn42mfvvwnVzX6kCC7cfEEWEYpC8sRvoaQrCI2YT6VROCYJaq euHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466544; x=1726071344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N6K1JnQDB3GxWbgLc2L3O0RRJjZo+EVTDK5d5nCO5jo=; b=BedZLwzMexR/Fu5sS/4KzJfBVrRTBecS7nVw4xW5ny6K64vB0lLC59y/2TTGW9W10s 2gfiaXqG0dyXzijk3yJBWl578ioBPUmXW8pQSFUkNuDyXRkYxvQiz5SrApz/+4Iseoc1 LoWtsvFevaehTPUqLM8edWsd34JoWAjp51C//JS+je3cNsknyupHnwyeOYEKeDT9vPWz cVi7DsV9L+gOTonyqBen7P7DO3rvhzpMjQXsyuxWo99ivRfJkvAxN4YEBLEngTirg20c WJ3DH0jz1/iFeOtJXPCJLr9m5UleFP1ZrcfJy99eiULAfYoS2tk48lGPu0Hm1eeYAE4F mymw== X-Forwarded-Encrypted: i=1; AJvYcCUOv+bY8hprCUQRG0kSp5F3bsIuLzoN1crFMFM7gzn1v5NE+LqFiOs9C7/d9KS1hTw20C/c3cAnQw==@nongnu.org X-Gm-Message-State: AOJu0YwaevuiQjHMk182+jW8ibdmzlCbXjMJq1dEX1fPTiZJu5KERKq5 /IUdyBb6P3QZ0PUorNM/uOwnqt2DnERIHMqfpeKT0CoD13mdGsODQfHO7PeY X-Google-Smtp-Source: AGHT+IFom4VEXuZYnoDrA4HGURvL615ZNQmYPSqV45hP6uADwmwNAHyfJ2jP5ftIt03oSUiu6NVu1A== X-Received: by 2002:ac2:4e06:0:b0:533:483f:9562 with SMTP id 2adb3069b0e04-53546bde03emr15776888e87.42.1725466543416; Wed, 04 Sep 2024 09:15:43 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-535692d9bf6sm176315e87.41.2024.09.04.09.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:42 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 02/12] hw/arm: xenpvh: Update file header to use SPDX Date: Wed, 4 Sep 2024 18:15:26 +0200 Message-ID: <20240904161537.664189-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Update file header to use SPDX and remove stray empty comment line. No functional changes. Signed-off-by: Edgar E. Iglesias Acked-by: Stefano Stabellini --- hw/arm/xen_arm.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 6fad829ede..766a194fa1 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -1,24 +1,7 @@ /* * QEMU ARM Xen PVH Machine * - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. + * SPDX-License-Identifier: MIT */ #include "qemu/osdep.h" From patchwork Wed Sep 4 16:15:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=Sp3s8eRy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSPS3Gykz1yg3 for ; Thu, 5 Sep 2024 02:19:40 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsg5-0002EA-RU; Wed, 04 Sep 2024 12:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfj-0001F6-1g; Wed, 04 Sep 2024 12:16:01 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfc-0002GX-VO; Wed, 04 Sep 2024 12:15:52 -0400 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2f64cc05564so22260261fa.2; Wed, 04 Sep 2024 09:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466546; x=1726071346; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cXrv0E3MFlFU+ItFyAOjyjeGygFPyj9i38Ckg44wQ0M=; b=Sp3s8eRynDyKEw57hJq/Ugxj/jJc4H0bfVxcbxzmL7ZEsT3Rdhof/eBRaD2nn2PQKa snCvNmvlfM9E38g7QOkd4oqRmLTM5FA1YpYC0gAvv0m4pN9m77cmmSTos+f0gkd86vuT dxo4p2+j/sIYc4R6NRYf5FI9htvPX4EcZRPw9R/ZE0gCZEWTNo6iR88nv/U0je8AezcZ +Ifr7pEp5xd/GbdDFRQailQk4BVBI3ysUiIuuMpoJf/V+YXnag48SDeyUzTpgFQmGuLD NezhaEE/FJQQBHcuHfU6O+GOv8YF/cicxVB007SDMDDUn/7cx0Mrub0zBJsm8GZ9OPTA EaxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466546; x=1726071346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cXrv0E3MFlFU+ItFyAOjyjeGygFPyj9i38Ckg44wQ0M=; b=ZnsxpWFOix7kfZdzOKx1VD+oTjxhgdK3+fJ8aCxpeflW1xZM8skuKOULjgkrTOeTY/ q/RHENyUDQG/htoDPVoCSQPcDrccS0yXyxVBmTe3Z0ax16ETMwJZcLMmFtUztR6oTHCx 01FsdAHSNwOvsExP8Os5HrB9E8kDPez4gCPPBi8HReM81YW8O9m59swFsdsOqmIHmvR6 R+Zxkh0Bdlr2sK8vDd6ZypIYn7rEvDIKnZyDWesmUGxOYRr4ANYwBPxzsqU+XjC9vKwk tmRdJ23ZlkC805HXuVyFTH98VIxCZDRIWe9OzuksHCwu4ekhQXsQ544aAia/SBKqVM/b FGcg== X-Forwarded-Encrypted: i=1; AJvYcCWRZkxJcNEOQMzWNkC+yDgIml83tGCWQMnOMEkxX8uwsPH4irpI4FWXVEKgrhlwkaljGdYsJQNItA==@nongnu.org X-Gm-Message-State: AOJu0Yyjk40xFydi+SpZw2xRsTiH5aPehvkI/AnAgelEjNHbgQ1lF3PQ c0zwg40bgc2J8bcTNROoj8ea2XWoIcEf9X0uvG53t2KnHSQlIA5Mua+WrR1O X-Google-Smtp-Source: AGHT+IGAyh4WUxY9AfkVPMwTqyaGKO5sye5d21g+iPTe1bXZL4tYnRRSXSRVmyNk0vZJE9XGQJOMBA== X-Received: by 2002:a2e:a586:0:b0:2f3:f4e2:869c with SMTP id 38308e7fff4ca-2f64d570e98mr37440521fa.44.1725466545191; Wed, 04 Sep 2024 09:15:45 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f614f0079fsm25852041fa.37.2024.09.04.09.15.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:44 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 03/12] hw/arm: xenpvh: Tweak machine description Date: Wed, 4 Sep 2024 18:15:27 +0200 Message-ID: <20240904161537.664189-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Tweak machine description to better express that this is a Xen PVH machine for ARM. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 766a194fa1..5f75cc3779 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -216,7 +216,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->desc = "Xen Para-virtualized PC"; + mc->desc = "Xen PVH ARM machine"; mc->init = xen_arm_init; mc->max_cpus = 1; mc->default_machine_opts = "accel=xen"; From patchwork Wed Sep 4 16:15:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=D6nnaplv; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSLz3rxdz1yXY for ; Thu, 5 Sep 2024 02:17:31 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsg5-0002Cn-Nh; Wed, 04 Sep 2024 12:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfk-0001FG-Ko; Wed, 04 Sep 2024 12:16:00 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsff-0002Gd-1a; Wed, 04 Sep 2024 12:15:52 -0400 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5356bb55224so348912e87.0; Wed, 04 Sep 2024 09:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466546; x=1726071346; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+QaVLnXt0IgeqG1OF+UMCmmf0V+2Gd+nNBZAoCF8K30=; b=D6nnaplvvfiyJYVgHB+mKKe2Sx/ogFuk1POpArw0YQy9rr3W6Qk+k58aAw6mydYo2J AC2KQHuW8inLu6Z1DisseL+TQrhe88EbS8yE5+b9ZUuWmksHE5vEW0qNLGfU0S9oVXIf mEPr6nQGZMq7W22gwbBCFXXGF8Rg/OKn5iFWcXveSBTfffh5vZQ9wQeFeW6CGG+Q/AHH MT4lCfjxApuRINYDv0WTuwuBH6yMbm5sgZOLSyCK8xp22BKTt1GGlYcRaAAMi03pohtJ FN1uPTtqCzX3QfTnFkxb7FwQ+yBcqJblGZQgLlJ3c2o4QMIsMfymroEgPVQ5OGSca7nS m8nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466546; x=1726071346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+QaVLnXt0IgeqG1OF+UMCmmf0V+2Gd+nNBZAoCF8K30=; b=Jq3kJ+4E7+wNCpL2uG3GB7oREETieO1k8yjb+swSHxuhE0BXLXnikMvCpx54V5iEh5 JUSzDk+Qhfwf3Hjte8cbT23MwPiTaMXaCgTbhxEXLjf/QoEcOCMfld0OOxYsPOlmsF7Z 7Ci1BVLEAtaQLPh85Lor/qBC5L/6TPLejny0W9isB49qLKp+n6fJ8j4Ul964cnHlQBxO ermg/gHhbChlUaSpsNzDrpW5GW76h3p8iOUZnRX5g8J+Si4r7bzai7Nrc9+twfrXlT3W 9dO4oFY1h53dnZpEbNy87Z/qglnG3O+NlaReMWVK7tYWl1hRNzalgRdyPO65EOJ5pbWz n5Fw== X-Forwarded-Encrypted: i=1; AJvYcCXK+2GjIQ+jEdetym/O2po6xxUUeuCtF9iZj1KBoAPCLgLcDiq33I9zyUmPCTJP4nAzVrtzJB2ncg==@nongnu.org X-Gm-Message-State: AOJu0YxjCCpX0lWvJrSsrk94iFPP1S2ZKbX16sRbYqsFtQbbKk1YIAZX B36LOm1DKLhOyHVHfJ51JQKhk1Q/zqVPvfeNSandSS/4phJYr9xSqqk+8MVG X-Google-Smtp-Source: AGHT+IEVrMi7SUj3gDc4PnljMDbfUGQS9M6WFx0DSiUFiYCkcinXMFPRnZOAOrty7uworisOgwpFVQ== X-Received: by 2002:a05:6512:3e08:b0:52f:2ea:499f with SMTP id 2adb3069b0e04-53546b3b1d7mr12943686e87.24.1725466546316; Wed, 04 Sep 2024 09:15:46 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-535408286b2sm2393762e87.172.2024.09.04.09.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:45 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 04/12] hw/arm: xenpvh: Add support for SMP guests Date: Wed, 4 Sep 2024 18:15:28 +0200 Message-ID: <20240904161537.664189-5-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Add SMP support for Xen PVH ARM guests. Create ms->smp.max_cpus ioreq servers to handle hotplug. Note that ms->smp.max_cpus will be passed to us by the user (Xen tools) set to the guests maxvcpus. The value in mc->max_cpus is an absolute maximum for the -smp option and won't be used to setup ioreq servers unless the user explicitly specifies it with -smp. If the user doesn't pass -smp on the command-line, smp.cpus and smp.max_cpus will default to 1. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 5f75cc3779..fda65d0d8d 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine) xen_init_ram(machine); - xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener); + xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener); xen_create_virtio_mmio_devices(xam); @@ -218,7 +218,26 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); mc->desc = "Xen PVH ARM machine"; mc->init = xen_arm_init; - mc->max_cpus = 1; + + /* + * mc->max_cpus holds the MAX value allowed in the -smp command-line opts. + * + * 1. If users don't pass any -smp option: + * ms->smp.cpus will default to 1. + * ms->smp.max_cpus will default to 1. + * + * 2. If users pass -smp X: + * ms->smp.cpus will be set to X. + * ms->smp.max_cpus will also be set to X. + * + * 3. If users pass -smp X,maxcpus=Y: + * ms->smp.cpus will be set to X. + * ms->smp.max_cpus will be set to Y. + * + * In scenarios 2 and 3, if X or Y are set to something larger than + * mc->max_cpus, QEMU will bail out with an error message. + */ + mc->max_cpus = GUEST_MAX_VCPUS; mc->default_machine_opts = "accel=xen"; /* Set explicitly here to make sure that real ram_size is passed */ mc->default_ram_size = 0; From patchwork Wed Sep 4 16:15:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=dVkcSJTy; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSNP18wKz1yXY for ; Thu, 5 Sep 2024 02:18:45 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsg2-0001nP-Dq; Wed, 04 Sep 2024 12:16:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfl-0001HK-2D; Wed, 04 Sep 2024 12:16:00 -0400 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsff-0002Gw-IV; Wed, 04 Sep 2024 12:15:54 -0400 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2f504652853so76084761fa.0; Wed, 04 Sep 2024 09:15:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466548; x=1726071348; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4UdvH3BfQ7ZFjeKvJ3vJphtRrv7BJb81oMyMgddOC7g=; b=dVkcSJTymENuvCJiZWqJt189pJNDPJsJmrJUCNJtWWUvYhwlHaffmoCG2wmTYbnSc1 ic0tak/DnK98hXk7Xwda9pk4Cgmbo1TT0xR0nH1HboMkDFY9QT1wQwYTda6Tar1Y1qIm oQLe4BN1DWQ7rqG4pukDuI4m1KOA2WWmL1EenWH6jrAuXO/U5nYu4scwVPY7axQTV4N/ t0yvcVIyXPuBTl8ZCEGQ7Pm8jY24mftFX8ovgzN+W3VbTVKXEB7z7++xenoM8+QzmcvJ pOSpMeLXCpforkLiwJpjHK8ZLdqTRRBa7wjAjQV22XRkrPjEyccRod/nzYG5xCey82jk MNdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466548; x=1726071348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4UdvH3BfQ7ZFjeKvJ3vJphtRrv7BJb81oMyMgddOC7g=; b=MdEzsx9h9iN7BxcfZzLs5JVGcvvnTYpNf6UukIBU7q/XSz/T2Car/zX/7qw13ytoJk az9myM3TJnRM0xDEwtUTabgzzOb2A39LNwEzRyQfcO1+hHxKui3tKDepDoMUwFwqU5Wv lwtrxT5GJhAU9ZGA1nvjtxfrU8/FcVq+w4OPAYnsffnpSDrvt9L5s051jAGLwjvtPffi 8YALi54cU0jerYn2fgc1WI89ZgwxyfEhYDAOo7O2LNsicPcZqCF26DgALWNVrXls0XrH 0zTPD/0aiF4Ou8FpuZO9B4OV3rhla8JuwV0EtuCq8bTHFlFR/64hM9eNZxnakLA1DWpe 9+XQ== X-Forwarded-Encrypted: i=1; AJvYcCWBl763/D4wqZIMWLDIGrQoV+J2RSKaZDtQUp/sfEO7y/VXkzFnq4Y+ESaonV3DOhJYx2hcPSjL5Q==@nongnu.org X-Gm-Message-State: AOJu0Yz/5iEUUhM02jDOq/xDvHdXakouenZBedAM1GatKVVERqXsHhA/ O/KzbS9RpuDbn462qPxve1MjcCnCKZVUXSAuNUI7BhBh+AT2f8EXCUHhKKGI X-Google-Smtp-Source: AGHT+IE45vRxHAq5eEpoyZwDxuEOBpO1l1yUi0y7mTpVkk1pHSrAlDEkmoWFTNi0vvfiboSA/TFkcA== X-Received: by 2002:a05:651c:1507:b0:2f5:104b:f2c with SMTP id 38308e7fff4ca-2f61e0b27f4mr114070401fa.39.1725466548140; Wed, 04 Sep 2024 09:15:48 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f614ed192dsm26313971fa.7.2024.09.04.09.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:46 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 05/12] hw/arm: xenpvh: Remove double-negation in warning Date: Wed, 4 Sep 2024 18:15:29 +0200 Message-ID: <20240904161537.664189-6-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index fda65d0d8d..16b3f00992 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -165,7 +165,7 @@ static void xen_arm_init(MachineState *machine) xam->state = g_new0(XenIOState, 1); if (machine->ram_size == 0) { - warn_report("%s non-zero ram size not specified. QEMU machine started" + warn_report("%s: ram size not specified. QEMU machine started" " without IOREQ (no emulated devices including virtio)", MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc); return; From patchwork Wed Sep 4 16:15:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=EaSZCcob; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSL61Kggz1yXY for ; Thu, 5 Sep 2024 02:16:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgC-0002n3-B7; Wed, 04 Sep 2024 12:16:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfp-0001KE-MA; Wed, 04 Sep 2024 12:16:02 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfh-0002HI-Ac; Wed, 04 Sep 2024 12:15:56 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2f43de7ad5eso84654511fa.1; Wed, 04 Sep 2024 09:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466550; x=1726071350; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Je23wvBBopidSll9UpAaH5rZwvVBAj7ARc0Pm2/k3kk=; b=EaSZCcob7qJt9qOgcLnSE7h7yhWjnHcF8Jq2AyaqIVRNxQIGSBkNi36U0N45oKyIb0 0bN6+GNKdL6K+10Ax8tbmyPoI53mBaUKUQ5eQW0S+3ewYF9NOKNAdsfdDNQgWcq0i57d uH6cuP50laH6kyELlEDOyuiYB0ESAQlIPmT0y3M7dFCGpcqZrZWsV4bVNbIP0T5yXUq7 VNp0fNKcaXAmMUtNUDy7IOM09Jh9YNDFxPzCLBVieBEIxkTjzzgCj8l5YS+2WbpZzl/D 9/HPi7+ocm1COP9i+0Dqt4xYZ6/S9IsbpzSeeE4keaX8ZWT/3XkmOMXo4sBIMDpqfz15 fFpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466550; x=1726071350; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Je23wvBBopidSll9UpAaH5rZwvVBAj7ARc0Pm2/k3kk=; b=J6b5Wyi18pNqHcVp7t2kKpTnRQP4KhrJaSWzbHNvIAL8nuXJDuGNtI1c9KdY6f4jyD EfDX154U9Trr9uk1PymD0Kib19iIdRPkKLosBGELhFPPkP/hfUHWaSavEPNKuTyXZvyy 6kD4xs1dzhrrA2gfrMv+Ji3RQqjb7wL4Ysh/Q3PwrCtSkpdrHbW7bqdR3DK9cVk5fStp EnB/8o8/BdtmSQ8I1sQ4Z6UwqUmYQnus2DmT4tg2lPe3GGT4inIagcKQ3tqSIfET//Zy xU3wy5CbGk+AgwmjtGB47PT/Ul583Uf5ydB16oWbq+uDesKsSKacke4E1qB77uW73Z6g jgbg== X-Forwarded-Encrypted: i=1; AJvYcCXxOubxW//VAN9QJFCf78QipKiXZnIFm7LYHWyFBq7+meRQ0RUpiKbxeRhjZ0t/JtAXQEcBvWKv4w==@nongnu.org X-Gm-Message-State: AOJu0YxNC04sc2+/kGF/jPIf3n/FuNZ24ZUu2fdZhTlH8FCIwWgybsnr JhojKNAYqj4M0IzS0lFtTfP9ljQjCImEPGsJz+cehKuKXsawp7IV66kyAJgl X-Google-Smtp-Source: AGHT+IFDpz1IZD0Qtgo2lbwg04ZmmoJdx9qSrR477CRxTjdjnUIVorw3NCNELME4Ae86vdZ9W6Lr1A== X-Received: by 2002:a05:6512:3da9:b0:530:ae4a:58d0 with SMTP id 2adb3069b0e04-53546af3605mr12601930e87.8.1725466549784; Wed, 04 Sep 2024 09:15:49 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-535407ac380sm2378135e87.83.2024.09.04.09.15.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:48 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 06/12] hw/arm: xenpvh: Move stubbed functions to xen-stubs.c Date: Wed, 4 Sep 2024 18:15:30 +0200 Message-ID: <20240904161537.664189-7-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/meson.build | 5 ++++- hw/arm/xen-stubs.c | 32 ++++++++++++++++++++++++++++++++ hw/arm/xen_arm.c | 20 -------------------- 3 files changed, 36 insertions(+), 21 deletions(-) create mode 100644 hw/arm/xen-stubs.c diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 0c07ab522f..074612b40c 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -59,7 +59,10 @@ arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre. arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c')) arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c')) arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c')) -arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c')) +arm_ss.add(when: 'CONFIG_XEN', if_true: files( + 'xen-stubs.c', + 'xen_arm.c', +)) system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c')) system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c')) diff --git a/hw/arm/xen-stubs.c b/hw/arm/xen-stubs.c new file mode 100644 index 0000000000..4ac6a56a96 --- /dev/null +++ b/hw/arm/xen-stubs.c @@ -0,0 +1,32 @@ +/* + * Stubs for unimplemented Xen functions for ARM. + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qapi/qapi-commands-migration.h" +#include "hw/boards.h" +#include "sysemu/sysemu.h" +#include "hw/xen/xen-hvm-common.h" +#include "hw/xen/arch_hvm.h" + +void arch_handle_ioreq(XenIOState *state, ioreq_t *req) +{ + hw_error("Invalid ioreq type 0x%x\n", req->type); + return; +} + +void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, + bool add) +{ +} + +void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) +{ +} + +void qmp_xen_set_global_dirty_log(bool enable, Error **errp) +{ +} diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 16b3f00992..f0868e7be5 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -115,26 +115,6 @@ static void xen_init_ram(MachineState *machine) memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants); } -void arch_handle_ioreq(XenIOState *state, ioreq_t *req) -{ - hw_error("Invalid ioreq type 0x%x\n", req->type); - - return; -} - -void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section, - bool add) -{ -} - -void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) -{ -} - -void qmp_xen_set_global_dirty_log(bool enable, Error **errp) -{ -} - #ifdef CONFIG_TPM static void xen_enable_tpm(XenArmState *xam) { From patchwork Wed Sep 4 16:15:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SsPHu8rM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSPK6Kf5z1yg3 for ; Thu, 5 Sep 2024 02:19:33 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgA-0002fD-Kq; Wed, 04 Sep 2024 12:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfs-0001MX-DR; Wed, 04 Sep 2024 12:16:05 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfk-0002Hl-Or; Wed, 04 Sep 2024 12:16:03 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5334c4cc17fso9467101e87.2; Wed, 04 Sep 2024 09:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466552; x=1726071352; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9ixH95d7Al9xFTOStqh6VLaEXX0BKF8+hj7xVV9eDrA=; b=SsPHu8rMXr/nK+JhYHCWwyV5BR3vfMg6FVTsVqm7a+E4SL/bj1vRwyNszvYY0R0T3O j8WdDsiP1UiclsBLcAQPgkI5X0iF1t2+XtDAOGDPkYiegQQDJMJk1fR0gqanbLZIRjWx ik8Husbg3eRTZRrZq4D30Z6h+C4B4r4lCfwuUCI5m8BOHU08DwXv+pe+Ej1HR7pY5l2j 4n1bcfrJvJ4mSakZmXiKum0E2oszmmNpbmT3V7WInY/bY2tlMJkcjTbr8g1i85WiBIQJ /XHEDdVWm7pvn23bYk3azgx4M/0gW+iEp1HCK+QAR92BcmVenRLX0+4I4ZgwJZWLBi6X 5vxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466552; x=1726071352; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9ixH95d7Al9xFTOStqh6VLaEXX0BKF8+hj7xVV9eDrA=; b=pPNP8UketspkLTHSs4UCf2SaCQNLcboiDAOIkxy7hoH44h+Mh7kfnBCHTjAGV3r/zw Q9Rfr+LkhW/2vthYL0ZNmULv1PYzaFxgMXCoiHqpUdcO8NsrXgbein/l0Ss0JdtpGpC7 fEeUPNi/sjEkEfKYQLMyYJs9YUSP2MpCUFZIz/PPfLsLAU0WZzVRE/TJLviIA8RxW395 bL8m3Whx8I3KE12x/OUYBWkXdcMEmHwjYXTdGA+sjO11g97l+7BaCwbtos52UXxNJY5I jyCGQPfiCUyb1H9ZQrfOGN3OjHlT7s9vujt2DjQ4koW8dbE06sqSqSECuRkjnkssQEn4 Jqzg== X-Forwarded-Encrypted: i=1; AJvYcCX3woc1vVl8ldizunrGWM6TGq7t5t91hAkmnOVXRrmkdsYKexbkjgpsuUrhROpERx9jSbk2mVsOjg==@nongnu.org X-Gm-Message-State: AOJu0Yy/0ee7qAL25Yll2AlTEQot/901Hs+B1Qj5TOQ6o6EBB1K25SOT 7Qr8zDVG+X31QIhrVBjry+BKieLI/vTowaU/38jjuL7I0gAJMqjrgokVaOr7 X-Google-Smtp-Source: AGHT+IG1JgHcK/HSPjvz/v7e/HA3h7W7yVxrlLa32XoSdRwuQdNw8Nv6kbTy/cV1UOn6hD+yiZ1CvQ== X-Received: by 2002:a05:6512:159e:b0:52e:7542:f469 with SMTP id 2adb3069b0e04-53546a56629mr12273709e87.0.1725466551489; Wed, 04 Sep 2024 09:15:51 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-535692d9bf6sm176341e87.41.2024.09.04.09.15.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:50 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , qemu-arm@nongnu.org Subject: [PULL v1 07/12] hw/arm: xenpvh: Break out a common PVH machine Date: Wed, 4 Sep 2024 18:15:31 +0200 Message-ID: <20240904161537.664189-8-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Break out a common Xen PVH machine in preparation for adding a x86 Xen PVH machine. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/trace-events | 5 - hw/arm/xen_arm.c | 198 +++-------------------- hw/xen/meson.build | 1 + hw/xen/trace-events | 4 + hw/xen/xen-pvh-common.c | 275 ++++++++++++++++++++++++++++++++ include/hw/xen/xen-pvh-common.h | 59 +++++++ 6 files changed, 358 insertions(+), 184 deletions(-) create mode 100644 hw/xen/xen-pvh-common.c create mode 100644 include/hw/xen/xen-pvh-common.h diff --git a/hw/arm/trace-events b/hw/arm/trace-events index be6c8f720b..c64ad344bd 100644 --- a/hw/arm/trace-events +++ b/hw/arm/trace-events @@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)" z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x" z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes" -# xen_arm.c -xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64 -xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64 -xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64 - # bcm2838.c bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d" diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index f0868e7be5..04cb9855af 100644 --- a/hw/arm/xen_arm.c +++ b/hw/arm/xen_arm.c @@ -7,44 +7,12 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/qapi-commands-migration.h" -#include "qapi/visitor.h" #include "hw/boards.h" -#include "hw/irq.h" -#include "hw/sysbus.h" -#include "sysemu/block-backend.h" -#include "sysemu/tpm_backend.h" #include "sysemu/sysemu.h" -#include "hw/xen/xen-hvm-common.h" -#include "sysemu/tpm.h" +#include "hw/xen/xen-pvh-common.h" #include "hw/xen/arch_hvm.h" -#include "trace.h" #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") -OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) - -static const MemoryListener xen_memory_listener = { - .region_add = xen_region_add, - .region_del = xen_region_del, - .log_start = NULL, - .log_stop = NULL, - .log_sync = NULL, - .log_global_start = NULL, - .log_global_stop = NULL, - .priority = MEMORY_LISTENER_PRIORITY_ACCEL, -}; - -struct XenArmState { - /*< private >*/ - MachineState parent; - - XenIOState *state; - - struct { - uint64_t tpm_base_addr; - } cfg; -}; - -static MemoryRegion ram_lo, ram_hi; /* * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen @@ -57,147 +25,26 @@ static MemoryRegion ram_lo, ram_hi; #define NR_VIRTIO_MMIO_DEVICES \ (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST) -static void xen_set_irq(void *opaque, int irq, int level) -{ - if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) { - error_report("xendevicemodel_set_irq_level failed"); - } -} - -static void xen_create_virtio_mmio_devices(XenArmState *xam) -{ - int i; - - for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) { - hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE; - qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL, - GUEST_VIRTIO_MMIO_SPI_FIRST + i); - - sysbus_create_simple("virtio-mmio", base, irq); - - trace_xen_create_virtio_mmio_devices(i, - GUEST_VIRTIO_MMIO_SPI_FIRST + i, - base); - } -} - -static void xen_init_ram(MachineState *machine) +static void xen_arm_instance_init(Object *obj) { - MemoryRegion *sysmem = get_system_memory(); - ram_addr_t block_len, ram_size[GUEST_RAM_BANKS]; - - trace_xen_init_ram(machine->ram_size); - if (machine->ram_size <= GUEST_RAM0_SIZE) { - ram_size[0] = machine->ram_size; - ram_size[1] = 0; - block_len = GUEST_RAM0_BASE + ram_size[0]; - } else { - ram_size[0] = GUEST_RAM0_SIZE; - ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE; - block_len = GUEST_RAM1_BASE + ram_size[1]; - } + XenPVHMachineState *s = XEN_PVH_MACHINE(obj); - memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, - &error_fatal); + /* Default values. */ + s->cfg.ram_low = (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE }; + s->cfg.ram_high = (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE }; - memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory, - GUEST_RAM0_BASE, ram_size[0]); - memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo); - if (ram_size[1] > 0) { - memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory, - GUEST_RAM1_BASE, ram_size[1]); - memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi); - } - - /* Setup support for grants. */ - memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len, - &error_fatal); - memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants); + s->cfg.virtio_mmio_num = NR_VIRTIO_MMIO_DEVICES; + s->cfg.virtio_mmio_irq_base = GUEST_VIRTIO_MMIO_SPI_FIRST; + s->cfg.virtio_mmio = (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE, + VIRTIO_MMIO_DEV_SIZE }; } -#ifdef CONFIG_TPM -static void xen_enable_tpm(XenArmState *xam) -{ - Error *errp = NULL; - DeviceState *dev; - SysBusDevice *busdev; - - TPMBackend *be = qemu_find_tpm_be("tpm0"); - if (be == NULL) { - error_report("Couldn't find tmp0 backend"); - return; - } - dev = qdev_new(TYPE_TPM_TIS_SYSBUS); - object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp); - object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp); - busdev = SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(busdev, &error_fatal); - sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr); - - trace_xen_enable_tpm(xam->cfg.tpm_base_addr); -} -#endif - -static void xen_arm_init(MachineState *machine) -{ - XenArmState *xam = XEN_ARM(machine); - - xam->state = g_new0(XenIOState, 1); - - if (machine->ram_size == 0) { - warn_report("%s: ram size not specified. QEMU machine started" - " without IOREQ (no emulated devices including virtio)", - MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc); - return; - } - - xen_init_ram(machine); - - xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener); - - xen_create_virtio_mmio_devices(xam); - -#ifdef CONFIG_TPM - if (xam->cfg.tpm_base_addr) { - xen_enable_tpm(xam); - } else { - warn_report("tpm-base-addr is not provided. TPM will not be enabled"); - } -#endif -} - -#ifdef CONFIG_TPM -static void xen_arm_get_tpm_base_addr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - XenArmState *xam = XEN_ARM(obj); - uint64_t value = xam->cfg.tpm_base_addr; - - visit_type_uint64(v, name, &value, errp); -} - -static void xen_arm_set_tpm_base_addr(Object *obj, Visitor *v, - const char *name, void *opaque, - Error **errp) -{ - XenArmState *xam = XEN_ARM(obj); - uint64_t value; - - if (!visit_type_uint64(v, name, &value, errp)) { - return; - } - - xam->cfg.tpm_base_addr = value; -} -#endif - static void xen_arm_machine_class_init(ObjectClass *oc, void *data) { - + XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc); MachineClass *mc = MACHINE_CLASS(oc); + mc->desc = "Xen PVH ARM machine"; - mc->init = xen_arm_init; /* * mc->max_cpus holds the MAX value allowed in the -smp command-line opts. @@ -218,27 +65,20 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data) * mc->max_cpus, QEMU will bail out with an error message. */ mc->max_cpus = GUEST_MAX_VCPUS; - mc->default_machine_opts = "accel=xen"; - /* Set explicitly here to make sure that real ram_size is passed */ - mc->default_ram_size = 0; -#ifdef CONFIG_TPM - object_class_property_add(oc, "tpm-base-addr", "uint64_t", - xen_arm_get_tpm_base_addr, - xen_arm_set_tpm_base_addr, - NULL, NULL); - object_class_property_set_description(oc, "tpm-base-addr", - "Set Base address for TPM device."); + /* List of supported features known to work on PVH ARM. */ + xpc->has_tpm = true; + xpc->has_virtio_mmio = true; - machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); -#endif + xen_pvh_class_setup_common_props(xpc); } static const TypeInfo xen_arm_machine_type = { .name = TYPE_XEN_ARM, - .parent = TYPE_MACHINE, + .parent = TYPE_XEN_PVH_MACHINE, .class_init = xen_arm_machine_class_init, - .instance_size = sizeof(XenArmState), + .instance_size = sizeof(XenPVHMachineState), + .instance_init = xen_arm_instance_init, }; static void xen_arm_machine_register_types(void) diff --git a/hw/xen/meson.build b/hw/xen/meson.build index d887fa9ba4..4a486e3673 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set() xen_specific_ss.add(files( 'xen-mapcache.c', 'xen-hvm-common.c', + 'xen-pvh-common.c', )) if have_xen_pci_passthrough xen_specific_ss.add(files( diff --git a/hw/xen/trace-events b/hw/xen/trace-events index d1b27f6c11..a07fe41c6d 100644 --- a/hw/xen/trace-events +++ b/hw/xen/trace-events @@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle" destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s" destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s" +# xen-pvh-common.c +xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64 +xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64 + # xen-mapcache.c xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64 xen_remap_bucket(uint64_t index) "index 0x%"PRIx64 diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c new file mode 100644 index 0000000000..880e8143d7 --- /dev/null +++ b/hw/xen/xen-pvh-common.c @@ -0,0 +1,275 @@ +/* + * QEMU Xen PVH machine - common code. + * + * Copyright (c) 2024 Advanced Micro Devices, Inc. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/visitor.h" +#include "hw/boards.h" +#include "hw/irq.h" +#include "hw/sysbus.h" +#include "sysemu/sysemu.h" +#include "sysemu/tpm.h" +#include "sysemu/tpm_backend.h" +#include "hw/xen/xen-pvh-common.h" +#include "trace.h" + +static const MemoryListener xen_memory_listener = { + .region_add = xen_region_add, + .region_del = xen_region_del, + .log_start = NULL, + .log_stop = NULL, + .log_sync = NULL, + .log_global_start = NULL, + .log_global_stop = NULL, + .priority = MEMORY_LISTENER_PRIORITY_ACCEL, +}; + +static void xen_pvh_init_ram(XenPVHMachineState *s, + MemoryRegion *sysmem) +{ + MachineState *ms = MACHINE(s); + ram_addr_t block_len, ram_size[2]; + + if (ms->ram_size <= s->cfg.ram_low.size) { + ram_size[0] = ms->ram_size; + ram_size[1] = 0; + block_len = s->cfg.ram_low.base + ram_size[0]; + } else { + ram_size[0] = s->cfg.ram_low.size; + ram_size[1] = ms->ram_size - s->cfg.ram_low.size; + block_len = s->cfg.ram_high.base + ram_size[1]; + } + + memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, + &error_fatal); + + memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory, + s->cfg.ram_low.base, ram_size[0]); + memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low); + if (ram_size[1] > 0) { + memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory, + s->cfg.ram_high.base, ram_size[1]); + memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high); + } + + /* Setup support for grants. */ + memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len, + &error_fatal); + memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants); +} + +static void xen_set_irq(void *opaque, int irq, int level) +{ + if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) { + error_report("xendevicemodel_set_irq_level failed"); + } +} + +static void xen_create_virtio_mmio_devices(XenPVHMachineState *s) +{ + int i; + + for (i = 0; i < s->cfg.virtio_mmio_num; i++) { + hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size; + qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL, + s->cfg.virtio_mmio_irq_base + i); + + sysbus_create_simple("virtio-mmio", base, irq); + + trace_xen_create_virtio_mmio_devices(i, + s->cfg.virtio_mmio_irq_base + i, + base); + } +} + +#ifdef CONFIG_TPM +static void xen_enable_tpm(XenPVHMachineState *s) +{ + Error *errp = NULL; + DeviceState *dev; + SysBusDevice *busdev; + + TPMBackend *be = qemu_find_tpm_be("tpm0"); + if (be == NULL) { + error_report("Couldn't find tmp0 backend"); + return; + } + dev = qdev_new(TYPE_TPM_TIS_SYSBUS); + object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp); + object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp); + busdev = SYS_BUS_DEVICE(dev); + sysbus_realize_and_unref(busdev, &error_fatal); + sysbus_mmio_map(busdev, 0, s->cfg.tpm.base); + + trace_xen_enable_tpm(s->cfg.tpm.base); +} +#endif + +static void xen_pvh_init(MachineState *ms) +{ + XenPVHMachineState *s = XEN_PVH_MACHINE(ms); + XenPVHMachineClass *xpc = XEN_PVH_MACHINE_GET_CLASS(s); + MemoryRegion *sysmem = get_system_memory(); + + if (ms->ram_size == 0) { + warn_report("%s: ram size not specified. QEMU machine started" + " without IOREQ (no emulated devices including virtio)", + MACHINE_CLASS(object_get_class(OBJECT(ms)))->desc); + return; + } + + xen_pvh_init_ram(s, sysmem); + xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, &xen_memory_listener); + + if (s->cfg.virtio_mmio_num) { + xen_create_virtio_mmio_devices(s); + } + +#ifdef CONFIG_TPM + if (xpc->has_tpm) { + if (s->cfg.tpm.base) { + xen_enable_tpm(s); + } else { + warn_report("tpm-base-addr is not set. TPM will not be enabled"); + } + } +#endif + + /* Call the implementation specific init. */ + if (xpc->init) { + xpc->init(ms); + } +} + +#define XEN_PVH_PROP_MEMMAP_SETTER(n, f) \ +static void xen_pvh_set_ ## n ## _ ## f(Object *obj, Visitor *v, \ + const char *name, void *opaque, \ + Error **errp) \ +{ \ + XenPVHMachineState *xp = XEN_PVH_MACHINE(obj); \ + uint64_t value; \ + \ + if (!visit_type_size(v, name, &value, errp)) { \ + return; \ + } \ + xp->cfg.n.f = value; \ +} + +#define XEN_PVH_PROP_MEMMAP_GETTER(n, f) \ +static void xen_pvh_get_ ## n ## _ ## f(Object *obj, Visitor *v, \ + const char *name, void *opaque, \ + Error **errp) \ +{ \ + XenPVHMachineState *xp = XEN_PVH_MACHINE(obj); \ + uint64_t value = xp->cfg.n.f; \ + \ + visit_type_uint64(v, name, &value, errp); \ +} + +#define XEN_PVH_PROP_MEMMAP_BASE(n) \ + XEN_PVH_PROP_MEMMAP_SETTER(n, base) \ + XEN_PVH_PROP_MEMMAP_GETTER(n, base) \ + +#define XEN_PVH_PROP_MEMMAP_SIZE(n) \ + XEN_PVH_PROP_MEMMAP_SETTER(n, size) \ + XEN_PVH_PROP_MEMMAP_GETTER(n, size) + +#define XEN_PVH_PROP_MEMMAP(n) \ + XEN_PVH_PROP_MEMMAP_BASE(n) \ + XEN_PVH_PROP_MEMMAP_SIZE(n) + +XEN_PVH_PROP_MEMMAP(ram_low) +XEN_PVH_PROP_MEMMAP(ram_high) +/* TPM only has a base-addr option. */ +XEN_PVH_PROP_MEMMAP_BASE(tpm) +XEN_PVH_PROP_MEMMAP(virtio_mmio) + +void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc) +{ + ObjectClass *oc = OBJECT_CLASS(xpc); + MachineClass *mc = MACHINE_CLASS(xpc); + +#define OC_MEMMAP_PROP_BASE(c, prop_name, name) \ +do { \ + object_class_property_add(c, prop_name "-base", "uint64_t", \ + xen_pvh_get_ ## name ## _base, \ + xen_pvh_set_ ## name ## _base, NULL, NULL); \ + object_class_property_set_description(oc, prop_name "-base", \ + "Set base address for " prop_name); \ +} while (0) + +#define OC_MEMMAP_PROP_SIZE(c, prop_name, name) \ +do { \ + object_class_property_add(c, prop_name "-size", "uint64_t", \ + xen_pvh_get_ ## name ## _size, \ + xen_pvh_set_ ## name ## _size, NULL, NULL); \ + object_class_property_set_description(oc, prop_name "-size", \ + "Set memory range size for " prop_name); \ +} while (0) + +#define OC_MEMMAP_PROP(c, prop_name, name) \ +do { \ + OC_MEMMAP_PROP_BASE(c, prop_name, name); \ + OC_MEMMAP_PROP_SIZE(c, prop_name, name); \ +} while (0) + + /* + * We provide memmap properties to allow Xen to move things to other + * addresses for example when users need to accomodate the memory-map + * for 1:1 mapped devices/memory. + */ + OC_MEMMAP_PROP(oc, "ram-low", ram_low); + OC_MEMMAP_PROP(oc, "ram-high", ram_high); + + if (xpc->has_virtio_mmio) { + OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio); + } + +#ifdef CONFIG_TPM + if (xpc->has_tpm) { + object_class_property_add(oc, "tpm-base-addr", "uint64_t", + xen_pvh_get_tpm_base, + xen_pvh_set_tpm_base, + NULL, NULL); + object_class_property_set_description(oc, "tpm-base-addr", + "Set Base address for TPM device."); + + machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); + } +#endif +} + +static void xen_pvh_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->init = xen_pvh_init; + + mc->desc = "Xen PVH machine"; + mc->max_cpus = 1; + mc->default_machine_opts = "accel=xen"; + /* Set to zero to make sure that the real ram size is passed. */ + mc->default_ram_size = 0; +} + +static const TypeInfo xen_pvh_info = { + .name = TYPE_XEN_PVH_MACHINE, + .parent = TYPE_MACHINE, + .abstract = true, + .instance_size = sizeof(XenPVHMachineState), + .class_size = sizeof(XenPVHMachineClass), + .class_init = xen_pvh_class_init, +}; + +static void xen_pvh_register_types(void) +{ + type_register_static(&xen_pvh_info); +} + +type_init(xen_pvh_register_types); diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h new file mode 100644 index 0000000000..77fd98b9fe --- /dev/null +++ b/include/hw/xen/xen-pvh-common.h @@ -0,0 +1,59 @@ +/* + * QEMU Xen PVH machine - common code. + * + * Copyright (c) 2024 Advanced Micro Devices, Inc. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef XEN_PVH_COMMON_H__ +#define XEN_PVH_COMMON_H__ + +#include +#include "hw/sysbus.h" +#include "hw/hw.h" +#include "hw/xen/xen-hvm-common.h" +#include "hw/pci-host/gpex.h" + +#define TYPE_XEN_PVH_MACHINE MACHINE_TYPE_NAME("xen-pvh-base") +OBJECT_DECLARE_TYPE(XenPVHMachineState, XenPVHMachineClass, + XEN_PVH_MACHINE) + +struct XenPVHMachineClass { + MachineClass parent; + + /* PVH implementation specific init. */ + void (*init)(MachineState *state); + + /* + * Each implementation can optionally enable features that it + * supports and are known to work. + */ + bool has_tpm; + bool has_virtio_mmio; +}; + +struct XenPVHMachineState { + /*< private >*/ + MachineState parent; + + XenIOState ioreq; + + struct { + MemoryRegion low; + MemoryRegion high; + } ram; + + struct { + MemMapEntry ram_low, ram_high; + MemMapEntry tpm; + + /* Virtio-mmio */ + MemMapEntry virtio_mmio; + uint32_t virtio_mmio_num; + uint32_t virtio_mmio_irq_base; + } cfg; +}; + +void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc); +#endif From patchwork Wed Sep 4 16:15:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nBqioEnf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSPS2Q0wz1yXY for ; Thu, 5 Sep 2024 02:19:40 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsg5-0002DN-Mw; Wed, 04 Sep 2024 12:16:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfr-0001Lz-3U; Wed, 04 Sep 2024 12:16:04 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfl-0002I3-5l; Wed, 04 Sep 2024 12:16:02 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5334b0e1a8eso8739584e87.0; Wed, 04 Sep 2024 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466554; x=1726071354; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nym7Vpc1+HcpD0fJwqv749eMWZaaEovUQaBKn9/MOQM=; b=nBqioEnfRwLtPkXprS/u1kpCsAaP4D40wUE5Bx+OdrVpBBNUp3EycBKejRGZL2bv4g ODsv6M8CmaAfPL+hd7lcUH9Z+R89dxITLif301VJAS7XmfUAbwg+q2pREYeoQxnN41Hm ECT9OZ9wgFYQSNBo6ex8B9CrxoQWfDG/eAAHBad9v8NSiYG9qGGzJBQIktusly8lCGGI c3um61Vs6TaBAVmLUQIc4iz5pX1L8TYai8Gnbg70M77+Ow/CmRrH7/flAFTs9uxQquTk IuL4RTvob/0g6QbgA1o75S2ZR4cPLKQUkF7FiEgMPr8zbl/a3Rs6XJ5G//9vP9inGf4y /DuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466554; x=1726071354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nym7Vpc1+HcpD0fJwqv749eMWZaaEovUQaBKn9/MOQM=; b=oqk9mPKM/svv1IHsRiefqsWp2723mHgy7DZY9bmDHCkqky9oe9Czp2rpKTDLwNjB8x VA2WfoVK8YvcWo7tazhiJQr4FUSCj0v0aS98aOVbYStIm3A7dVDFwyegVWGZe1M0wLRd Mp2YGOqvqZ/vctdZlhj/6objScjYZ/xhJPXiX2i32AqQuZov403IintnfP6PIh6bq/Wy 4LGgUbHu0SQNMCI2qTKmgV3dELSQmIaqzp3WRWo4+7og/s4R54gen5r9g1Y3h3YR6vN7 Gslnke7Wrd4uV0UlM+6gpzCNUfT94CsLGfnvBelL2KnYEgDBEGwhyvIoJptl+SMrJie7 5/qw== X-Forwarded-Encrypted: i=1; AJvYcCXBLKUVDgzz3BJcJ5pRrMGdDfG5PsthKVAKgBfeG8A1JdTFafEzv4QbSQhnRc+iFQkyCv9CAYViQQ==@nongnu.org X-Gm-Message-State: AOJu0YwkfyoR7YrdaJjzaSG0zfpsn/wiBStVFDRUNk9t1krzaSqnazPZ ESIL3fFELBT08PsykR1frM7Fby+Z1LCi1MWBvQgjdjfudWHwApsLQu8gFIhK X-Google-Smtp-Source: AGHT+IHdK+MGVaxZaTPG5mtVrOpYHs1uliw2A+U9Y8zDTRSlyKp4eJOx4pA7txuXly/nIFn97leCnQ== X-Received: by 2002:a05:6512:39d4:b0:530:e228:7799 with SMTP id 2adb3069b0e04-53546bab2e9mr14075298e87.58.1725466553759; Wed, 04 Sep 2024 09:15:53 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53569eeb4d9sm143326e87.65.2024.09.04.09.15.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:52 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, qemu-arm@nongnu.org Subject: [PULL v1 08/12] hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c Date: Wed, 4 Sep 2024 18:15:32 +0200 Message-ID: <20240904161537.664189-9-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Rename xen_arm.c -> xen-pvh.c to better express that this is a PVH machine and to align with x86 HVM and future PVH machine filenames: hw/i386/xen/xen-hvm.c hw/i386/xen/xen-pvh.c (in preparation) No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/arm/meson.build | 2 +- hw/arm/{xen_arm.c => xen-pvh.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/arm/{xen_arm.c => xen-pvh.c} (100%) diff --git a/hw/arm/meson.build b/hw/arm/meson.build index 074612b40c..4059d0be2e 100644 --- a/hw/arm/meson.build +++ b/hw/arm/meson.build @@ -61,7 +61,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-e arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c')) arm_ss.add(when: 'CONFIG_XEN', if_true: files( 'xen-stubs.c', - 'xen_arm.c', + 'xen-pvh.c', )) system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c')) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen-pvh.c similarity index 100% rename from hw/arm/xen_arm.c rename to hw/arm/xen-pvh.c From patchwork Wed Sep 4 16:15:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980924 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=gs/+D+kn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSKz1q04z1yXY for ; Thu, 5 Sep 2024 02:16:39 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgF-0003Ed-FO; Wed, 04 Sep 2024 12:16:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfs-0001MW-CP for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:05 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfo-0002Iu-Ux for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:03 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2f6514f23b6so19840701fa.1 for ; Wed, 04 Sep 2024 09:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466556; x=1726071356; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nn/Mzsj0J8g/Mphb+PXQ5WHUtYUEk9GjObY40SBe48s=; b=gs/+D+kn1rSN1TpO8g9irT931b5VT2m8X9ycKtMXeFUJhWsYqd+J9LLj+e6otwT6Zv NBkPCH6GJgYbhKDISzf7ZUlWBow5NoUpcm2/7Y6W40HOQMSy0YschLesljt+M0C+8dZp UsNL4vm9LjZ9cLnS3o4PPoL0uutuoJBsLCCajzlDmH5bml5PbKOliVpzvSrUyASJNzpI TJhuspCEMci4vdf/px69PYQtGiWM/tXA1snL/fK8HZMLt2XqbQALmtXtBURxOZTpcEZB TYCnTUQAtSCjPYEx4UNcEkAZpb1KG6Iupxq/01Xk19SgWswrBrQe92MdpBm8nSxqWhyK S+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466556; x=1726071356; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nn/Mzsj0J8g/Mphb+PXQ5WHUtYUEk9GjObY40SBe48s=; b=dO+O0rs1+k4eH9GHGP2Gc8f0FwKr79A+A9dKU2HGEJBanBrxI2uJKCXNo/XH4aM+Wk FNUoeH/pgHlSvHuddxMvXx4oqEGOJ81/DTPgQP9mKvGuukC0mklRjbPRnVd2EbQThK6X GfUgCgOborOM+mgZIChQAxct0PaOp5KF8WsCR06FeakKo0vtRaDxS+wzTFFgfc/hGvxD JByM+j0uMW7NnApOKvbjUU9VBfhnwsXVN1sJZuNYKw0/a6v1Aw1lhPwgSwTVFPRLKSG5 23IAM/G+ur3CwgxfX/qNjkTozw/yoLvx31vHOb8d+shjziuRUirLYQ/RXXAp0rsCbCbD P9sg== X-Gm-Message-State: AOJu0YxbcstGQL/3jsRchnAk7PxgYrdg4JwUWyeENj5F1MZBVqSgGDrq 4MstrHPi7oggGnBPl8CEko7FK3lOVA2P5W126tnJQDPVFxCunynNoL6931C7 X-Google-Smtp-Source: AGHT+IF6S1OoJeZCF42GJKo/qiy2ZeZ6a9HHHlUxboixNuGEbZq+dI0mGFAzSTpOvJ4LlUMQwdzjQw== X-Received: by 2002:a2e:bc19:0:b0:2f5:966:c22e with SMTP id 38308e7fff4ca-2f6105d74e3mr207636241fa.11.1725466555495; Wed, 04 Sep 2024 09:15:55 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f6151881dcsm26217611fa.124.2024.09.04.09.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:54 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" Subject: [PULL v1 09/12] hw/arm: xenpvh: Reverse virtio-mmio creation order Date: Wed, 4 Sep 2024 18:15:33 +0200 Message-ID: <20240904161537.664189-10-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x235.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" We've been creating the virtio-mmio devices in forwards order but since the qbus lists prepend (rather than append) entries, the virtio busses end up with decreasing base address order. Xen enables virtio-mmio nodes in forwards order so there's been a missmatch. So far, we've been working around this with an out-of-tree patch to Xen. This reverses the order making sure the virtio busses end up ordered with increasing base addresses avoiding the need to patch Xen. Signed-off-by: Edgar E. Iglesias Acked-by: Stefano Stabellini --- hw/xen/xen-pvh-common.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 880e8143d7..295f920442 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -75,7 +75,18 @@ static void xen_create_virtio_mmio_devices(XenPVHMachineState *s) { int i; - for (i = 0; i < s->cfg.virtio_mmio_num; i++) { + /* + * We create the transports in reverse order. Since qbus_realize() + * prepends (not appends) new child buses, the decrementing loop below will + * create a list of virtio-mmio buses with increasing base addresses. + * + * When a -device option is processed from the command line, + * qbus_find_recursive() picks the next free virtio-mmio bus in forwards + * order. + * + * This is what the Xen tools expect. + */ + for (i = s->cfg.virtio_mmio_num - 1; i >= 0; i--) { hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size; qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL, s->cfg.virtio_mmio_irq_base + i); From patchwork Wed Sep 4 16:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HjpM4fdI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSNj6bB8z1yXY for ; Thu, 5 Sep 2024 02:19:01 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgE-00030J-7A; Wed, 04 Sep 2024 12:16:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsfs-0001Mw-Km for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:07 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfp-0002JB-3o for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:04 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-533463f6b16so1384163e87.1 for ; Wed, 04 Sep 2024 09:16:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466558; x=1726071358; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AhHuSPxpBNKwAgr3pqcWE8F4qfu6xeqGgbqjKgqrTwo=; b=HjpM4fdI9THucjEYxNqoIQBPyLbe/dT5nlfGax4BGBscR4lxzULfn/JtbHNB3m3IzL YfrXfz3VyzF7DlJcIYUPPbEaebDqzdMjsph3NO2XIW4iPc1uXpGwECXI+9toGpk0Xh33 vGZVqW9gibfxWrTkyjXB9Jkfm0FUq0lYfZPsU6mBDUOtlBFcMdLu06mjIZcvaJnW/1Rb PsoniwHJ1ddiuv2QRPVLbp95NskV0SlCbWywvOeyJ283DoskAjgcL8JpH6wGdL0iXNhc lc+IXLwfFIV1jlK1IPnJL6TjbyjQdYS258SxjO0LjyrzsO7+jLURBfOsMkZ/Q8wQVY3W oCBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466558; x=1726071358; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AhHuSPxpBNKwAgr3pqcWE8F4qfu6xeqGgbqjKgqrTwo=; b=w5VvcPVWa/+wcHaoj6x3ZPbiiAyc10FDG37XWixSdr9WOrrtv4v1ZMv/NFPNtwtNaJ fR236GW1IQtlxSDldzcv397+slZQy156zxqAVfL5WHHDW/5NL60vDqeIz00Kr6DMHOkH mtsPVwmJIa6F9tiqMaLtbUCyWzGa+gMmOHGOXspCzuozAmExHIyyTnR0kBTPurW3xXh5 7klqk4O/VzXbzZsmgcbc446xIqX/ErqpxtPamzmWLXrJbeRT3mhteZ53XXNU/00vMb5Q vl6m5HSAjQNiB7NAsrFGEPQpeW/HzQozIHeoeMcCEuZ0Rs8JJKHuyKu7Au7+phu3qE56 oENg== X-Gm-Message-State: AOJu0Ywep76egKxR8soqMHO92bhPf4QIZdzcYsqcuytKSpAIJek5dxc4 pd07IWkbMxsnQIa1Mluhox+n7JqP9YE59wvy/f0ly4/5Ib2taMbvL4/rnAaW X-Google-Smtp-Source: AGHT+IF1GFmSMfUcd/mUHwagfqt5mpNvfaEt+oYlqwsbk12notXPjCro2OfzhCpiGNq2eIcwaUFOhQ== X-Received: by 2002:a05:6512:1192:b0:52f:eb:aaca with SMTP id 2adb3069b0e04-53565f22906mr2195749e87.32.1725466557827; Wed, 04 Sep 2024 09:15:57 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53540841326sm2387308e87.197.2024.09.04.09.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:56 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" Subject: [PULL v1 10/12] hw/xen: pvh-common: Add support for creating PCIe/GPEX Date: Wed, 4 Sep 2024 18:15:34 +0200 Message-ID: <20240904161537.664189-11-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=edgar.iglesias@gmail.com; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Add support for optionally creating a PCIe/GPEX controller. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-pvh-common.c | 76 +++++++++++++++++++++++++++++++++ include/hw/xen/xen-pvh-common.h | 29 +++++++++++++ 2 files changed, 105 insertions(+) diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c index 295f920442..28d7168446 100644 --- a/hw/xen/xen-pvh-common.c +++ b/hw/xen/xen-pvh-common.c @@ -122,6 +122,64 @@ static void xen_enable_tpm(XenPVHMachineState *s) } #endif +/* + * We use the GPEX PCIe controller with its internal INTX PCI interrupt + * swizzling. This swizzling is emulated in QEMU and routes all INTX + * interrupts from endpoints down to only 4 INTX interrupts. + * See include/hw/pci/pci.h : pci_swizzle() + */ +static inline void xenpvh_gpex_init(XenPVHMachineState *s, + XenPVHMachineClass *xpc, + MemoryRegion *sysmem) +{ + MemoryRegion *ecam_reg; + MemoryRegion *mmio_reg; + DeviceState *dev; + int i; + + object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex, + TYPE_GPEX_HOST); + dev = DEVICE(&s->pci.gpex); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + + ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); + memory_region_add_subregion(sysmem, s->cfg.pci_ecam.base, ecam_reg); + + mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1); + + if (s->cfg.pci_mmio.size) { + memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio", + mmio_reg, + s->cfg.pci_mmio.base, s->cfg.pci_mmio.size); + memory_region_add_subregion(sysmem, s->cfg.pci_mmio.base, + &s->pci.mmio_alias); + } + + if (s->cfg.pci_mmio_high.size) { + memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev), + "pcie-mmio-high", + mmio_reg, s->cfg.pci_mmio_high.base, s->cfg.pci_mmio_high.size); + memory_region_add_subregion(sysmem, s->cfg.pci_mmio_high.base, + &s->pci.mmio_high_alias); + } + + /* + * PVH implementations with PCI enabled must provide set_pci_intx_irq() + * and optionally an implementation of set_pci_link_route(). + */ + assert(xpc->set_pci_intx_irq); + + for (i = 0; i < GPEX_NUM_IRQS; i++) { + qemu_irq irq = qemu_allocate_irq(xpc->set_pci_intx_irq, s, i); + + sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq); + gpex_set_irq_num(GPEX_HOST(dev), i, s->cfg.pci_intx_irq_base + i); + if (xpc->set_pci_link_route) { + xpc->set_pci_link_route(i, s->cfg.pci_intx_irq_base + i); + } + } +} + static void xen_pvh_init(MachineState *ms) { XenPVHMachineState *s = XEN_PVH_MACHINE(ms); @@ -152,6 +210,15 @@ static void xen_pvh_init(MachineState *ms) } #endif + /* Non-zero pci-ecam-size enables PCI. */ + if (s->cfg.pci_ecam.size) { + if (s->cfg.pci_ecam.size != 256 * MiB) { + error_report("pci-ecam-size only supports values 0 or 0x10000000"); + exit(EXIT_FAILURE); + } + xenpvh_gpex_init(s, xpc, sysmem); + } + /* Call the implementation specific init. */ if (xpc->init) { xpc->init(ms); @@ -200,6 +267,9 @@ XEN_PVH_PROP_MEMMAP(ram_high) /* TPM only has a base-addr option. */ XEN_PVH_PROP_MEMMAP_BASE(tpm) XEN_PVH_PROP_MEMMAP(virtio_mmio) +XEN_PVH_PROP_MEMMAP(pci_ecam) +XEN_PVH_PROP_MEMMAP(pci_mmio) +XEN_PVH_PROP_MEMMAP(pci_mmio_high) void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc) { @@ -242,6 +312,12 @@ do { \ OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio); } + if (xpc->has_pci) { + OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam); + OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio); + OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high); + } + #ifdef CONFIG_TPM if (xpc->has_tpm) { object_class_property_add(oc, "tpm-base-addr", "uint64_t", diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h index 77fd98b9fe..bc09eea936 100644 --- a/include/hw/xen/xen-pvh-common.h +++ b/include/hw/xen/xen-pvh-common.h @@ -25,10 +25,29 @@ struct XenPVHMachineClass { /* PVH implementation specific init. */ void (*init)(MachineState *state); + /* + * set_pci_intx_irq - Deliver INTX irqs to the guest. + * + * @opaque: pointer to XenPVHMachineState. + * @irq: IRQ after swizzling, between 0-3. + * @level: IRQ level. + */ + void (*set_pci_intx_irq)(void *opaque, int irq, int level); + + /* + * set_pci_link_route: - optional implementation call to setup + * routing between INTX IRQ (0 - 3) and GSI's. + * + * @line: line the INTx line (0 => A .. 3 => B) + * @irq: GSI + */ + int (*set_pci_link_route)(uint8_t line, uint8_t irq); + /* * Each implementation can optionally enable features that it * supports and are known to work. */ + bool has_pci; bool has_tpm; bool has_virtio_mmio; }; @@ -44,6 +63,12 @@ struct XenPVHMachineState { MemoryRegion high; } ram; + struct { + GPEXHost gpex; + MemoryRegion mmio_alias; + MemoryRegion mmio_high_alias; + } pci; + struct { MemMapEntry ram_low, ram_high; MemMapEntry tpm; @@ -52,6 +77,10 @@ struct XenPVHMachineState { MemMapEntry virtio_mmio; uint32_t virtio_mmio_num; uint32_t virtio_mmio_irq_base; + + /* PCI */ + MemMapEntry pci_ecam, pci_mmio, pci_mmio_high; + uint32_t pci_intx_irq_base; } cfg; }; From patchwork Wed Sep 4 16:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980931 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=jP1bF6lY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSPK33z4z1yXY for ; Thu, 5 Sep 2024 02:19:33 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgA-0002bw-Df; Wed, 04 Sep 2024 12:16:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsft-0001OQ-0t for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:07 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfp-0002JD-UW for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:04 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f3f07ac2dcso75455441fa.2 for ; Wed, 04 Sep 2024 09:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466559; x=1726071359; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JNAX37zDCliJxTzZOV0veuq7ySJeesgiUypThOWliKg=; b=jP1bF6lYImm+DYszxpvwfDNagkmnrsIiSIBJuQyDuMzf5h9ny/oPXKY9foQAUrdgK7 FjydpTnnwweJyoJiDAid3DZl3rkaqr0A3c7QUvA4aOA5dp5Yr3CxYLmr6LYPse2CPla0 rXy7prw5L6yXAogtF+YzsFwdlEYIPuJGgVIdrLDup6b2yUkDVC1Gwfz13hprn1yfMlEn cG9bl6A8lyab04H1SUNuFrXdYGXaGkFlOK0opQ+n/QHLl5Y4DhmtPElomW/2GLv4CWSB o1s/6O1RdqAvHe5BfZoZWNp3n8XBfWG/fk9OcnWTN2s2jcwT7/BL5loo5dtmwisvLkF2 2rag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466559; x=1726071359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JNAX37zDCliJxTzZOV0veuq7ySJeesgiUypThOWliKg=; b=PwWFHFPVPbuBkojL1hEC28SV1m7wT2vyznHyr3Kzxp/YXb3B/Kq5hhYHynllaHy62i I3QX3pKesFV4Pm3nk7SIi6Hzh3lu69nsjDJ6efvKrLJ6I+fLO8XoTpvtZSZGxJcz2SjB vpZ0iFKS4NRX8fQydtC2V7esA9bNqEkMFy9AjaGb/DSy3jh2ojOPw36Q3/gYd+76L7Re 8ahLB6IGoeYoul0cohOaaD+A8mYO50H70r+0tfihr6ZueHYuHObWm1x8jjFYm9otxeeC fvTmhEcX600pkAneKo0kU/uA2FmydgDU/A0Rx5S3wIm6CHZYPWfpSjVlNmb0uS1/FZ25 3kUw== X-Gm-Message-State: AOJu0Yww09tgM9Hn4U6EAcaOMcZ1KuMO6SVr0WOJUwph44lGEIzuK2mR fgPMhqCx+GbB6uGe3BoD4G903mKsAnWATyAbTBSvKakbZ9lCwmj8umG/ViZt X-Google-Smtp-Source: AGHT+IEAwPaVJCHA49+7M5oevfh+eYRN2zuFYPqyzy6yv+vvfKCbQ+16M9Wi0x4p76qr+HpI/LDCcw== X-Received: by 2002:a2e:be03:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f6103c83ccmr138143261fa.24.1725466558973; Wed, 04 Sep 2024 09:15:58 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f614f384eesm24841131fa.62.2024.09.04.09.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:58 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL v1 11/12] hw/i386/xen: Add a Xen PVH x86 machine Date: Wed, 4 Sep 2024 18:15:35 +0200 Message-ID: <20240904161537.664189-12-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Add a Xen PVH x86 machine based on the abstract PVH Machine. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/i386/xen/meson.build | 1 + hw/i386/xen/xen-pvh.c | 121 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 hw/i386/xen/xen-pvh.c diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build index 3f0df8bc07..c73c62b8e3 100644 --- a/hw/i386/xen/meson.build +++ b/hw/i386/xen/meson.build @@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files( )) i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files( 'xen-hvm.c', + 'xen-pvh.c', )) i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files( diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c new file mode 100644 index 0000000000..45645667e9 --- /dev/null +++ b/hw/i386/xen/xen-pvh.c @@ -0,0 +1,121 @@ +/* + * QEMU Xen PVH x86 Machine + * + * Copyright (c) 2024 Advanced Micro Devices, Inc. + * Written by Edgar E. Iglesias + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "hw/boards.h" +#include "sysemu/sysemu.h" +#include "hw/xen/arch_hvm.h" +#include +#include "hw/xen/xen-pvh-common.h" + +#define TYPE_XEN_PVH_X86 MACHINE_TYPE_NAME("xenpvh") +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86) + +struct XenPVHx86State { + /*< private >*/ + XenPVHMachineState parent; + + DeviceState **cpu; +}; + +static DeviceState *xen_pvh_cpu_new(MachineState *ms, + int64_t apic_id) +{ + Object *cpu = object_new(ms->cpu_type); + + object_property_add_child(OBJECT(ms), "cpu[*]", cpu); + object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal); + qdev_realize(DEVICE(cpu), NULL, &error_fatal); + object_unref(cpu); + + return DEVICE(cpu); +} + +static void xen_pvh_init(MachineState *ms) +{ + XenPVHx86State *xp = XEN_PVH_X86(ms); + int i; + + /* Create dummy cores. This will indirectly create the APIC MSI window. */ + xp->cpu = g_malloc(sizeof xp->cpu[0] * ms->smp.max_cpus); + for (i = 0; i < ms->smp.max_cpus; i++) { + xp->cpu[i] = xen_pvh_cpu_new(ms, i); + } +} + +static void xen_pvh_instance_init(Object *obj) +{ + XenPVHMachineState *s = XEN_PVH_MACHINE(obj); + + /* Default values. */ + s->cfg.ram_low = (MemMapEntry) { 0x0, 0x80000000U }; + s->cfg.ram_high = (MemMapEntry) { 0xC000000000ULL, 0x4000000000ULL }; + s->cfg.pci_intx_irq_base = 16; +} + +/* + * Deliver INTX interrupts to Xen guest. + */ +static void xen_pvh_set_pci_intx_irq(void *opaque, int irq, int level) +{ + /* + * Since QEMU emulates all of the swizziling + * We don't want Xen to do any additional swizzling in + * xen_set_pci_intx_level() so we always set device to 0. + */ + if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) { + error_report("xendevicemodel_set_pci_intx_level failed"); + } +} + +static void xen_pvh_machine_class_init(ObjectClass *oc, void *data) +{ + XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc); + MachineClass *mc = MACHINE_CLASS(oc); + + mc->desc = "Xen PVH x86 machine"; + mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE; + + /* mc->max_cpus holds the MAX value allowed in the -smp cmd-line opts. */ + mc->max_cpus = HVM_MAX_VCPUS; + + /* We have an implementation specific init to create CPU objects. */ + xpc->init = xen_pvh_init; + + /* + * PCI INTX routing. + * + * We describe the mapping between the 4 INTX interrupt and GSIs + * using xen_set_pci_link_route(). xen_pvh_set_pci_intx_irq is + * used to deliver the interrupt. + */ + xpc->set_pci_intx_irq = xen_pvh_set_pci_intx_irq; + xpc->set_pci_link_route = xen_set_pci_link_route; + + /* List of supported features known to work on PVH x86. */ + xpc->has_pci = true; + + xen_pvh_class_setup_common_props(xpc); +} + +static const TypeInfo xen_pvh_x86_machine_type = { + .name = TYPE_XEN_PVH_X86, + .parent = TYPE_XEN_PVH_MACHINE, + .class_init = xen_pvh_machine_class_init, + .instance_init = xen_pvh_instance_init, + .instance_size = sizeof(XenPVHx86State), +}; + +static void xen_pvh_machine_register_types(void) +{ + type_register_static(&xen_pvh_x86_machine_type); +} + +type_init(xen_pvh_machine_register_types) From patchwork Wed Sep 4 16:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 1980926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=InIKDhJ1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzSLF1xQ3z1yXY for ; Thu, 5 Sep 2024 02:16:53 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1slsgH-0003Vt-C0; Wed, 04 Sep 2024 12:16:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1slsft-0001S2-Ok for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:08 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1slsfs-0002LA-0h for qemu-devel@nongnu.org; Wed, 04 Sep 2024 12:16:05 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2f025b94e07so65442411fa.0 for ; Wed, 04 Sep 2024 09:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466561; x=1726071361; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KdxPAmDEdUAtpsJzqv9PT9FKB3N+OoRAOYXGitcO7RQ=; b=InIKDhJ1aZaWAoafHXCYpw50NcFXhIQ8xhnOrhYbBCLGqrEko8QsNWHGZYUBkDXedJ LmR7pYefDRAxmviTiwEcb8GoITODezQCN30/sDRHoY66hkDv/34N+issJ6X6+SkwbS8K yUFBrrr/UlRJ7CZ4iiCkZb274zARBQ1GACj1ySsEmY6z7XA5Gp/1HNGyo5nXNYWsRmJ5 76A4dvOoUNjoh0ruMcyOcI+tfzoGmSl6BnNZAhDwrIeC05jfGzY8GvXaTOXS6x1LzgDh VrEnar05OI7BF/TiOTIV/LzxybO9ALBC6Xud5qGPwTCXjU/Rv+ZSX1MtZ4QnlPMuDJ5J zafw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725466561; x=1726071361; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KdxPAmDEdUAtpsJzqv9PT9FKB3N+OoRAOYXGitcO7RQ=; b=TjIrdx7ZSwIpM5smYx2tkzFbRSnrMdHmvmrK40etGh7UCL5OoiMCZuPOjkNW+fag2S ipu4Zdx9eTafw4bn2BABphN6qTmbuJcIfu3csbdNyx6+1BWlCzoXqVdDuhGonsmKXRON ZDbOR84xVn/RB7LzoVcEjx6pZolxdynkhOonB4GwEIk4Mz8z/3+F8pl+6I2DtzDzXj/8 LbJeVPrjmTUhrsqcFtil6ASPL4IvsUf1MrOj+c1u8GTfToZP5wQu8Ce0UUrvX7gV4/aA VXxPni9QoyuxtGzxMSrxivqE7C8LbhD1Ql7S5rSkHcRXhzhT/u0LH6lpa3P3Oi+OO1L6 lTWA== X-Gm-Message-State: AOJu0Yz3Jn+G7gd7/Hr4t7TImmvjtBUphShdR3XjaAMVMlUx+rTL/Nt+ uGWKFIxbkltVmvJzRWMOf5JbFKLZiGjWTdJQbRH6qmv4eg9jNwJibJjKYeS4 X-Google-Smtp-Source: AGHT+IFAdjefLP0GVVZKIUrpFKMNdvV3ASjqYkfelwsocfjh9WpkL3JieubicWsRTNAejwGyS1Ovnw== X-Received: by 2002:a2e:460a:0:b0:2f6:4bed:9b44 with SMTP id 38308e7fff4ca-2f64bed9bf0mr27782561fa.47.1725466561028; Wed, 04 Sep 2024 09:16:01 -0700 (PDT) Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2f66362f6ecsm321501fa.67.2024.09.04.09.15.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 09:15:59 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Cc: sstabellini@kernel.org, anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, "Edgar E. Iglesias" , Paolo Bonzini Subject: [PULL v1 12/12] docs/system/i386: xenpvh: Add a basic description Date: Wed, 4 Sep 2024 18:15:36 +0200 Message-ID: <20240904161537.664189-13-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240904161537.664189-1-edgar.iglesias@gmail.com> References: <20240904161537.664189-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- MAINTAINERS | 1 + docs/system/i386/xenpvh.rst | 49 +++++++++++++++++++++++++++++++++++++ docs/system/target-i386.rst | 1 + 3 files changed, 51 insertions(+) create mode 100644 docs/system/i386/xenpvh.rst diff --git a/MAINTAINERS b/MAINTAINERS index c2fb0c2f42..c14ac014e2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -560,6 +560,7 @@ F: include/sysemu/xen.h F: include/sysemu/xen-mapcache.h F: stubs/xen-hw-stub.c F: docs/system/arm/xenpvh.rst +F: docs/system/i386/xenpvh.rst Guest CPU Cores (NVMM) ---------------------- diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst new file mode 100644 index 0000000000..354250f073 --- /dev/null +++ b/docs/system/i386/xenpvh.rst @@ -0,0 +1,49 @@ +Xen PVH machine (``xenpvh``) +========================================= + +Xen supports a spectrum of types of guests that vary in how they depend +on HW virtualization features, emulation models and paravirtualization. +PVH is a mode that uses HW virtualization features (like HVM) but tries +to avoid emulation models and instead use passthrough or +paravirtualized devices. + +QEMU can be used to provide PV virtio devices on an emulated PCIe controller. +That is the purpose of this minimal machine. + +Supported devices +----------------- + +The x86 Xen PVH QEMU machine provide the following devices: + +- RAM +- GPEX host bridge +- virtio-pci devices + +The idea is to only connect virtio-pci devices but in theory any compatible +PCI device model will work depending on Xen and guest support. + +Running +------- + +The Xen tools will typically construct a command-line and launch QEMU +for you when needed. But here's an example of what it can look like in +case you need to construct one manually: + +.. code-block:: console + + qemu-system-i386 -xen-domid 3 -no-shutdown \ + -chardev socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-3,server=on,wait=off \ + -mon chardev=libxl-cmd,mode=control \ + -chardev socket,id=libxenstat-cmd,path=/var/run/xen/qmp-libxenstat-3,server=on,wait=off \ + -mon chardev=libxenstat-cmd,mode=control \ + -nodefaults \ + -no-user-config \ + -xen-attach -name g0 \ + -vnc none \ + -display none \ + -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \ + -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \ + -smp 4,maxcpus=4 \ + -nographic \ + -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \ + -m 4096 diff --git a/docs/system/target-i386.rst b/docs/system/target-i386.rst index 1b8a1f248a..23e84e3ba7 100644 --- a/docs/system/target-i386.rst +++ b/docs/system/target-i386.rst @@ -26,6 +26,7 @@ Architectural features i386/cpu i386/hyperv i386/xen + i386/xenpvh i386/kvm-pv i386/sgx i386/amd-memory-encryption