From nobody Thu Apr 3 11:27:47 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741613559; cv=none; d=zohomail.com; s=zohoarc; b=mqlxOZEVj4/so8a9EjN8oqHGT322avMLiBX7VL5UBWDC9GqfInk9eEirVFXHiMVMXkCF3r3kJsvB9Pz3U1d3uaKh5MPa3cQ7tfrC1BSGyfaZ7LFgdNQrTwZaZLD2NcC1qYmnOWRC9FpJY4Rm/6UphOo0Nd9TsLGazUe4SdypyME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741613559; h=Content-Type: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=QBpElQ4Pqj9BqrwpIU6G26s2REXnfqUkRY3BGOLO2sw=; b=Q3gXFRbm3MmbmyrMpGaiVIFWP0yn3ikw7C7PV7TUT/mZJvzDRcdx1R6SLeFogddVqADh0RvV2FTVP6/PgXGnbsHiu9dLqWYCyi91XQOaKLlSJygxo3wIy2+KHOPOzUU4omouSthGKMo4Lribod5INYTSBAhajRw+pHVaXaxUR1U= 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 1741613559349170.87674694261932; Mon, 10 Mar 2025 06:32:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trdEO-0005Gb-4p; Mon, 10 Mar 2025 09:31:44 -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 1trdEE-0005Ef-FL for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:37 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trdEB-0007Lt-0t for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:34 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43cfba466b2so8396225e9.3 for ; Mon, 10 Mar 2025 06:31:29 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c1031e3sm14690300f8f.82.2025.03.10.06.31.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Mar 2025 06:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741613488; x=1742218288; 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=QBpElQ4Pqj9BqrwpIU6G26s2REXnfqUkRY3BGOLO2sw=; b=lJPk63vCnqA6IIssNNUD87rhuViNPy/h43fxfeusEhokV7DQyFXGPXzApcUAW/NSrR 701AVjCpvluMEZsbAoRl7eZgBLcNmNoWXoQ4u/ZkCRYuMpW5c3tbQjVTJlyC8BrDTAXi 9YEMO2tWgmiSzU0+GLqewa8EL3+LzZFzjuN1Lm26dwEeqWg8/n3gUaDZ1l3Vo03ApzkD TB5/MPJq5EV1nvpxIgS6Bu0IfIbO7zfmX1vow2ZrzwkF/ttvco4e7qz7rejwYIZzX4kX tuZ4wMMMhSF9wM4yM4k45cGZM6DaLtP2KiSPkM9zKQZOXwyJmRRqVES55lF2xew8QcTF bbEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741613488; x=1742218288; 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=QBpElQ4Pqj9BqrwpIU6G26s2REXnfqUkRY3BGOLO2sw=; b=soo9SzB7pE91bQtZyD5wh17ilnv1QMFngGNfU65rIdf7PSN3f20bT72opoIiJv/8y8 9PhE68z0soClWUepGs10M97dnoipQJEgV4SoRRLTfz+cyYPxyipkwD7srsdz5dCiI9p3 m6AnQXFQp4OT/JUaDgZQqiWbaXPChXDwzsvH8SDZj6QXOH7KdMdXSJNbpjFHLQCGU4TO H6HIXr0bPaKT+G+Vzc+joDEaK83YbiRgz+ZBMDM+SrCYg58XVIvHjUZraQTY5t2AZbge /9RkFkeomzjK9tWAx6Gpzvqrbma4jl+EOxjhsBs2gJOkXJw4/EFu7IEbxRbu53xIjRmo sIsQ== X-Gm-Message-State: AOJu0YxqVhEjzN2xniKQM5qedRRtuLrjPkBqkYgnPuYVEk5X0XIjPZgG LEDoaTmoPm7r9vNM80wcgBObnHSdzP7cErG5/R1i5AbNkF1zkSklr/D3uQSX+zEBySA8Y213ko8 D3I0= X-Gm-Gg: ASbGncvTCCkZu4V9WF+EVlEji11KXQDm0KHDT2b4sLO9EnfBUTKeOa1ursVqWCnM26W a3gtQER9USxsSP/dCrS0TDOV2mZs+GhJbyZIFcELHwJ92zcBihyi3zLf/5xQ13EjtjWI3zfrzlV lJP7fMivWyWNLthaDrB7WwdCDFjnpbH7ymhnQVAehzaxpCBM6fxTQbKqJG0w6Mu7L4i9QNLcNgC yub2Eqow3rSiSzVqbsX9iPVURwFCkmPwk1rXzxYxpAGhbtkXRKgKjkbJK7edKwgVukMKNZLCn58 bSAVjtFi9yNs9F+JzGfen2Oyky9rfdMgXsBvFwHlUVqE83VhlbtLcUm4vMUyyAq2jZc0iB2Qu4j 3q1ohkmoJ3F/Y40ev290= X-Google-Smtp-Source: AGHT+IG0uCuQRgyS8qdzFt5CodFi+okPBZR2avXfkOccfNZma/wJCW3RTKYIx/P1pQmbFyuH8FagAA== X-Received: by 2002:a05:600c:354c:b0:43d:94:cff0 with SMTP id 5b1f17b1804b1-43d0094d439mr6442395e9.19.1741613486294; Mon, 10 Mar 2025 06:31:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Halil Pasic , David Hildenbrand , Richard Henderson , Eduardo Habkost , Thomas Huth , Eric Farman , "Dr. David Alan Gilbert" , Yanan Wang , Eric Blake , Zhao Liu , Marcel Apfelbaum , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Anton Johansson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 1/3] hw/s390x: Expose s390_qmp_dump_skeys() prototype Date: Mon, 10 Mar 2025 14:31:16 +0100 Message-ID: <20250310133118.3881-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250310133118.3881-1-philmd@linaro.org> References: <20250310133118.3881-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @linaro.org) X-ZM-MESSAGEID: 1741613561527019100 In preparation to make @dump-skeys command generic, extract s390_qmp_dump_skeys() out of qmp_dump_skeys(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/hw/s390x/storage-keys.h | 1 + hw/s390x/s390-skeys.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-key= s.h index 408d2815d4d..d4c7daae6c1 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -122,6 +122,7 @@ int s390_skeys_set(S390SKeysState *ks, uint64_t start_g= fn, =20 S390SKeysState *s390_get_skeys_device(void); =20 +void s390_qmp_dump_skeys(const char *filename, Error **errp); void hmp_dump_skeys(Monitor *mon, const QDict *qdict); void hmp_info_skeys(Monitor *mon, const QDict *qdict); =20 diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 811d892122b..686c118ebcd 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -142,7 +142,7 @@ void hmp_dump_skeys(Monitor *mon, const QDict *qdict) } } =20 -void qmp_dump_skeys(const char *filename, Error **errp) +void s390_qmp_dump_skeys(const char *filename, Error **errp) { S390SKeysState *ss =3D s390_get_skeys_device(); S390SKeysClass *skeyclass =3D S390_SKEYS_GET_CLASS(ss); @@ -219,6 +219,11 @@ out: fclose(f); } =20 +void qmp_dump_skeys(const char *filename, Error **errp) +{ + s390_qmp_dump_skeys(filename, errp); +} + static bool qemu_s390_skeys_are_enabled(S390SKeysState *ss) { QEMUS390SKeysState *skeys =3D QEMU_S390_SKEYS(ss); --=20 2.47.1 From nobody Thu Apr 3 11:27:47 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741613570; cv=none; d=zohomail.com; s=zohoarc; b=MExJ4h1WSnox18Logml98Sii8OAGmLrKvVRRx2AEAklbjAwvVzVUVzzXv/oZtSeQ65fBGVIDblSibaCOLobct9kTxo9OCCVRwoQiFtF+ERx9v+RGjL7b7dIptYwT/TBkiXJiSR/gHTt6nJmUFobPJ0BHslGYj7ZcJtoYlJZO+Uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741613570; h=Content-Type: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=5ZA80JJJqZ8qMbGMd+HaAS4atcLC9IPAT2AkoQ1qeBY=; b=F1CDjn2nxs0rdeXaKiBGX2QruV4IIdWxbEc2THfwZopUS+GSJZarFkZiCB1EuvfFw7rvg9cC4n/WA6SNwN+6yN4qfJz7VSyAkrgZiNuZWhFnkj4J7EL3PGt4c1vDmJ5MM8RiM6Qb515uIQX6/wn1zziX9SkVsBUIQ8NGrjgfiIw= 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 174161357009944.143413024170854; Mon, 10 Mar 2025 06:32:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trdEV-0005JJ-JP; Mon, 10 Mar 2025 09:31:51 -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 1trdEH-0005F1-21 for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:37 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trdEE-0007MT-DF for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:36 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-43cfe63c592so4134815e9.2 for ; Mon, 10 Mar 2025 06:31:33 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43cfd1be243sm16868955e9.39.2025.03.10.06.31.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Mar 2025 06:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741613492; x=1742218292; 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=5ZA80JJJqZ8qMbGMd+HaAS4atcLC9IPAT2AkoQ1qeBY=; b=PhjZs/85UcSm9w1cIUyItTJHj2H0Q6SVeaqNumO7uV8UVRisTGC35vmB9szhZXF4sf +wWI79vmrN2zSZ9NPTHoFy+QC3BDX088UY8Q4cOAcVZyhTvpopJc1hg4aHfhd07rqXgq 9NLCEKBhEaVMr2kTfYR/1B/9GAJUqA/KJvZCDUzR4OCzAqEmfJtfChJ+xXQmny1ga9lI rdn9hYsMqxhHQscd5VV9fwGrirw9G5GyFIpACkP6mHTvIfi4n8dFAlo8ove/AHP4db0Z orZJsSIJthjHuPlEk2tYcZToxiLdfz77oIEwz4J6Z9VnG+rvbXOiCQCERh6LEPVX+nDw Xfxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741613492; x=1742218292; 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=5ZA80JJJqZ8qMbGMd+HaAS4atcLC9IPAT2AkoQ1qeBY=; b=Nkeu5ib3+YwFmz3/un8YxeZdhMPzs1Ix6pLeHcy0VqTmBt7GFbIs3DVhwQMgZabsZJ M8s63k1isodITLUlyTI8TEzZNOkqitNPcDcr+PoeEhn9zXm8Tuubn8AwWF+enUMgnFcS xSUDVkhlm/lrGD1wuO7K4jThA6s3tSMYF//Mwvyw3dI+UhR5zn2il6c1TL7NfZgs1W/C kHruB00k6+NcVRh4KCv6L0VL/tVjnaK+ArMTc4OGvaemsMKkTfFdaR+yWUEP1sS6yzUk 0w47CIXxHK9uWRAFAoJxbQ/8nAaMOQFspVd0IwgertKk1Eq4M4E/uCxmG9rNWXZnfenh BG5A== X-Gm-Message-State: AOJu0YyMuAa8lD93vcUZ/WTlqqafmScpNLuPS0hJPNZX66uI++g6Avd0 nKTPQNa5r65qdogzSJT3y/rd7vK1q8N1Fl15qjBb4jzDZ4vdpZTHaVNwCmJCVViUOZIkx3lsv6w OCNk= X-Gm-Gg: ASbGncu8r6jqj34pqBSq+r/zCza2lFReajqQwkI3WvtE/pHLntdswdmcXSi7bfQIQfP kk4jwvzLBeV2IuOJLuu63oxvFhP+UdH/9GLmC3P8fBmJErAe6dfl1gXcXhJBLfD61+oAp4c74Ow Ab+Q1IF3TWZUII3m5NugbCALn6jlv0rlv42dKKqtQYxq/ORsI89oCwXvTMl5xzckI2X9WBmVNBs dFIaTRiC5nbUXwvvCErGT+DPsE02+EcRvhna4NKyBzpNmC2VJzSR0Pv7C3BWlG4tgu+6grK3/Es DiWmTOntd7G4xMZ3OwQD4nm7Y8PxpC6usOGiolRqwr1XniltUncQnP0RGKc7VYKk3gxe41OUemq WIxQebPjOefIwHZlJQ7o= X-Google-Smtp-Source: AGHT+IHwnfAi14eQlNFQvoW2jaih94AgWaeLC4GwCbImMTo26x0P8ZkSde6jT1h2ckqrKYrRNv84rg== X-Received: by 2002:a05:600c:4e8e:b0:439:8185:4ad4 with SMTP id 5b1f17b1804b1-43ce097647fmr58861205e9.27.1741613491828; Mon, 10 Mar 2025 06:31:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Halil Pasic , David Hildenbrand , Richard Henderson , Eduardo Habkost , Thomas Huth , Eric Farman , "Dr. David Alan Gilbert" , Yanan Wang , Eric Blake , Zhao Liu , Marcel Apfelbaum , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Anton Johansson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/3] cpus: Introduce SysemuCPUOps::qmp_dump_skeys() callback Date: Mon, 10 Mar 2025 14:31:17 +0100 Message-ID: <20250310133118.3881-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250310133118.3881-1-philmd@linaro.org> References: <20250310133118.3881-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @linaro.org) X-ZM-MESSAGEID: 1741613571198019100 Allow generic CPUs to dump the architecture storage keys. Being specific to s390x, it is only implemented there. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- include/hw/core/sysemu-cpu-ops.h | 6 ++++++ target/s390x/cpu-system.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-= ops.h index 877892373f9..d3534cba65c 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -47,6 +47,12 @@ typedef struct SysemuCPUOps { * a memory access with the specified memory transaction attribu= tes. */ int (*asidx_from_attrs)(CPUState *cpu, MemTxAttrs attrs); + + /** + * @qmp_dump_skeys: Callback to dump guest's storage keys to @filename. + */ + void (*qmp_dump_skeys)(const char *filename, Error **errp); + /** * @get_crash_info: Callback for reporting guest crash information in * GUEST_PANICKED events. diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index 9b380e343c2..ab7bb8d5cf5 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -38,6 +38,7 @@ #include "system/system.h" #include "system/tcg.h" #include "hw/core/sysemu-cpu-ops.h" +#include "hw/s390x/storage-keys.h" =20 bool s390_cpu_has_work(CPUState *cs) { @@ -179,6 +180,7 @@ static const struct SysemuCPUOps s390_sysemu_ops =3D { .get_phys_page_debug =3D s390_cpu_get_phys_page_debug, .get_crash_info =3D s390_cpu_get_crash_info, .write_elf64_note =3D s390_cpu_write_elf64_note, + .qmp_dump_skeys =3D s390_qmp_dump_skeys, .legacy_vmsd =3D &vmstate_s390_cpu, }; =20 --=20 2.47.1 From nobody Thu Apr 3 11:27:47 2025 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741613573; cv=none; d=zohomail.com; s=zohoarc; b=T7UthipgY5N9CqaYRN4fzYCPOKzKU2EjyttIsy12J4bdOvwI/LOnC30wvM/eF8FGwMcm/0IQgeuioXUyWBJ/j8CI+d4IzvheHqp1CEWljmuvu803DzKPy5Lb5YRyT32seVb2olO1kBjmeT0b/fVYDU2e8Km1qsP5RJgks53GxIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741613573; h=Content-Type: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=/gwWwhAuWqbYhYJM2CzOTGOLTxTRCMppZ1Oq+j9Tbsc=; b=XcBZcRLtU5ZBI4mOrjdYSgv4Ph4yfiBIf+p5QMtQV7f4GYWhBuW/rLrwYZHAiXN0R1806KjIT2eh//CIp8Ubk/yoHafv9/0XkVuVRYCMD7jomNcH9ruxzaMb+PpiMhiImTz3lYmS8Gc/XS8zfeB0ivves7mofKNjuuPYuXNZOVE= 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 1741613573979960.8275754877695; Mon, 10 Mar 2025 06:32:53 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1trdEX-0005Ja-NH; Mon, 10 Mar 2025 09:31:53 -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 1trdEN-0005HW-4U for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:44 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1trdEK-0007Nv-LR for qemu-devel@nongnu.org; Mon, 10 Mar 2025 09:31:42 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cebe06e9eso9812325e9.3 for ; Mon, 10 Mar 2025 06:31:40 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3912c0e1476sm14922878f8f.70.2025.03.10.06.31.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Mar 2025 06:31:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741613498; x=1742218298; 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=/gwWwhAuWqbYhYJM2CzOTGOLTxTRCMppZ1Oq+j9Tbsc=; b=z77ob94UxIasnrg1B6VWFwIvcBhYlGqpU9vSZaAyXg1MYnMMMu4dZrg9nFCgS+BPj0 ow3Iuof29yyoVAC3hmpTuNFrR5RiYZjf5GC7Q94Cg8dXVoAxflhx4KRXrqqt1TXgPyQB bwqlbNhr2IcJfz4UXP4zHL1UlXueN6xCm++VRTbpaPzjEarRRlSWEubEN5SBQUb9R531 u5sbBztprlaOeI2VFilz46XgYYzZbeLYUs8j05AmdNY3S2lqlP8XZtjLVeEdp+SXY0D4 BDd9N7RWqrlNsoRbMF+BwbX8t3nNv9XZiP1CwVXCMS4XiRvIOsWpHVTfDPRqf+7cEt1E NESg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741613498; x=1742218298; 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=/gwWwhAuWqbYhYJM2CzOTGOLTxTRCMppZ1Oq+j9Tbsc=; b=kC+bMYk1eu0t4HIMwHPdTVyhur1HD2y8RDLsyV3LS2lpRqwmXuRjNpFsiUFcP0rcxL xcHiIYevrWmzOKAQWQIuj1IG2GiQf/kKfGGJNrWlEcz9T847PO45SuQ8Zn7gJptbmgcH NeHAi+fSabQkLj/66Z1lt0aLcu9z0mgffBjS9/0WuB0plIJfpi8RQGiWgdMCjeGhw8d/ ooJ1/DVhukfkn3f3moh+fVWSqWZ3gD4CLr7TiECLhlfi1QIa+hwb9+VQUVxpXli6CLlC QEK40g1umy1Tj99CWXH4EOvwAhMSjY14NZ3iLaVDdF4Inr9nXcWwjvOB+gwJE87eSpXg NPMQ== X-Gm-Message-State: AOJu0YywbdKD2mpKCcdawaMwD2PKki2t0l4vfN/qttyaTRXc8DytscYn D5yLxkIn29YXQZVJLJlS0P6v/YU149GdU61DDdOpH4JdVmUArRNSp9tX8fOcwiNAJXetokI6V2H diPA= X-Gm-Gg: ASbGncsehSj0tDCe0nvkaMjrCVa9E4/Xj9hRfMCCTdfFKF55Ki+S0jbgtUWoDwTo/MT ngxWKntrkCEqu4zSQULr3OccBaE1+us6thwgkzmXR5TbGBJlplEcbHGzIQaNusF5qaX2fCaRGbi IQnuO+mriH1QHNLxPXV9pUPXcpAK/yO1tLvXD95Y+26NSRznfOb/MzJV+B7zmbSCZjus/c+WFwO e4pBwx9vqi/U/KBNQvSiMJTAY3L1J7p/CIHUSY7chTrh9rqVJY3WuQKgLTlul7/KGsH+h8+Ehem ZM776S7s3I5uPMJJJWDnajZgKqBfZBVL9Lsrc1bX5GEOzKU2wE5jUR64Uz6Gs5uQ1b9+yjAGrmh cTx6n9WDRN1UmskMxAns= X-Google-Smtp-Source: AGHT+IG+1qThTujopH3oS5hjb/iXtkKLkXTJkbpsk2OIfey5iVDRiHVoOptoHe/uqxJRTWnw9tTX3g== X-Received: by 2002:a05:600c:4fc1:b0:43b:cd0d:9466 with SMTP id 5b1f17b1804b1-43c601d9251mr72915935e9.9.1741613496945; Mon, 10 Mar 2025 06:31:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Halil Pasic , David Hildenbrand , Richard Henderson , Eduardo Habkost , Thomas Huth , Eric Farman , "Dr. David Alan Gilbert" , Yanan Wang , Eric Blake , Zhao Liu , Marcel Apfelbaum , Markus Armbruster , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Anton Johansson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/3] qapi/machine: Make @dump-skeys command generic Date: Mon, 10 Mar 2025 14:31:18 +0100 Message-ID: <20250310133118.3881-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250310133118.3881-1-philmd@linaro.org> References: <20250310133118.3881-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @linaro.org) X-ZM-MESSAGEID: 1741613575712019000 Reduce misc-target.json by one target specific command. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- qapi/machine.json | 18 ++++++++++++++++++ qapi/misc-target.json | 19 ------------------- hw/core/machine-qmp-cmds.c | 13 +++++++++++++ hw/s390x/s390-skeys.c | 6 +----- 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index a6b8795b09e..53680bf0998 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1898,3 +1898,21 @@ { 'command': 'x-query-interrupt-controllers', 'returns': 'HumanReadableText', 'features': [ 'unstable' ]} + +## +# @dump-skeys: +# +# Dump guest's storage keys +# +# @filename: the path to the file to dump to +# +# Since: 2.5 +# +# .. qmp-example:: +# +# -> { "execute": "dump-skeys", +# "arguments": { "filename": "/tmp/skeys" } } +# <- { "return": {} } +## +{ 'command': 'dump-skeys', + 'data': { 'filename': 'str' } } diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 8d70bd24d8c..42e4a7417dc 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -274,25 +274,6 @@ 'returns': 'SevAttestationReport', 'if': 'TARGET_I386' } =20 -## -# @dump-skeys: -# -# Dump guest's storage keys -# -# @filename: the path to the file to dump to -# -# Since: 2.5 -# -# .. qmp-example:: -# -# -> { "execute": "dump-skeys", -# "arguments": { "filename": "/tmp/skeys" } } -# <- { "return": {} } -## -{ 'command': 'dump-skeys', - 'data': { 'filename': 'str' }, - 'if': 'TARGET_S390X' } - ## # @GICCapability: # diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3130c5cd456..b9ed0963bb4 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "hw/acpi/vmgenid.h" #include "hw/boards.h" +#include "hw/core/sysemu-cpu-ops.h" #include "hw/intc/intc.h" #include "hw/mem/memory-device.h" #include "qapi/error.h" @@ -406,3 +407,15 @@ GuidInfo *qmp_query_vm_generation_id(Error **errp) info->guid =3D qemu_uuid_unparse_strdup(&vms->guid); return info; } + +void qmp_dump_skeys(const char *filename, Error **errp) +{ + CPUState *cpu =3D first_cpu; /* FIXME */ + + if (!cpu->cc->sysemu_ops->qmp_dump_skeys) { + error_setg(errp, "Storage keys information not available" + " for this architecture"); + return; + } + cpu->cc->sysemu_ops->qmp_dump_skeys(filename, errp); +} diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c index 686c118ebcd..6bd608b5aa3 100644 --- a/hw/s390x/s390-skeys.c +++ b/hw/s390x/s390-skeys.c @@ -15,6 +15,7 @@ #include "hw/qdev-properties.h" #include "hw/s390x/storage-keys.h" #include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/qapi-commands-misc-target.h" #include "qobject/qdict.h" #include "qemu/error-report.h" @@ -219,11 +220,6 @@ out: fclose(f); } =20 -void qmp_dump_skeys(const char *filename, Error **errp) -{ - s390_qmp_dump_skeys(filename, errp); -} - static bool qemu_s390_skeys_are_enabled(S390SKeysState *ss) { QEMUS390SKeysState *skeys =3D QEMU_S390_SKEYS(ss); --=20 2.47.1