From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466588; cv=none; d=zohomail.com; s=zohoarc; b=UE0tewecRwKE5ZbzxwI+X1pnyZeIDZELhQXV47E3+/oCpVJLanaVd+ZU8Ii851Us+N2vH5rdZe3dXzYNBAqt/dtmMkBCr8NVlk8J0icZzDOgJIkce9afsm6JAveqkgnnSo2fRu5M4XRKzIHy/eRdV4A80+2xKMEVtX4jLX6XENA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466588; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0FTAVDz3Cw1uxIbhjmeqEYJqdjw34VbylOmDWLTwvx4=; b=HQf3KwxXgIub8GFRO0R0lg4tSXRQbI/m5vjwI5iEa11Wgo0p0siftQ9hM+Od34ijzcWtaIjfuJD6etqcSvfbfvFmdd5psCZRfzcOTPuYlKjuSsB7fC+M81o5t0YvskifuLGEo/iCTk3X8CYPjqb4Z03ctC/AtdGtSk261cmzaRQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1725466588876745.7507489293412; Wed, 4 Sep 2024 09:16:28 -0700 (PDT) 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) 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) 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466590714116600 Content-Type: text/plain; charset="utf-8" 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 =20 Guest CPU Cores (NVMM) ---------------------- --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466579; cv=none; d=zohomail.com; s=zohoarc; b=MKmhQBfSwDOU2llmMC35pkJ1yDwr8gSLZoMzrEZn55hMMKU+3ZK6hpNvBAiNiB6XPnMx47x4+OEdoAgPXIjhi7mN8pUb0o2TY30Z9k7qqenIgWjLwMvYg6BG7PRnxS11dZqR8mCNXxZ4ssDLJcE+UXL2/2Kzq5++9Nz+HTP/pbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466579; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=N6K1JnQDB3GxWbgLc2L3O0RRJjZo+EVTDK5d5nCO5jo=; b=MtpSDs8AWiK4oKiHOrDdxRHAQmi9CQIhr9Dz2hZVXzaqJtVCrtD2qS8o6TqP6RzlsYNMXgbqD0XdJjDxpIdPIh5UcoiX9mmlbkelZnr8JIbPCD+BaOIM90NtMjyxttAvKvU2FrC8HTDO2Z+bkKDjf2qVKRw+gSr/m6H6UlV6Duo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466579332806.4489430585946; Wed, 4 Sep 2024 09:16:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790548.1200353 (Exim 4.92) (envelope-from ) id 1slsfb-0000la-4w; Wed, 04 Sep 2024 16:15:47 +0000 Received: by outflank-mailman (output) from mailman id 790548.1200353; Wed, 04 Sep 2024 16:15:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfb-0000lR-19; Wed, 04 Sep 2024 16:15:47 +0000 Received: by outflank-mailman (input) for mailman id 790548; Wed, 04 Sep 2024 16:15:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfZ-0000LO-Mo for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:45 +0000 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [2a00:1450:4864:20::12d]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id efd333fb-6ad8-11ef-99a1-01e77a169b0f; Wed, 04 Sep 2024 18:15:44 +0200 (CEST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5353d0b7463so11546062e87.3 for ; Wed, 04 Sep 2024 09:15:44 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: efd333fb-6ad8-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466544; x=1726071344; darn=lists.xenproject.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=Z6wqDmyUEzSyQYixezUdsWRzlKrCaKy3O1eMZsPNw1hDFN8rK2IVVLD98R2CaK/Rix zn+0NmRMDJW2CHh2b4s3HeXtDWSHo9AThZomxo2jf2pAVD3whkTToSAbza28jYbLHBil YF6tnInaRFUE6aZvwCOlUBwW59TMTXYziaG3tULtyoKev+2JBrgBykfjebHhS0VyMTfJ 14lTqGo8lSzMV2SffGEBtdfDKhPojvMayyEuuZDgBZ+0I5zffbic4/vre383IyuR/jc7 qZWjN/+ikoDRllpxfrQv2QFyBnc1qlr70E88kFO4gHUQz3+hIlNqewBoFEG0D7qpyzbS k54A== 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=cpthDARy5ojCu4doRFOBKYo/K+P2XpQoZ06JBn6LpGiydtY6qEir6Nz/MvIqngLa2L Va7YvTXAKVq+zpRCDmSRBsG+fia8ddhPQfd2lDjFbkT618BwLFDJ3Bh4cxB77Vb5MaWF BQOLlT48DpGVqfd8+wzv2/MFiySMl19bu09nXR82WlC5oMkgJ7Fk9SnvjSy6nei3JMLI 7OLKc4IPga9lqmZIQCJPdncnr/w4mxIGDWBLoep+iXHA0Tto52mzJSqWfpLq/gmwVJCh +GmQK+ZMJl5PVnbfBl/NuqctC33SUyANHLudjKzP90qRptDD7DWAm/R8Pz/D64oePfct 9ptg== X-Forwarded-Encrypted: i=1; AJvYcCWLD4jypQsH8lPKVdnh9kleW/EBEOpJy81VT5XC6uOiOim2C5Ng0+b8vWycxP8dgLf6ZPuWFkg4TIc=@lists.xenproject.org X-Gm-Message-State: AOJu0Ywtv06lU5rX/gQY9S/WseuCHiS/nN7apYhziQofT/Uzxd8fpm0y Rb2sotp3Qu0ACBUFwB0BrRSnSLjL9U5G/nMvDSf/RDxBsubzWUwePXgD4g+k 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466580550116600 Content-Type: text/plain; charset="utf-8" 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"), t= o deal - * in the Software without restriction, including without limitation the r= ights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll - * 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 OT= HER - * 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 */ =20 #include "qemu/osdep.h" --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466572; cv=none; d=zohomail.com; s=zohoarc; b=FTdCu6G6f6hIF8xI30F+ECRAb2Vhow1mf1ZtkTne0ZMTN9hEcboUK8mrApnTPa2E84UN3to1VbwpCdZee17ypnYSQhkqnPb5K0wg9ffQi/H6L8p31+ou3E7D423DAAJTdLCq9UdzwcAkHgo5s+XXJWKhIRlbpyHYDrhv6CXeKW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466572; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cXrv0E3MFlFU+ItFyAOjyjeGygFPyj9i38Ckg44wQ0M=; b=jgQmq87FJWQ9MuBq4dKNOj88uy/cHztR8nHWKLjOZi+Hoz/6wRD2qoIOkooL40lLwSbioKinflH1poJ9Gt/w2ChDjWIlVJh2Qyz/K34h3204Ur4uPN3m8Y8IGbmUdh4tJ/sa6220zUpV/d4LxpJRVPW2vof47Y78Mz+7bShz2Ko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466572480431.98648862255425; Wed, 4 Sep 2024 09:16:12 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790550.1200373 (Exim 4.92) (envelope-from ) id 1slsfd-0001HX-JE; Wed, 04 Sep 2024 16:15:49 +0000 Received: by outflank-mailman (output) from mailman id 790550.1200373; Wed, 04 Sep 2024 16:15:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfd-0001HK-Fa; Wed, 04 Sep 2024 16:15:49 +0000 Received: by outflank-mailman (input) for mailman id 790550; Wed, 04 Sep 2024 16:15:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfc-0000LO-7f for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:48 +0000 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [2a00:1450:4864:20::229]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f154288c-6ad8-11ef-99a1-01e77a169b0f; Wed, 04 Sep 2024 18:15:46 +0200 (CEST) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2f64cc05564so22260011fa.2 for ; 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 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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f154288c-6ad8-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466546; x=1726071346; darn=lists.xenproject.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=Wwlle8RaUHbngUqlRcuZdxOglGOywJ2vTEfbgbadSewuQu0dVRN2CKXD2kEV5oSsG6 Os7OlgTwAybOEaOascU3M3KpL83DbkeuXWMpb5zyuPl/WoteJIzvBRbhXAo1vDpJVCg6 DGT2kJjCIzKglgZZvBvt2J3xADawPsMBGsPZknaP9k5TifP61Z2CcGmxPY8FOdGImypu YpP/tih3SeQKaDY2+0u7L+EBSVx4l1WFgDYavb2wxB3xSmTS20IvejFZ0mvjK2uXWTbk SYAyq7inJnmg0keUrs53L0c5wm5y53DlTblxbRBKUjBhxrvcvEj8vHeV7M7kmvZm0MO9 F7WQ== 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=E5YTP/2EpQjI1n9oBO5GU+bZaa6QyEJGYlsB935rxdStMYakzHCW875Ed42E6ej9/W +9JAgFp8Vgeq4Tnr7WDwSAYJIaMbky7rEUasjamMhQ0Rw6a2ikicvFkJD4CTCm04HnEq YyzEEIMffNyzWXAqUeBFW8mQhIGcz9cR7CLI14r9g99O/BTqpuTG9tnwNrDjjuHPzJsh x1fuagywVpXPUfxTmsU8Pl7XLf0QAquUpTuog0+DswGfX3xmb7hBeETFQkHF07NMJeix wh5HEXX0vq41yV5B7L+0HpTnYgZF8HpnntFrCxaDT9/XB53exUxzbBTvWVWMjF+cTx6p sNOw== X-Forwarded-Encrypted: i=1; AJvYcCV8UcbnrP+Uk68Ii89FESNebzEMXU3eXNHEVHZpX3dJZxL0owl+JEfqOraa+jYPoT5iyTxEv5Zbegs=@lists.xenproject.org X-Gm-Message-State: AOJu0Yz15F2laXayjrBY5g62Pa+GmMd/rsQI/sATGe2Yzk2xmX4h1mv+ IClg2ot+afaXesogvZBm1YmIwXyyY0vIeoyLBpSFTMg9VeCWq4iF 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466574520116600 Content-Type: text/plain; charset="utf-8" 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) { =20 MachineClass *mc =3D MACHINE_CLASS(oc); - mc->desc =3D "Xen Para-virtualized PC"; + mc->desc =3D "Xen PVH ARM machine"; mc->init =3D xen_arm_init; mc->max_cpus =3D 1; mc->default_machine_opts =3D "accel=3Dxen"; --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466583; cv=none; d=zohomail.com; s=zohoarc; b=TnXLUvJ95f0CRL57CCa4rzniCXMZ8k31+cOCualP8KYkRhX33jK15TD0Obnr1/GhNvYwcYDPFrRSiAzaZQElmuzMnYkOQGhb2iQecmyoxB2oYPE/viEMfhLIijCJT4Mql52rpEe7Dm3OSvFcbbuggOtbUgsRU0dCwxuZVdzd1hE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466583; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+QaVLnXt0IgeqG1OF+UMCmmf0V+2Gd+nNBZAoCF8K30=; b=XhLRMc+WBV+BUupIpWq42IsvOYCcguHDxkhIT+FEbbA1f9niD1GynCDW9Lzy/3Bjz3HSJ9NdhIgy/86zIKlki0TvxvDsBxJHbhLpp5jueL43F3+53QEiBMV/jqh4pzR4BtbLEDd/B7+MnyNt+TSY1+9/GhQI+bFXjKfP/2z+FPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466583427369.43127543878984; Wed, 4 Sep 2024 09:16:23 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790549.1200363 (Exim 4.92) (envelope-from ) id 1slsfc-00011N-Cw; Wed, 04 Sep 2024 16:15:48 +0000 Received: by outflank-mailman (output) from mailman id 790549.1200363; Wed, 04 Sep 2024 16:15:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfc-00011A-7t; Wed, 04 Sep 2024 16:15:48 +0000 Received: by outflank-mailman (input) for mailman id 790549; Wed, 04 Sep 2024 16:15:47 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfb-0000I6-G0 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:47 +0000 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [2a00:1450:4864:20::132]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f18eee98-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:15:47 +0200 (CEST) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5356bb55224so348894e87.0 for ; Wed, 04 Sep 2024 09:15:47 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f18eee98-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466546; x=1726071346; darn=lists.xenproject.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=YuJMezjreqR8JhAYxFCLERe+hktzK7miBRt/IdZsf/8pkz+uQBxbGdcvhiSftmG2KA oC5Rtm1YSt4bA8LPD6Uoi88lLOSwVhK6YKSp5wVRANCNHCGM5DwLduw/WfHFYU98caT2 50xLCe7KgCYUemIbpKrYlgTbduwG2pyM/zw2JxtWnlNuPUL4grZ34YAhgi0sg6j1vENj /LyJDlmjwVe861GvS3afPSgGxWmMcizzNzyAlWw/Ct0HZM2/5yij3pnSr52Jb/1iMwmo AbXzmHJPD7tNKZ75ei6PkYXjBkaOx0j4wXY4bQMSj2ZjIJT8c5Hsm84dTvrUvqum2O5B XmFg== 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=jaD3Vd+57MGqaT7U6PdAUa8IpjXV8D9bweedJrXk8qClqCRgkm0uxMzLWhUZPnxhGS M2eAsfs/n6LkORS1ke6T2b0Hzwq10CBLN2i0yljUgz8asNtoGA8hO9WD/F9kf78QXMsr mzI+Z9wcyqUqxEQ1whNyMkU0/lBYJIaj+PuMvLLJhHedgVIh1frdYMj7eLQLDUu4GJn5 +VgP/LqayARO/KLCCtywuUe90WKZOZrGJGqNCyQkITj9bBQl+WKbMO2UNKa50IrdYnK0 dL7j8uaJLAyue52G9NgKMPwQ3B0VJt8Y27c9c6AuUjjgjWKme1B7rXo5Q0dy/MkvDm7T Hv3g== X-Forwarded-Encrypted: i=1; AJvYcCW9R1w1IpqN3Ve+aJ5kBzUlSEwREXI0Cm97JOMiufEuGgbLynm02W3m3YmdvVfL1EYJHpNHF1S8YSM=@lists.xenproject.org X-Gm-Message-State: AOJu0YzPUVXV62bYsAGsGSRscWZD/Twg4ZKZgB72NxcFfkGKM8usjNmo L4AJuXIEONjmlKFLXvJMpc0Ef5j4emc47CL47tOu55dtKjlRrc/v 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466584700116600 Content-Type: text/plain; charset="utf-8" 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) =20 xen_init_ram(machine); =20 - xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener= ); + xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_list= ener); =20 xen_create_virtio_mmio_devices(xam); =20 @@ -218,7 +218,26 @@ static void xen_arm_machine_class_init(ObjectClass *oc= , void *data) MachineClass *mc =3D MACHINE_CLASS(oc); mc->desc =3D "Xen PVH ARM machine"; mc->init =3D xen_arm_init; - mc->max_cpus =3D 1; + + /* + * mc->max_cpus holds the MAX value allowed in the -smp command-line o= pts. + * + * 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=3DY: + * 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 =3D GUEST_MAX_VCPUS; mc->default_machine_opts =3D "accel=3Dxen"; /* Set explicitly here to make sure that real ram_size is passed */ mc->default_ram_size =3D 0; --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466578; cv=none; d=zohomail.com; s=zohoarc; b=HM708DZyyfv1JnbptHgNQwAvyL3sAs/tmLqkS923tLvNX9RpUFUb/VQqYKKXX6yDFSGiPkt23TCxdo02muXXC636oaD4vb9fQYVRwSOgfWgV6hg1NuDJlvNuFg9x7R6icJ3adKk8JGeLYehbfchXpCqf8hhBsNejPYfFDPzQa5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466578; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4UdvH3BfQ7ZFjeKvJ3vJphtRrv7BJb81oMyMgddOC7g=; b=Vc17fqMAieZ3C/U8ts0VxGlSk+AAXWhQqzEVr6ql6aczCuHo5bdhAv/PFeN2SpUKFduw0mQ6ACkqhEsTMyunNlysoeUdsFutsr0+VTgXYmgiXSzTlbTMX67kh8mId0wQ7l8OyrlLbbcMo1huurN3OKCYNzuk8x/2RMSOV991hDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466577846960.4636683827704; Wed, 4 Sep 2024 09:16:17 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790551.1200383 (Exim 4.92) (envelope-from ) id 1slsfe-0001Xe-Sb; Wed, 04 Sep 2024 16:15:50 +0000 Received: by outflank-mailman (output) from mailman id 790551.1200383; Wed, 04 Sep 2024 16:15:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfe-0001XX-Ns; Wed, 04 Sep 2024 16:15:50 +0000 Received: by outflank-mailman (input) for mailman id 790551; Wed, 04 Sep 2024 16:15:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfd-0000I6-7r for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:49 +0000 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [2a00:1450:4864:20::22d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f291fd57-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:15:48 +0200 (CEST) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2f4f2868783so69438201fa.2 for ; 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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f291fd57-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466548; x=1726071348; darn=lists.xenproject.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=OuT9OzrVnA0g3JjJ7PdpOQz/I/2/Xp04KexsWBAGPE836iwgpntCVeTbHv/UJ1/gfj 12Iz7YdgnQ9v82jkWc7k23sWv0HCX5onXMBC0dle7XsGaD2Q7Ntti5ulQqvkbBTEYO0C m3+MG6JgWW1O6aXJKwke8PoxqnII82LTS5PPnjNX+WKoTuSrJ0WWP07Sb78oflgCv8kD WTD3hMixkE/BnieX1PvGz5btESPVoy4UDwUmJQppnIQgeWL1B/7WPHAX/KcZbDPyuf1Z Z9TzKxQEc3eWGq5YDjIrqwY23iOqQuqRyHHwWJwVgc20jGDxw4w5Ve7d3X3l27UTB+wQ 0wwg== 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=s5j9n0K4D5cRWiPPksmClS/ra/4KPJUBmnXNTj5Zi8MJCURvBXOxiv8CGN96NaqAu6 8gwwCKpHiFj4ew0SdSIfjIvFkwhO/fMSNX29SW5F3xnIPSmRdwq8XtMBJi1o2203kRn2 tH4G81ZyHDbAWivXEOD027uh4nvfSzAtobhf0twJPyXMC2JQ6Ocv5aGBWMjeTFBLZ2F/ L2QngFkOSYFc/wSZ9enNl0owF92s4SpwFoI+yWcpQBnYAJj4dCKB4muuQ+XBIYrvb+cM jB+DZ4d9qKVnFK+Kpqf3h8k3+o/wm4injZo1Onm47RCyqpodLAfwYESkQZmhoS5zr9IL bgVQ== X-Forwarded-Encrypted: i=1; AJvYcCUbc71d70o+pikxvtIRyuMq0QgKW1bUxbcFiIr2C0wVkNiBsFT7VNIftPV3svvuQMKXfiABOaf+VNQ=@lists.xenproject.org X-Gm-Message-State: AOJu0Ywbrd0bVlt/aS1UAwlkVBokV4Brwgndv9Shv5fYkq40V10/VTbu 9uI/XxHM1r7Icp1TYeE3zxKAPqKHv0MFOFOAoc6vo17myy8+PL5c 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466578554116600 Content-Type: text/plain; charset="utf-8" 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 =3D g_new0(XenIOState, 1); =20 if (machine->ram_size =3D=3D 0) { - warn_report("%s non-zero ram size not specified. QEMU machine star= ted" + 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; --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466604; cv=none; d=zohomail.com; s=zohoarc; b=K/wJWG/Jmxebk85cMUTGoR73R4OnOq+a+pzENCLtDepaUDyN7B05L25stJ8qmENhHZofOYkpBjtU8CbFb7if6e3juCc15moXnQWqNdfjMp2c6zNJUhVoJd4/fU+pwa7LHKYp/Mf6QfTAZyc1eSk7hKo5/CNTDRNuVDInSH0x/7k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466604; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Je23wvBBopidSll9UpAaH5rZwvVBAj7ARc0Pm2/k3kk=; b=Z1tsuDpK983KDPY1kqHxatQ1PRuwHuBaCNdpSI8pfgDS/lBGyjPBYf/0irj16PDrtHDF9ocx/mLPdOwJTx/A941ASWw2UWTNX+DtxLA1TmKUCRVhkTjgxP0Ht0QCyC7KtctJJ4RQXAJrewd21TkJlPa9foRYOxMW7ZzgcMMOSac= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1725466604944690.965837055366; Wed, 4 Sep 2024 09:16:44 -0700 (PDT) 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) 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) 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466606777116600 Content-Type: text/plain; charset="utf-8" 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', 'mcim= x6ul-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', +)) =20 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); } =20 -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) { --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466584; cv=none; d=zohomail.com; s=zohoarc; b=IiJ66zi4V3Yd/liIOkKmcl85zl/Eh/mGIvzTtLLI0/1CdwO7SqTJqqTxkXJHKrWwl2RFogR6lfpu4hhgyvzcMYCfGMHYk6PnNjjtWNrV+GQwWmtnXwC6MoRVvIKK3W27KT6WxstPSfC9btkludxRr6ZPzRJukbXvyknVCsZuxkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466584; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9ixH95d7Al9xFTOStqh6VLaEXX0BKF8+hj7xVV9eDrA=; b=ZoT2I5g/Zr0l9wTiKzSIDY/nqes8kiYFnNYFr5qvm9KvOcOlXWi/ggVpeLTZ0IY15nBKL5V26itlb7wNb47jpYadwXjSLf5d2UD/u/lv4ZuN7JlWGlyRU46aTGEan7oNVvacefR38nZPUx17EfsrFkC895DSZKbJX8Nb+YLwHXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466584090819.1441533551277; Wed, 4 Sep 2024 09:16:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790553.1200402 (Exim 4.92) (envelope-from ) id 1slsfj-0002E6-Jo; Wed, 04 Sep 2024 16:15:55 +0000 Received: by outflank-mailman (output) from mailman id 790553.1200402; Wed, 04 Sep 2024 16:15:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfj-0002Do-FY; Wed, 04 Sep 2024 16:15:55 +0000 Received: by outflank-mailman (input) for mailman id 790553; Wed, 04 Sep 2024 16:15:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfh-0000I6-R1 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:53 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f4b1ceb9-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:15:52 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5334c4cc17fso9467078e87.2 for ; Wed, 04 Sep 2024 09:15:52 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f4b1ceb9-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466552; x=1726071352; darn=lists.xenproject.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=jJrQStlKOeVzmXYbM6mGwdz4d+V87woDlqRvN3MJv8UqWMqnO1xVUp1W/jtfUOJqgE nVnnoMFhaZT4t1Lq1Khu6/0ckvIo1iaWn2O2JCeq0BUdu2ju+7YSYbUkaU3nGoApKGhq EC2i6kcOt2u+wAItdSYFNHcMWsrUHTrDJL4LhjDgtHoZwXXeoIbMzy3At4n+QQ/lwS6U kzc60/UePTjqrzLDYXDW0wtVqxnrk4O8Y5QfWWh95jBLsifmO84gWfZ0psbLGzGz/uyC DcAApqw90K1C5aY039et7VScsgI8zl3UIlfE7vfHIIdODr7wbc0ncjg0u8l/6qXVOUHE 1KJg== 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=fuF666Q4Fdo7cUNv72ZYi4vEqsDLb/MdkD0Le9hlrUZvrjPXFUkGl8JdmY1fsgylgy euir4lMJSqlo3cj4WIMDfNcG/7M1WU18kigdOGKIs8X9tUiaZJXQFB1STZ3c/bv41i2h ccqg1flxNjqhNcIt6bTjb6mGCmoLtV0W3FqmlCf6r+s3pJ7+UIq14PIixTLPzzHjeWra 8YDtXlQqagim/UN/GeXKsvIfDmmvRK8PT7wGB2n5a+A/DEAEelB7bfotRjAov25IzDyv UU5/E1TFV6Og8ddf9jvOCFwLJJzp7Xk6VKSYYj8ahSba40VE2XwOlbulZUDXq3GO/PO6 xSaQ== X-Forwarded-Encrypted: i=1; AJvYcCWnYNWzFL6YRCuUPhGVUOmhf8HiCxkQ0pxZXMW7VvBL2GCG67DRpCiUqqJVvDgcb8lCVlTlbSRVgF4=@lists.xenproject.org X-Gm-Message-State: AOJu0YxaOPEOD0kaetc2BFM1Y110FwuuPAMjGkvGxW9i5fmdf0oTF2Dd NIxUFhl0D/FDO++dU6wYN71rgLKiFzau88uYTHLMvrBLUwHvEuJJ 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466584875116600 Content-Type: text/plain; charset="utf-8" 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 =3D0x%x len=3D%d byte= s" =20 -# xen_arm.c -xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created vir= tio-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" =20 #define TYPE_XEN_ARM MACHINE_TYPE_NAME("xenpvh") -OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM) - -static const MemoryListener xen_memory_listener =3D { - .region_add =3D xen_region_add, - .region_del =3D xen_region_del, - .log_start =3D NULL, - .log_stop =3D NULL, - .log_sync =3D NULL, - .log_global_start =3D NULL, - .log_global_stop =3D NULL, - .priority =3D MEMORY_LISTENER_PRIORITY_ACCEL, -}; - -struct XenArmState { - /*< private >*/ - MachineState parent; - - XenIOState *state; - - struct { - uint64_t tpm_base_addr; - } cfg; -}; - -static MemoryRegion ram_lo, ram_hi; =20 /* * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c unde= r 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) =20 -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 =3D 0; i < NR_VIRTIO_MMIO_DEVICES; i++) { - hwaddr base =3D GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE; - qemu_irq irq =3D 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 =3D get_system_memory(); - ram_addr_t block_len, ram_size[GUEST_RAM_BANKS]; - - trace_xen_init_ram(machine->ram_size); - if (machine->ram_size <=3D GUEST_RAM0_SIZE) { - ram_size[0] =3D machine->ram_size; - ram_size[1] =3D 0; - block_len =3D GUEST_RAM0_BASE + ram_size[0]; - } else { - ram_size[0] =3D GUEST_RAM0_SIZE; - ram_size[1] =3D machine->ram_size - GUEST_RAM0_SIZE; - block_len =3D GUEST_RAM1_BASE + ram_size[1]; - } + XenPVHMachineState *s =3D XEN_PVH_MACHINE(obj); =20 - memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len, - &error_fatal); + /* Default values. */ + s->cfg.ram_low =3D (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE }; + s->cfg.ram_high =3D (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE }; =20 - 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 =3D NR_VIRTIO_MMIO_DEVICES; + s->cfg.virtio_mmio_irq_base =3D GUEST_VIRTIO_MMIO_SPI_FIRST; + s->cfg.virtio_mmio =3D (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE, + VIRTIO_MMIO_DEV_SIZE }; } =20 -#ifdef CONFIG_TPM -static void xen_enable_tpm(XenArmState *xam) -{ - Error *errp =3D NULL; - DeviceState *dev; - SysBusDevice *busdev; - - TPMBackend *be =3D qemu_find_tpm_be("tpm0"); - if (be =3D=3D NULL) { - error_report("Couldn't find tmp0 backend"); - return; - } - dev =3D 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 =3D 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 =3D XEN_ARM(machine); - - xam->state =3D g_new0(XenIOState, 1); - - if (machine->ram_size =3D=3D 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_list= ener); - - 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 enable= d"); - } -#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 =3D XEN_ARM(obj); - uint64_t value =3D 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 =3D XEN_ARM(obj); - uint64_t value; - - if (!visit_type_uint64(v, name, &value, errp)) { - return; - } - - xam->cfg.tpm_base_addr =3D value; -} -#endif - static void xen_arm_machine_class_init(ObjectClass *oc, void *data) { - + XenPVHMachineClass *xpc =3D XEN_PVH_MACHINE_CLASS(oc); MachineClass *mc =3D MACHINE_CLASS(oc); + mc->desc =3D "Xen PVH ARM machine"; - mc->init =3D xen_arm_init; =20 /* * mc->max_cpus holds the MAX value allowed in the -smp command-line o= pts. @@ -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 =3D GUEST_MAX_VCPUS; - mc->default_machine_opts =3D "accel=3Dxen"; - /* Set explicitly here to make sure that real ram_size is passed */ - mc->default_ram_size =3D 0; =20 -#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 =3D true; + xpc->has_virtio_mmio =3D true; =20 - machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); -#endif + xen_pvh_class_setup_common_props(xpc); } =20 static const TypeInfo xen_arm_machine_type =3D { .name =3D TYPE_XEN_ARM, - .parent =3D TYPE_MACHINE, + .parent =3D TYPE_XEN_PVH_MACHINE, .class_init =3D xen_arm_machine_class_init, - .instance_size =3D sizeof(XenArmState), + .instance_size =3D sizeof(XenPVHMachineState), + .instance_init =3D xen_arm_instance_init, }; =20 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 =3D 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 a= cquire 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 domai= n %d %s" =20 +# xen-pvh-common.c +xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created vir= tio-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 =3D { + .region_add =3D xen_region_add, + .region_del =3D xen_region_del, + .log_start =3D NULL, + .log_stop =3D NULL, + .log_sync =3D NULL, + .log_global_start =3D NULL, + .log_global_stop =3D NULL, + .priority =3D MEMORY_LISTENER_PRIORITY_ACCEL, +}; + +static void xen_pvh_init_ram(XenPVHMachineState *s, + MemoryRegion *sysmem) +{ + MachineState *ms =3D MACHINE(s); + ram_addr_t block_len, ram_size[2]; + + if (ms->ram_size <=3D s->cfg.ram_low.size) { + ram_size[0] =3D ms->ram_size; + ram_size[1] =3D 0; + block_len =3D s->cfg.ram_low.base + ram_size[0]; + } else { + ram_size[0] =3D s->cfg.ram_low.size; + ram_size[1] =3D ms->ram_size - s->cfg.ram_low.size; + block_len =3D 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_me= mory, + 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 =3D 0; i < s->cfg.virtio_mmio_num; i++) { + hwaddr base =3D s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.s= ize; + qemu_irq irq =3D 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 =3D NULL; + DeviceState *dev; + SysBusDevice *busdev; + + TPMBackend *be =3D qemu_find_tpm_be("tpm0"); + if (be =3D=3D NULL) { + error_report("Couldn't find tmp0 backend"); + return; + } + dev =3D 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 =3D 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 =3D XEN_PVH_MACHINE(ms); + XenPVHMachineClass *xpc =3D XEN_PVH_MACHINE_GET_CLASS(s); + MemoryRegion *sysmem =3D get_system_memory(); + + if (ms->ram_size =3D=3D 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 =3D XEN_PVH_MACHINE(obj); = \ + uint64_t value; = \ + = \ + if (!visit_type_size(v, name, &value, errp)) { = \ + return; = \ + } = \ + xp->cfg.n.f =3D 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 =3D XEN_PVH_MACHINE(obj); = \ + uint64_t value =3D 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 =3D OBJECT_CLASS(xpc); + MachineClass *mc =3D 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 =3D MACHINE_CLASS(oc); + + mc->init =3D xen_pvh_init; + + mc->desc =3D "Xen PVH machine"; + mc->max_cpus =3D 1; + mc->default_machine_opts =3D "accel=3Dxen"; + /* Set to zero to make sure that the real ram size is passed. */ + mc->default_ram_size =3D 0; +} + +static const TypeInfo xen_pvh_info =3D { + .name =3D TYPE_XEN_PVH_MACHINE, + .parent =3D TYPE_MACHINE, + .abstract =3D true, + .instance_size =3D sizeof(XenPVHMachineState), + .class_size =3D sizeof(XenPVHMachineClass), + .class_init =3D 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-commo= n.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 --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466579; cv=none; d=zohomail.com; s=zohoarc; b=jUyi6m2HSv2+ok9bRfJYdWtJ6KC8SPqVu1hhU5aP10VMJmzVSQYeq3eb0/TcxUM6beg4tGcAapS+JovMJztTBjjfiqovHZgK87PDLKnttJHVK+zOpCO4FYS5VlMpvdR9RGJRV4e1DdlPpJDmTQMSFPOdWxl9mlBPsNxw8ARFeFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466579; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nym7Vpc1+HcpD0fJwqv749eMWZaaEovUQaBKn9/MOQM=; b=iS4/UaqgF3Wz+DQPwJdGVUJnWgozucjvnp3HnvSh5Vzx2FKaHWZsjAmitTbxvTbVDLdPSrdFSIerg9j0wyoW+/vIk+QH4qSEjsXY3+4a1Qvwn1YXOoKsQ4VAigeN8rXcqzPW2e6vCbgvmKufAhaGuspJHpYhqIclHB2WP/E07OY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466579588862.9217104580779; Wed, 4 Sep 2024 09:16:19 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790554.1200413 (Exim 4.92) (envelope-from ) id 1slsfm-0002dh-5e; Wed, 04 Sep 2024 16:15:58 +0000 Received: by outflank-mailman (output) from mailman id 790554.1200413; Wed, 04 Sep 2024 16:15:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfm-0002dT-1F; Wed, 04 Sep 2024 16:15:58 +0000 Received: by outflank-mailman (input) for mailman id 790554; Wed, 04 Sep 2024 16:15:56 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfk-0000LO-16 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:56 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f605ec91-6ad8-11ef-99a1-01e77a169b0f; Wed, 04 Sep 2024 18:15:54 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-5334b0e1a8eso8739576e87.0 for ; Wed, 04 Sep 2024 09:15:54 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f605ec91-6ad8-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466554; x=1726071354; darn=lists.xenproject.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=dR6ILUOPoqO/aIFjvSHqaTRq3ssEFkxZlY9yjvZXpjM2yLtan9Xua3XyfHsZxspH1M SH0IyJqxO0l5cTihGwiJR2vPYS95ftVNN8CRfOzzlss7/NI5InOMFvOSVKop0H7Gk29T 7gqh8sz6HCt7ju+jFsIUQCp+CRCkoNenyH2iijJyEvI7tAt90NcY5LOIcFFw6Kpq7Ofm xb5+lb/S8qm/C2hPxj3slhHlf2BcE/ETkWSWL1JLYBNmtuWMhuNMJTGEpv0UM1meoOEt C4+dpSbGq/qP7gHcnHf1eheMrcXQ2pqsQYNaljZKvfoMr6j8lTe+MJDYkRamWRQyWxkh ElIQ== 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=lrEzqAfkvoY2B0oKeMRR3WWR5Z0JLemHlPB229+3fL8OYbcArj0PPz3UPy/714vUs0 FGhAYBdW447G/eUMhLk+hmlDa8v7LKzE38G2ZFiYx3a2c2oeND5L/qxKgOeHw3y+Qs/B S4Xibv0PLI+Qvi5X5zpzvmKYr/iVSOK5Br5Q6UMNCuomNdUQcZAOlNTAyK6+mWQYXLta IkVzk+tt/ML0P3gyNDSfo6v2O44cfd50G7k8L+Xl0CEUA91rJO47wRzPKBK/rySCixJ/ ggmZx/16f0GI2Uruoa95+Itwnm+TskrJJ5x6mD20ZPPUMjqEoYl0H8L0XJz1W07LelWz Uy3A== X-Forwarded-Encrypted: i=1; AJvYcCX0udJWNpcuWV0ZEWLdkXqNjeStT7pxPtPDBIVsjlhQelvDdGFRvkM2Bxadg7n3Lk8Niu91XnR64LA=@lists.xenproject.org X-Gm-Message-State: AOJu0YwRDVjQw9hk52ss5RgMdRJRo7lvR1e8gG26aVssjzFAmm5V/Pys yF4w8dyuvOjojLVpRvI75zzPbeiNhVtD2Isw+V1ur5UM7roEGCX8 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466580542116600 Content-Type: text/plain; charset="utf-8" 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 =3D> xen-pvh.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename hw/arm/{xen_arm.c =3D> 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', )) =20 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 --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466584; cv=none; d=zohomail.com; s=zohoarc; b=RjRNcD51KWyc8l/XQezvAz2Fyz3o1HpIuC8Nus1vZnpW4IgKfDanet9TFXsLSM9xvhXCTz3vwrZgtso0/uIYYa0JTsZ2+AsV76oKAhw5iJMpKy7VfvrwaRiG9clbQnJcKDqmBusbXnlRSr5N1AJ640j24rnbGJxuBYDLsSo0wKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466584; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=nn/Mzsj0J8g/Mphb+PXQ5WHUtYUEk9GjObY40SBe48s=; b=lmZ9bVim0DkDx1d2XAwfPJn46IT98X/oAYt67ARrBfcJtFbXCraGiWVjMPCvBQXtrQ+XvFv/kdVMR/7kAJoSUoM0YCadefjueSS6By0Y+M8l70hJwlncBUAoKzlMqbyXyiVqebFQCi//IURDXyU8/0kv+TS//DUWzav7pCcuwwI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466584475563.3361363270038; Wed, 4 Sep 2024 09:16:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790555.1200419 (Exim 4.92) (envelope-from ) id 1slsfm-0002gl-MI; Wed, 04 Sep 2024 16:15:58 +0000 Received: by outflank-mailman (output) from mailman id 790555.1200419; Wed, 04 Sep 2024 16:15:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfm-0002fi-AO; Wed, 04 Sep 2024 16:15:58 +0000 Received: by outflank-mailman (input) for mailman id 790555; Wed, 04 Sep 2024 16:15:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfk-0000I6-R3 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:56 +0000 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [2a00:1450:4864:20::234]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f6feaa82-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:15:56 +0200 (CEST) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2f6514f23b6so19840491fa.1 for ; Wed, 04 Sep 2024 09:15:56 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f6feaa82-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466556; x=1726071356; darn=lists.xenproject.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=aAnh+FEeyrd1mo7qxAuBWBCnrbCHW/amr4H/pwcwAxJUHxwVCNyvcSnZE+cPJ9naMS +Kovigp1eGbNUIr+JyO75Jchku1dx0jY5OQ3SyRRLofyALoPrZ/KFmEMdwD3y3bhqAzf MAkuZXE4qhSnMHqJ15DfPtaisM0fLYC49Ox42TZadZ3HM+FGMWOiexPqtB3h5v6N1YOe IV0cDW19onLs3vO8/njo7nkhTIYUy9RqjsFCW5sQBCvUXdYB4a/azMMAQdpuRIG3Sb4T 2xA4w6rdl11wPsOeuax/ai0d/Lc2vwdrHxCNHO6Dpcuyk96fc7fcAoDNMm1CVzHFvlW4 W53g== 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=W33nRkkZgL7J5crBB1fbayoCRKXYx5VEzK8QHGVgy1h253C8lNCXjfMEcU4iVEnGfE WNGooLnXJyGJS5pT4j3C3L4gCzRoH9trAzblc4yK8bOUcci2HMBh1oiAU+VZTucxopFs r0FfsTO5WnIOxfoV0hkjdfABLQXNJVYeZ/x7jnfnUT++viFHkcO2O4pBBujqKXuGVF1l K8vbcwOkhYew0mWwMfb8HR8RAoDTglBPutxukGhwwPydVKt2pnWZQNmcZsC3sp0+QMLv kMVHh5rYkQFu7HReBf8+CqTP8bTVVAV1kJJjBhth87RM964Q5kyutQgmk1aiuu63mjus 5ZaA== X-Forwarded-Encrypted: i=1; AJvYcCUr96729X/VTjoX/YJM2petLpyZEQZcWCwXxqcz6I0iQt7dlrsZ81dH8HL6e5TiS1yLS874Pohv19A=@lists.xenproject.org X-Gm-Message-State: AOJu0YyDftWFjOeKDeq8wbrSB4bJ69/Ssq8jV5IM/+XXoaNvtCn93PRs VHT6CVrPML9gtx9+DchZ+9snlufyfLJDKLTnzM0D5U7DCwAo5Weu 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466586648116600 Content-Type: text/plain; charset="utf-8" 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(XenPVHMachine= State *s) { int i; =20 - for (i =3D 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 forwar= ds + * order. + * + * This is what the Xen tools expect. + */ + for (i =3D s->cfg.virtio_mmio_num - 1; i >=3D 0; i--) { hwaddr base =3D s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.s= ize; qemu_irq irq =3D qemu_allocate_irq(xen_set_irq, NULL, s->cfg.virtio_mmio_irq_base + i); --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466581; cv=none; d=zohomail.com; s=zohoarc; b=PrgUIWrppCj3jlpeF/CQTa22VV9rJi1ErVN8b7jb8t1XMJDrwiz9VV2r+dgHTSMYXxXzu67V/E3DSnmE8h5U+3O5qsCf2TZQGTEAaotE6+yZLhJxSzrowtvbLmTvBod5zE/n0yMAYbnTqIAX3rSmpUzEpO7e9YuD9bDCOtutRQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466581; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AhHuSPxpBNKwAgr3pqcWE8F4qfu6xeqGgbqjKgqrTwo=; b=jPS93hQfsYfXDPSI52vzkQGy4CA1VeGfGh9rYSfVhLVu+Nrjcd+TtodqMJephcvX0OIG94GZZsfwCSAcP4wC5tuSI3c6N5gjhBJTGLuKpsIey/JGcdan2xYMIvWdoJwabue7d8TM3fVu0qQ/hTDKSzl9t45QY+m7LpDifNOA7dA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466581045534.3158465838355; Wed, 4 Sep 2024 09:16:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790556.1200434 (Exim 4.92) (envelope-from ) id 1slsfp-0003Ot-06; Wed, 04 Sep 2024 16:16:01 +0000 Received: by outflank-mailman (output) from mailman id 790556.1200434; Wed, 04 Sep 2024 16:16:00 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfo-0003OZ-Ow; Wed, 04 Sep 2024 16:16:00 +0000 Received: by outflank-mailman (input) for mailman id 790556; Wed, 04 Sep 2024 16:15:59 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfn-0000I6-Fu for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:15:59 +0000 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [2a00:1450:4864:20::131]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f87def00-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:15:58 +0200 (CEST) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-533463f6b16so1384139e87.1 for ; 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 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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f87def00-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466558; x=1726071358; darn=lists.xenproject.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=PZo2ZVQtyAJzZPCroq0czgVOh6Sf9InaY0/Dq94KvWD7L3ONtu57hA4Vka5wVsea2h 0PKDaP80gBTGfTpMr8ilReU2AZnQur/mJ9O1ALFZGNViwCjmmMQ8PLdko+JMw8Q2hbU0 ZuL34OCQt9Zik6pC7k0Hpby4x/MYguBi+mK3ywABfzeuOMvIX+h7rMAMHzUW7gH4RZYc 1wLe5EywNh/nVHjNl9AT+Q2lW50G0+VF0UT343UfE3x4umQobQ80mN+rHFPE3LX63Zby JSwNUA5lhQ+qHoxLBKpJokJ3gRLU2GAKV7XTnFy30bKP+dZer1AVjv094myFAIp07nIW +4lw== 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=nI3sd5XvWgF4ja09sLxz9n0xrVOds939tY/LcVFr1SO4Vi2J2YS66ZIuOrbydG8DPz SMmIRW6AWNFheKswRN1gq+BtiEnsUtmjG/hIpmEEH3WcSRdLEcI3Vo5am8AMxcT3gdKh /GiMTFw1zNzyr7TaRbUX3Hjzol4kZcCoXwGWsjTDRdpw9xtxNuGhT78Heotr8YZ0SMal Mwp8Zyn8uqjyJ6G6srWAXrPHuefje/qX2W+tiVc5r5eB6nUNeA4kcxP13Gww2jsaj8zM 1CDkw03vQHFSHD774shEeGVXmKQDWva08W7Oa+6ER4c6AdJ8gN8n2HSCk1CsaWaF1z4k Sbbw== X-Forwarded-Encrypted: i=1; AJvYcCU25D+AykhEAFFfuqpxcBqO9bbg4s3tWy7nljISzFZVpyGm2CVScpnfnBR461VtdPm2FhPrqgOsYQ8=@lists.xenproject.org X-Gm-Message-State: AOJu0Yxf0CRWczIWTSYo1PfP0tNmgbJuSO2VQ4A+x0n16b8iaTVpa+3L nFUPTL1hADIfdlywtBtQpdUh+jyZ8bnWUj1cpOJmhNAJoII/S5jg 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466582750116600 Content-Type: text/plain; charset="utf-8" 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 =20 +/* + * 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 =3D DEVICE(&s->pci.gpex); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + + ecam_reg =3D sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0); + memory_region_add_subregion(sysmem, s->cfg.pci_ecam.base, ecam_reg); + + mmio_reg =3D 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-mm= io", + mmio_reg, + s->cfg.pci_mmio.base, s->cfg.pci_mmio.siz= e); + 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 =3D 0; i < GPEX_NUM_IRQS; i++) { + qemu_irq irq =3D 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 =3D XEN_PVH_MACHINE(ms); @@ -152,6 +210,15 @@ static void xen_pvh_init(MachineState *ms) } #endif =20 + /* Non-zero pci-ecam-size enables PCI. */ + if (s->cfg.pci_ecam.size) { + if (s->cfg.pci_ecam.size !=3D 256 * MiB) { + error_report("pci-ecam-size only supports values 0 or 0x100000= 00"); + 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) =20 void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc) { @@ -242,6 +312,12 @@ do { = \ OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio); } =20 + 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-commo= n.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); =20 + /* + * 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 =3D> A .. 3 =3D> 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; =20 + 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; }; =20 --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466589; cv=none; d=zohomail.com; s=zohoarc; b=kr43TEg2EVMpPERC/mq6dtHGmbAmSFGXeFvD4jg0ZHzotSfgUNj+NHdnHhDWFBOxpRbVn2mqLkUTbDudud5LSIwt5kvG3gQ5n6S6VgwAzbdeHhqYPFaOQPS/DorqziC8DoHTZmjpRF5DOKtZD+Ol/+jsbpEPYYJ2YyhHY108AGg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466589; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JNAX37zDCliJxTzZOV0veuq7ySJeesgiUypThOWliKg=; b=F3sMZ0CRLalqs1SXhpGSArHXTzYjg1oLebqKYOUDGu0lOAZGY3Jz3075X0HM+bRd/9tmxmdf9JffXO/AFoqggEpnKk+0IcSE/TJHItoTWMNTsb17m30IYWU4gKGUepTntHosR5HvCqFYl37+ZGvuN6sX7iHfZSwha23cPHbSoiM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466589323340.76132447281134; Wed, 4 Sep 2024 09:16:29 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790558.1200443 (Exim 4.92) (envelope-from ) id 1slsfr-0003sm-91; Wed, 04 Sep 2024 16:16:03 +0000 Received: by outflank-mailman (output) from mailman id 790558.1200443; Wed, 04 Sep 2024 16:16:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfr-0003sK-3K; Wed, 04 Sep 2024 16:16:03 +0000 Received: by outflank-mailman (input) for mailman id 790558; Wed, 04 Sep 2024 16:16:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfp-0000LO-S9 for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:16:01 +0000 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [2a00:1450:4864:20::22e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f910da40-6ad8-11ef-99a1-01e77a169b0f; Wed, 04 Sep 2024 18:15:59 +0200 (CEST) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2f3f0a31ab2so77904341fa.0 for ; Wed, 04 Sep 2024 09:15:59 -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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f910da40-6ad8-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466559; x=1726071359; darn=lists.xenproject.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=S4Vl5x6mvohebCnHgUWtAdmMF2wfgSt0fiY7GnlvWFN6G6ekRawLvuGyRIK1lzBqhP 3XGoEodURgWpZHGFb9aMIo1VyVQMwwxZGB/faZi96oICFYg93cx1Dss/me+02TiGxFxG Ai83UP1z8mR0uSz0TntH44S2GpqUJ/mHSNwjZ5Vpcrf/a6j3EqK0rjM8MUK3jyIhY9o1 uc0Pgb2995KJ6UT3IZGDg0vLYWsfeiOb4EorlptTOKQUHsLL9POIKw+SkuIpyIyfb0MX Murjrd+1tJbq6a/MSflCibD3kZ8buCbfydOazxw7Ahkv94cI6VEEMsUFYF6Qq8LJpP1e KHrQ== 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=L2PKrlKGzH3Aiebxw9TtOhOfHbclR4QDc7+0yHHhX9+nS75GolYbbswetfMPM8ycX+ ymDmyL3St7wfEZM06cio4zWfd/yESKdSCHOoSAmGf5qbCsu1EvrPdRqdOgi94oSojbAU 5t+ChkwEwUU3l9FjHiKRgpgM4UAEkUDiOstXneSBfP1XNc3qd7PK2xrYAk6O1x+09Tkb PAUMFX8moMZSEkCWAkhhDRKQm9SIj6RefIPDNXXbzuHxMBwgag4J0zF3pkNHWt90byDj +2DDYG3s1/QY79JJX+wgyDvyEmmcTq+Ju0gl0X3suXQ9U1YDSGmaJSA7Wp70YJkTwJEf rnmQ== X-Forwarded-Encrypted: i=1; AJvYcCVqEbnKManI77SCrXOXIS9YM8XEYmyr1T20Hq+h2UC3duqWevn9jtG174CBnG0bnnM5fmRZwuSrnJ0=@lists.xenproject.org X-Gm-Message-State: AOJu0YyRZr4t5AgsLGe0RmFOTt08zmN3kYDzzuzOkUX7fneayD9QmOp7 zYKvXAPnmYHwi5Qa7VfU2rhlbtnjs3kmkHd3WCKsCtGXy2DWoY5s 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466590714116601 Content-Type: text/plain; charset="utf-8" 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', )) =20 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 =3D 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 =3D XEN_PVH_X86(ms); + int i; + + /* Create dummy cores. This will indirectly create the APIC MSI window= . */ + xp->cpu =3D g_malloc(sizeof xp->cpu[0] * ms->smp.max_cpus); + for (i =3D 0; i < ms->smp.max_cpus; i++) { + xp->cpu[i] =3D xen_pvh_cpu_new(ms, i); + } +} + +static void xen_pvh_instance_init(Object *obj) +{ + XenPVHMachineState *s =3D XEN_PVH_MACHINE(obj); + + /* Default values. */ + s->cfg.ram_low =3D (MemMapEntry) { 0x0, 0x80000000U }; + s->cfg.ram_high =3D (MemMapEntry) { 0xC000000000ULL, 0x4000000000ULL }; + s->cfg.pci_intx_irq_base =3D 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 =3D XEN_PVH_MACHINE_CLASS(oc); + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->desc =3D "Xen PVH x86 machine"; + mc->default_cpu_type =3D TARGET_DEFAULT_CPU_TYPE; + + /* mc->max_cpus holds the MAX value allowed in the -smp cmd-line opts.= */ + mc->max_cpus =3D HVM_MAX_VCPUS; + + /* We have an implementation specific init to create CPU objects. */ + xpc->init =3D 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 =3D xen_pvh_set_pci_intx_irq; + xpc->set_pci_link_route =3D xen_set_pci_link_route; + + /* List of supported features known to work on PVH x86. */ + xpc->has_pci =3D true; + + xen_pvh_class_setup_common_props(xpc); +} + +static const TypeInfo xen_pvh_x86_machine_type =3D { + .name =3D TYPE_XEN_PVH_X86, + .parent =3D TYPE_XEN_PVH_MACHINE, + .class_init =3D xen_pvh_machine_class_init, + .instance_init =3D xen_pvh_instance_init, + .instance_size =3D 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) --=20 2.43.0 From nobody Sun Nov 24 07:43:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725466584; cv=none; d=zohomail.com; s=zohoarc; b=cBYO9YytW4L5/zhII0yRsr1e2qameVcJ8SbN1ywgfvmjcQ6Tr3jODOGrW5ntaN6o0QPE6t58k9QR8Kq4rSjt43O3gLQHKoO+zgadPjDVfIiLCj1NkD9siKpFXuyjNzSZOuzx6m6ikfZBxIuSPesAqqG8UnOSwLc5UZAoNgJpdZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725466584; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KdxPAmDEdUAtpsJzqv9PT9FKB3N+OoRAOYXGitcO7RQ=; b=bwqnYv1ENwfcgiiul8tUTnm6ECwKYDMhiU4782cMHuLiIKdg/6ojlL0lHAQC7n/9Zw6cDgXQdMWJtfPY4kHr68wTWik68rsVeTBlg7c/ZlAxtbxY45LukBmfE27oGm2B+8qQ/nhwDytZO0KE1J2aJU9+8Ir4YLxo80vBEFXoL5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725466584829272.92297807657735; Wed, 4 Sep 2024 09:16:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.790559.1200449 (Exim 4.92) (envelope-from ) id 1slsfs-00044E-5t; Wed, 04 Sep 2024 16:16:04 +0000 Received: by outflank-mailman (output) from mailman id 790559.1200449; Wed, 04 Sep 2024 16:16:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfr-00041M-Sg; Wed, 04 Sep 2024 16:16:03 +0000 Received: by outflank-mailman (input) for mailman id 790559; Wed, 04 Sep 2024 16:16:02 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1slsfq-0000I6-5u for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 16:16:02 +0000 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [2a00:1450:4864:20::22f]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fa4c4541-6ad8-11ef-a0b3-8be0dac302b0; Wed, 04 Sep 2024 18:16:01 +0200 (CEST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2f50966c448so78902591fa.2 for ; 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) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fa4c4541-6ad8-11ef-a0b3-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725466561; x=1726071361; darn=lists.xenproject.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=mZqr1AUuprYV4st4YKuixFqCftbL1dRsHIQQrkRQijs37s4W3BZtl1/PGhsHlmnsJt Awb0QjNY/BT+KItiWrPYIEVVHXHLo/6oRkgV19IorctcEqkFk37ZnJN+TxmcLg7FdYc6 t9fMTMe1YevdZp+TrWa4aLT1SfJHVlrI5Jm2l9S3fDmUcB08hzS2MpzlF3MIdjqr61jm V/jMbLJOiEp1SvqEKxP3jkSy02wWZjcJuKlpLhwRHEkF3ODkKZ0fEys1oZRbUvzRsP8l ZuIbIKLhSgVLUyFBgxGA6ryhoZ54OAYF6PSQqfS9ZGk60WIjgmu0HP1rBior9cBKds+B UPyQ== 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=IVEiYS8WximjzFeG+O87Hgap66H5YZVoIzngI+QiJpNzl5GeQ40qCS2thv+t3PW8FD 93/etNC9nB5cz3TWcseWNtmeYMUWMycenr2qKWOy8kYBmsnqeyGiv7iLOGLvuXV04GgW +3TP6S7Jym5LM+oJ6APwaKTV0jJf1Zs26SlmvLCBvAUWoAth6L1TmyHG0nq8ZU50sikp 8iEJuqZ7+AOiwPet0CvvwVq8Zx3KFJEEomfYBN6jBQYTjnGToHYkEF2Sg8MtLsrHnGQ2 CK/ex8FNcXMmvTY2sfiaKqB3tMNRbbFrTm3knoEKOr6Tb69lx/URA7kOZ87ET4E4+EEX 9PGA== X-Forwarded-Encrypted: i=1; AJvYcCWVxNb1MhjU2dwz9/Wzd6fAVyEoUVkaFgJP4mOfZcXOP2sHWPOy93DloKFOy/MJJ6bEzxsmX3oQ0kM=@lists.xenproject.org X-Gm-Message-State: AOJu0YzZ0hAYw9AGlbT8R6pnfDpEJP9DDqGf4SZH0HXjG7iYS1CeAEsI iDug2fYBHNxsvrLDpNAy2x6UUEWqoHvpjGsMo7D+DZTuNYeRl0mQ 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) 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 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725466586663116600 Content-Type: text/plain; charset="utf-8" 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 =20 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``) +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +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 controll= er. +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=3Dlibxl-cmd,path=3D/var/run/xen/qmp-libxl-3,serve= r=3Don,wait=3Doff \ + -mon chardev=3Dlibxl-cmd,mode=3Dcontrol \ + -chardev socket,id=3Dlibxenstat-cmd,path=3D/var/run/xen/qmp-libxenst= at-3,server=3Don,wait=3Doff \ + -mon chardev=3Dlibxenstat-cmd,mode=3Dcontrol \ + -nodefaults \ + -no-user-config \ + -xen-attach -name g0 \ + -vnc none \ + -display none \ + -device virtio-net-pci,id=3Dnic0,netdev=3Dnet0,mac=3D00:16:3e:5c:81:= 78 \ + -netdev type=3Dtap,id=3Dnet0,ifname=3Dvif3.0-emu,br=3Dxenbr0,script= =3Dno,downscript=3Dno \ + -smp 4,maxcpus=3D4 \ + -nographic \ + -machine xenpvh,ram-low-base=3D0,ram-low-size=3D2147483648,ram-high-= base=3D4294967296,ram-high-size=3D2147483648,pci-ecam-base=3D824633720832,p= ci-ecam-size=3D268435456,pci-mmio-base=3D4026531840,pci-mmio-size=3D3355443= 2,pci-mmio-high-base=3D824902156288,pci-mmio-high-size=3D68719476736 \ + -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 --=20 2.43.0