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, };