From patchwork Mon Mar 10 13:31:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 872205 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp989162wri; Mon, 10 Mar 2025 06:32:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVX0GngG1c8EMKYtq8edLgCluGs4VFIO6pmaxJPonw9VFSvFLyD68Yl71ScbKFf6YrWMxyxxA==@linaro.org X-Google-Smtp-Source: AGHT+IGUtyIo1MAOBrCBUaCm0Rm0Ye3A3HEsL9lHVCbnSPz9KL7/XyQIfdkL3nUf9uh1uk8tgRiv X-Received: by 2002:a05:622a:47ca:b0:476:6599:3e29 with SMTP id d75a77b69052e-47665995bb4mr130279281cf.43.1741613558982; Mon, 10 Mar 2025 06:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741613558; cv=none; d=google.com; s=arc-20240605; b=cLCSv/mizzFN6/x3UVVKyjBU+A/S0qAbIbUvkM3//WdOppXHasIpxAKKEjWjZJxfaN 8qRz6GGQ+mEzErZBGkaiHOqwLLfMcirkXCBn+x9E0913Iaz/Jt6kivRS8sieRotwRT7Y H97Q6R2cFDpMBBIEbcyx79amgClEt7eZIRP6OzJZnmjpoN8D2dh3f5qP4vn4vnWKvPub eMHxTx99nBJhxY4mYvA0LVsKNMnwHVp0urEoWPtl2onRHnd91u9jdaY+ZDIcNbv5mPwz HqqJqUl+AUXhTyKgURwg3n+gvzjnqV9SLbUuOTWe86SXJRRpotpDz4OO1AkMghFBtNvl A3YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QBpElQ4Pqj9BqrwpIU6G26s2REXnfqUkRY3BGOLO2sw=; fh=7oBpPmFW9fdUtr/J3tTpiuzymHxDXi1uiy70GS2q/XQ=; b=Nx2sMJGZhf2CQ7XC3WH58/raiNJlHEh6dfnWbthEkPjLZUAqDjf3LUKdFcCD6NzjGc AVnvd9d5wUV/aZ3dR8IIB1G746TAVPa3g3OzNJZgkaOa5PxZBjdFsAWvYRyYRlytL1IV VtyvKK+mPP3BuRjNzXCB3Gnl6c06CNR23QzTLbbgtvl0Emfgmed+xZp33qjMwqhjZ0eh m3a6u3GlIGzGKaEKtWQ+2hiGRBIlBHJEm2M1wfAaoJgL2qM29m+jo+XTCB1w8ZkjDGie 54TwIKWzhNf7RTHyjJcg7YG9aoA8M0C5zc0HdCu04Zj2DufbVvi8ZgyrelymIHAMnc3W FzoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lJPk63vC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4767a121649si36563891cf.562.2025.03.10.06.32.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Mar 2025 06:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lJPk63vC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang=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_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org In preparation to make @dump-skeys command generic, extract s390_qmp_dump_skeys() out of qmp_dump_skeys(). Signed-off-by: Philippe Mathieu-Daudé 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-keys.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_gfn, S390SKeysState *s390_get_skeys_device(void); +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); 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) } } -void qmp_dump_skeys(const char *filename, Error **errp) +void s390_qmp_dump_skeys(const char *filename, Error **errp) { S390SKeysState *ss = s390_get_skeys_device(); S390SKeysClass *skeyclass = S390_SKEYS_GET_CLASS(ss); @@ -219,6 +219,11 @@ out: fclose(f); } +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 = QEMU_S390_SKEYS(ss); From patchwork Mon Mar 10 13:31:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 872206 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp989269wri; Mon, 10 Mar 2025 06:32:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVWw7bD6kViC4JvusQZr+zUWTSmMjsc3HH9UIpeEq1MFM43Y1JD5cb5GgEJhNjwRWNo3xze3A==@linaro.org X-Google-Smtp-Source: AGHT+IHqSfCsfEsAH9JibqbVAl3NlARncDMvdBMV8tVG1MLQ180TtxN8IrIEC3ZX+FOquqiESpOb X-Received: by 2002:a05:6102:1606:b0:4c2:f972:b699 with SMTP id ada2fe7eead31-4c30a528e2emr6283771137.5.1741613569634; Mon, 10 Mar 2025 06:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741613569; cv=none; d=google.com; s=arc-20240605; b=abpG4q1Oquj1M2EsAr1gS6oYhSF9KQl3uW0/JSWz596hA/S5C18m7Be3RLKs/z8IwM zTTa9b5lmIVf6nxiDeCo9crt94jgCLiuZ8rJAq7SZdqIOjR0eg6uwr0llVDUeOj+QAUo behH77kdIu9MGXzB80wl0pmNRUCX87uAp48maSRR7c+vRH+JHwddKgSSKd/wlOf+mUTP nxr0ShMyY5E0m+6bol9kTvy94CXmRi6n3iq+200jDkJNghom5oOI6b81ZSh19PWp3VbL B12wtDy7o56uVcV+/sJ2ar9xxucpoB3N2fIG/8cUjMGbSm7eJS+ZKGDX5IL3FfdpbBeT X+uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5ZA80JJJqZ8qMbGMd+HaAS4atcLC9IPAT2AkoQ1qeBY=; fh=7oBpPmFW9fdUtr/J3tTpiuzymHxDXi1uiy70GS2q/XQ=; b=jNTq/PExuMf7+eyUYjvVvLWg+GMeUAK4VLUrkNMCWxvhomsrU7CioFpDbJ5KMCjdNa +mVSotIfvinQkV5ze6SyVMxMX2OkIzhgGPMD9mQWOsgsA2pOQDjGDfP4hQnBOGZyPYcv GLrXOJ21at7NEwNoYNd720rW6iDft3MjkpxoFBkL4FerDQhVrJOduGYDxl+fa8lx6hfn jcc9IjCJ1ueHLcMX5Q2xuhuw240lMz2HGsboSuklwDrqHPLaZUu4EUgf6V2TszzOI1IV +jQs3ZVz42XKp+zS1H9fiYDssCbxr8nrkuM29hNkDoyXfaZC4QwnFP/3hxmjMvQBzVSg S4Dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PhjZs/85"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-4c2fbcbf381si2382589137.369.2025.03.10.06.32.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Mar 2025 06:32:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PhjZs/85"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang=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_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Allow generic CPUs to dump the architecture storage keys. Being specific to s390x, it is only implemented there. Signed-off-by: Philippe Mathieu-Daudé 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 attributes. */ 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" bool s390_cpu_has_work(CPUState *cs) { @@ -179,6 +180,7 @@ static const struct SysemuCPUOps s390_sysemu_ops = { .get_phys_page_debug = s390_cpu_get_phys_page_debug, .get_crash_info = s390_cpu_get_crash_info, .write_elf64_note = s390_cpu_write_elf64_note, + .qmp_dump_skeys = s390_qmp_dump_skeys, .legacy_vmsd = &vmstate_s390_cpu, }; From patchwork Mon Mar 10 13:31:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 872207 Delivered-To: patch@linaro.org Received: by 2002:a5d:64ce:0:b0:38f:210b:807b with SMTP id f14csp989308wri; Mon, 10 Mar 2025 06:32:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWsAvb6Z5Xw40gcmC1tZhUNcfzmG1dW/uUWF1gqSikEVw0toMBgykpTts1sLV8JKdNc2yjVhQ==@linaro.org X-Google-Smtp-Source: AGHT+IHgi4dtSwCUFLK4R7yMCAXfMauU6aNJRlvWPMUcNs9N0wm0Dl6TI/gJpb6cITNfvNEjlWbP X-Received: by 2002:a05:6122:911:b0:51f:a02b:45d4 with SMTP id 71dfb90a1353d-523f280eecemr4564030e0c.1.1741613574898; Mon, 10 Mar 2025 06:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741613574; cv=none; d=google.com; s=arc-20240605; b=kYpt9P5Q5j807R5hF3lHgEQ2w9TeVXtL/4xxM0flXDN8zZ2w0BQuFPDq0MYHeVFDRV hTOsMasvKW5A9utME5niQXqiUjmnGXK075CmHwZrzq4C9g/UvrPYfTcuTunn9ieYZQ2Y IFf9nJ4Ky8oQPuu3Nw1FwDe5hT29QpqaO8UT7FVHGzDJTBj8H9eUZ/7DfduWkPUDdHD3 pqnZXzdNqSLu71Wyg2p72WEIlX51SCvrwvVt+1Y4918XahtKmsI2csUNMJKm0uvc7e/4 dO2Il7y3WoCubTohS/6v+J+tPtCEj7LLuN8yBdoCK5QV5DUkkF7YlYKhselF3GyKyDYQ +x3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/gwWwhAuWqbYhYJM2CzOTGOLTxTRCMppZ1Oq+j9Tbsc=; fh=7oBpPmFW9fdUtr/J3tTpiuzymHxDXi1uiy70GS2q/XQ=; b=MUH2guahkG7+wimKLygB00U0aGV1PmglIPrXsgFE9+73fNo+IXyjkbPrHe7gBT87TG pLzL+on0BklpYpsWueuHa2LD+qemp3X7AuXB4ohG9f2ZSbS0ZwzWDGjzdiLUUWcVkFJ+ xFavUrHdo+leCYWxVVeGsunYbcREMuGGz3SH6Y3ZX5CpYs4SlWVt8PrDmXXIfz0dygaA 1hgUC9X1/et4EGM8+m1HHHjv+RmP7+36luQ6//uRnBxJRtcTBPZD913UL1G62Uxr1IFy 2aQtOWFQOnVYz+dSQjd1Ow0pTKNO2tsn8ehr4F04UgSmmkH2zDOkzSXOqtTIo87d6o62 8gNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z77ob94U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 71dfb90a1353d-523d8c83b42si1994681e0c.176.2025.03.10.06.32.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Mar 2025 06:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z77ob94U; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Christian Borntraeger , Ilya Leoshkevich , Pierrick Bouvier , qemu-s390x@nongnu.org, =?utf-8?q?Daniel_P_=2E_Berrang=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_Benn=C3=A9e?= , Anton Johansson , =?utf-8?q?Philippe_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reduce misc-target.json by one target specific command. Signed-off-by: Philippe Mathieu-Daudé 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' } -## -# @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 = qemu_uuid_unparse_strdup(&vms->guid); return info; } + +void qmp_dump_skeys(const char *filename, Error **errp) +{ + CPUState *cpu = 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); } -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 = QEMU_S390_SKEYS(ss);