From patchwork Sat Mar 9 19:21:28 2024 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: 779161 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp851978wrt; Sat, 9 Mar 2024 11:24:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWOTzTjd717U1lTgT5bW3hWpAbwio4uFw6oSMYXhwqNUiCYYS3FpTvzuXBwfcq0csktFxnZJJj3eRQPzlIRmhab X-Google-Smtp-Source: AGHT+IGJxmckxb0ErkTquY32outVbd2sESmwCJbfSmkgrXskmkWQDLyborAx4gFJ8xMItDnb+cOT X-Received: by 2002:a05:620a:4c2:b0:788:2f3e:604c with SMTP id 2-20020a05620a04c200b007882f3e604cmr3367187qks.8.1710012297003; Sat, 09 Mar 2024 11:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012296; cv=none; d=google.com; s=arc-20160816; b=qWXMDBDrWcO+btne6YjHlVMeG0OSDfOxTZwvgCC+EOyqNAhbSnMIhzEGp412Qktbd4 9Vdy4v5Y0oFwV2aVLaYOLZ7P9Rlzc/JI6ldM7wnjZVw0w6ovAFEUQMfrz/eCc0doC/dl wC0fFTSmcrWkVP+MeAtJsaHXMd+QdrCKxj/+7dhMcEr+iC/xcaVK00/CtTaDyE2YEcx1 f6G2i2SqOLZ9EiW+/nTXRYAV7OZ+IzYzH9uULcwEOkyzvclAuzu4uw8ACb0dta7QlpaY lO1X4tx6gpJuaoXuJaqwqDsqvmeNG7QZxxB5McZrQYgPnhnvSEnaBTUMDHe5RRSLt0ie 7lKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=AJ+tmUmaxk1VpVXptMjtzEM2Kqe3+MxYTD28YtS2upg=; fh=LatWI0iv3shmjhlZgdI1Q3YwKN/K/wAUD1GWT6tWaCU=; b=bAhnLjyp4D7HJWA7GXlKzvOkrUiYpxZs+WqC/MujM5NEnllNSxJb0AaDpwfmJ3DU3V qBNpSjq4arrktimwiXgPmVbUpOcXOidZoopa5h7F55PUQAB7paL3jktlCCY+3+rf6Xx/ HFq+WvoY80YlqrHeZdAlnbzXOqR83lnS9i/7IV9RxVO+Ys77GmSjMT8tWzGGcwdrFJqv jtZLSGeiPhHer870IMS+gwl6lXVXxXVsVn7PzvhdruV0W0+F7uxI7mJ+4qRGJ/EAh3f2 xXOdzQJCvGuTiJcQiMRzjMjSDOO2qiN1lwJ7vkyecAypdoUcd0CTH/MXBqpBNI0R2bsI KXsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fvCZl1qz; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ee8-20020a05620a800800b00788507bdb3fsi2255999qkb.417.2024.03.09.11.24.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:24:56 -0800 (PST) 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=fvCZl1qz; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2H4-00008M-EC; Sat, 09 Mar 2024 14:22:26 -0500 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 1rj2H2-00007p-P0 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:24 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2H1-0002R1-69 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:24 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a45f257b81fso194791266b.0 for ; Sat, 09 Mar 2024 11:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012141; x=1710616941; 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=AJ+tmUmaxk1VpVXptMjtzEM2Kqe3+MxYTD28YtS2upg=; b=fvCZl1qzhpAzWfi5gSdtuZaioWkP82AO+e2X1JVsKWcbp5Syc3VSbo3NtQzv6XkRFM CG0K4Mv5xVwR4kePOt+oBVAzUfjPFk/Qx52DdJNGEQUaMLbMHW7e349pVTJjlb1O1q0+ eDYpMmn1rdh40T/e1o9CilmGi+80uV47xGcdDrw7bw8EC6/quSvWZBFncK4OY7SGdvYi wjmHtsfV/ZYbXlp2rhHk+5Tnqjb1hLnEb3iONv4GMMQLuc/D5IZCreRA60kJ5Q4Eunc8 VqxWkhRQ4COQP6qB6CgPO8iRybNyv/3a5JJKASycc/5n2UY5FSWDIvy4nzWhW+BdArx9 QPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012141; x=1710616941; 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=AJ+tmUmaxk1VpVXptMjtzEM2Kqe3+MxYTD28YtS2upg=; b=XnlGAGvk5x+QytgnJXNEWpWgR5TokQNVF+hm2DmSdyAfRJsZO5bWfAZ0+tvLhbCwsJ FUIm57PwTpTJzoEOGIreUK/i+W/1sj1QRHU4dRzO0E/cG/DMiEoAE9FiMbSBC+wwOclM Gce8P4A35H9YIgLOBTRGgwTbG4p8fkQwoYLKtD8GQYRd4erK/EfJWNbAIC0W+YS/Q3b+ umWsaI/il/bqtVjtPnAvYcjspnwUJLXAU7vt8DLqfjA6Hq3yfmhTyJewIr9Fa98O4lfZ 2tsMbplyRRy+ZOqYL/N4Lvdnyr+Mw9EyLj9Edm17rbTwoCy+JLmbwWjjdANSlWAvCd1o 1StA== X-Gm-Message-State: AOJu0YzVz21vvA+JZ9JxoT7ZH3eYX9mDjeqvFG2FiZlri3uYManocttk slfCLFFYUm4VJqG+wHqm7tJ4RrZ8kjMCtHr5QbLupnFsGmor81atuML4Jdqn6f4OxFgH6/DjcrX P X-Received: by 2002:a17:907:a4c1:b0:a46:172c:e9cf with SMTP id vq1-20020a170907a4c100b00a46172ce9cfmr223212ejc.61.1710012141400; Sat, 09 Mar 2024 11:22:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id qk2-20020a170906d9c200b00a3fb9f1f10csm1162016ejb.161.2024.03.09.11.22.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 01/43] hw/i386: Rename kvmvapic.c -> vapic.c Date: Sat, 9 Mar 2024 20:21:28 +0100 Message-ID: <20240309192213.23420-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 vAPIC isn't KVM specific, so having its name prefixed 'kvm' is misleading. Rename it simply 'vapic'. Rename the single function prefixed 'kvm'. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230905145159.7898-1-philmd@linaro.org> --- hw/i386/{kvmvapic.c => vapic.c} | 5 ++--- hw/i386/meson.build | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) rename hw/i386/{kvmvapic.c => vapic.c} (99%) diff --git a/hw/i386/kvmvapic.c b/hw/i386/vapic.c similarity index 99% rename from hw/i386/kvmvapic.c rename to hw/i386/vapic.c index 61a65ef2ab..f5b1db7e5f 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/vapic.c @@ -747,8 +747,7 @@ static void do_vapic_enable(CPUState *cs, run_on_cpu_data data) s->state = VAPIC_ACTIVE; } -static void kvmvapic_vm_state_change(void *opaque, bool running, - RunState state) +static void vapic_vm_state_change(void *opaque, bool running, RunState state) { MachineState *ms = MACHINE(qdev_get_machine()); VAPICROMState *s = opaque; @@ -793,7 +792,7 @@ static int vapic_post_load(void *opaque, int version_id) if (!s->vmsentry) { s->vmsentry = - qemu_add_vm_change_state_handler(kvmvapic_vm_state_change, s); + qemu_add_vm_change_state_handler(vapic_vm_state_change, s); } return 0; } diff --git a/hw/i386/meson.build b/hw/i386/meson.build index b9c1ca39cb..d8b70ef3e9 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -1,7 +1,7 @@ i386_ss = ss.source_set() i386_ss.add(files( 'fw_cfg.c', - 'kvmvapic.c', + 'vapic.c', 'e820_memory_layout.c', 'multiboot.c', 'x86.c', From patchwork Sat Mar 9 19:21:31 2024 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: 779159 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp851861wrt; Sat, 9 Mar 2024 11:24:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBfVzBXiycHAaE4K/N1rXtfHJyXZmHebLFYgs4MKjet2aasdEOPqsNDCSVxJMnXAOQC46W449zUBLaGP360bHH X-Google-Smtp-Source: AGHT+IG0Jg0MP1wPnZUzCQmgjH6/oT0vhhif3UVO896XSdRm6gjg7xzUhLTdk4ltKsaxgFWOON8n X-Received: by 2002:a05:6358:75a2:b0:17e:6a4d:777 with SMTP id x34-20020a05635875a200b0017e6a4d0777mr442174rwf.19.1710012265312; Sat, 09 Mar 2024 11:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012265; cv=none; d=google.com; s=arc-20160816; b=FA80SDstRrzeQpziketF8BhsvjdSTWcQSFU0OaznqOwzjlCoeeY58bi33DJlJqV/G7 /3CQ3DDjWbq6x2Cwu6xgoxeaMalwRK88DBF1ZOCAzFJ+y7L39gHEUEVfByK7LHG86zK/ eIYi6Ra/CLbI/O99MkSRPfwLZvha2RTqlE0V8FUhuKhAMTx/9aDxhOO1GGtYRXKfpxfv 1e/LQj8nAhavSGA00wd1RcoK98Qy+ho9Pa0bEwag75n7P7AgQkoxg578tu6rDGEwmF3s kov14IVZ37jqAYPMxBIs5VtJvFv86mcTir7V6Rf8iopKEgNQluxBmBlopNcH+eHPGTul rSmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=tC/kiuQFLzAJIELEDb51aw3s24kLy7eDbWP5W63QeD8=; fh=eBh2TfVQsMfvWEcD4oSPnbZFQ7849nUB5XI1EIxjzHo=; b=IrgUwSmXBiKlqqAsF2wYHZuePnDUwGqEFiShcgpZCdCLvpzWiDs4FzDUBj9dTj5wn+ DD6NikJ35F4c/O6awrackvQ5YJPpHTEJYdURHB3ymHZ1Amc+480qaWWsfj8Y/U7rg+AI 4aeaOFsc1Zjt03fjvK5nlLVVZRJdbZyuT8SfR4DCQ3P95hxb1OuQzpis3tAymUA0AnKh 9uyLZLngZwThLy5wCPjgW3ezjQXi0ZX/GCBWI62j2hygO+0Zp9H6oZR/7lk5DDMelsfK JS3BYu58qwyKOa4y/Ux0DN/vBq5Vh6oA/8W3eqidn82Hz/fxu3Kv6msr6+tFxpcG6GBV N79g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LrTYXNRc; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 11-20020a056214202b00b00690af779541si2082693qvf.254.2024.03.09.11.24.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:24:25 -0800 (PST) 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=LrTYXNRc; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HN-0000H9-Aa; Sat, 09 Mar 2024 14:22:45 -0500 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 1rj2HK-0000G0-W2 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:43 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2HI-0002TO-Sh for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:42 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5683089d4bbso1940853a12.2 for ; Sat, 09 Mar 2024 11:22:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012159; x=1710616959; 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=tC/kiuQFLzAJIELEDb51aw3s24kLy7eDbWP5W63QeD8=; b=LrTYXNRcvDKTSH6APYZi8ttX7KMHjSzNikukosk3P6FDhMnOvmM1U5zpMalSoQCA73 2S8pjOgjs52wILRm1dWrE8ntnCoy+gwqYmaHRUUH8DazlALIz9luec7mumfH3hj5gGWg gQQsMcJYkQ+pFlKOZ3JOQVckH0pvlSMK58EykPCJ/kt5xykZ/OIBX07g1MZm9ooidBBm z9axii3WqIrSjIwsOUwDv8YPtkbB9eJaRGcwdAayNoB8hYryX7BPUYoA22+PYxp6PeCk QwsemhQAwirijWLOB5fFkktJiD8PMGBl7IsiGAkDfHvOVvKJka7g+rcts5KyCViMFFnB vNXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012159; x=1710616959; 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=tC/kiuQFLzAJIELEDb51aw3s24kLy7eDbWP5W63QeD8=; b=FCRRPnOLnE/8fVJPzi7nAqZex91euzM6t6M4Q+2soPYtcib2PPuE1/Pqr+ZVI7y4Nx kyG4SD1V6eJWJVuhN7Ycv5Ebfv+2R/CqZI2fKQ9lGvM0BTpvK1OCsJLyQUDtbNoa286M 7wCBsbYDCRSuMS7X3Bf3khM+qMuRwuAUln8V4Qmxp8wOGszoGkN6h8gDd8wAtjkd7egX R9cXEb79ptPuPywxf+J9qE2eJbnhFbKh4HaGNepngxb7Y4siqz1DbAcuCW5wd6/i7yD3 hr4a6rsM9sI0e3HsqZ/RQrb5WJ8VxaEq7ayTTDradKCFzDFz/rX01ZuZiGoQTV6xh/mp h5xA== X-Gm-Message-State: AOJu0YxUQD5s2aEEJiYs9LnBSr1in7eytjQaLoGZ23fPT7HVB4ztYex8 cwbfZ4FQuYsi9Zoe+pj6dQ5uQjTQpSAWT/82uOkC04Dk0kXwpuF089FX9AQCAqM9/Mdv4t5BmTb W X-Received: by 2002:a50:8717:0:b0:568:1b9f:d6b3 with SMTP id i23-20020a508717000000b005681b9fd6b3mr1590136edb.40.1710012159128; Sat, 09 Mar 2024 11:22:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id a3-20020a50e703000000b005661badcccesm1148488edn.87.2024.03.09.11.22.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , David Hildenbrand , Paolo Bonzini , Peter Xu Subject: [PULL 04/43] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Date: Sat, 9 Mar 2024 20:21:31 +0100 Message-ID: <20240309192213.23420-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 physmem.c doesn't use any declaration from "hw/xen/xen.h", it only requires "sysemu/xen.h" and "system/xen-mapcache.h". Suggested-by: David Woodhouse Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Reviewed-by: David Hildenbrand Message-Id: <20231114143816.71079-5-philmd@linaro.org> --- system/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 3adda08ebf..6e9ed97597 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -35,7 +35,7 @@ #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/boards.h" -#include "hw/xen/xen.h" +#include "sysemu/xen.h" #include "sysemu/kvm.h" #include "sysemu/tcg.h" #include "sysemu/qtest.h" From patchwork Sat Mar 9 19:21:32 2024 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: 779166 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852485wrt; Sat, 9 Mar 2024 11:27:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHNoqcZvgHcm8RjWSNvYepT0N++5o4YQCL0ju+4cGUdh0Wu/IJBIRwD9aE+KWh7D0LCEBR0W7MoXafycFIbt8S X-Google-Smtp-Source: AGHT+IEhXuI3ad379k4hxOcbx7n22Uf0K2HRD4tqRtfC8rJIDOB3uqAByieeu9fBHzYdt7HVEfQC X-Received: by 2002:a05:620a:24d5:b0:788:4e2b:6bb3 with SMTP id m21-20020a05620a24d500b007884e2b6bb3mr3263867qkn.49.1710012444199; Sat, 09 Mar 2024 11:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012444; cv=none; d=google.com; s=arc-20160816; b=gWPtXle8mPhPcvwfkhMdGJTYX0VryG6DBzQuFokxa7TLILBfgDGuvcLsRlZ+JSC3Kf GBKGo6GLTQz7oS3eWHGicOLzN+3uD8NFNqA1+HA8Tv9LT8k1b/ww1QYFfX+AG2nLx/iZ +Eq38QnNoARhwo1YR1A8pZ1DLuNYrFiM4Na97LkytPwHek7GRrTeuXgwvlYLiVw1tUf8 jJfIgAvDjTfBcHEqIKgaKe/8pS/RCCh1X/0oISwDO/HZq5S9UzkevQsu81hPDBDVhip2 vyQStA/+X+zbBVO03oaNX9AB1SEf3+6Cwnqo0M6h1VFkJpllLTqLQ5+Aptz2vsbZIgkD ZSPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=dvPLYlBQAWmf1NvUY3LgRzjhJOxAzzfQLYDmKAk6+Eg=; fh=bkzkd4r6rEMwxE0ig+OskyIqeUNl04XUS5InnUSpY4I=; b=tFzD8CEMj4iGLeDRPDAnB4jE7zNHT3sn8ao+v10nIkgDMmKyERo/p7jxjonaG6YmNx DcPIc8fGklB3Rk8vBbTMx1a1LcGXhJpg+LYrAoHEvgqNlZdNaIG81gmeeabDWzWXn+MM Ksnn4BVChB1PBq2SPMhnv/OU4AVMwK4KbqmQwudYQNcBBbegjhsfWXfoeS3lrDDWxVLZ jMBobb3ZnzcrEFRxUna5qS/gM5qjmJuFI5pVfj7UqJe4ECV7Ev3h4LoL4J+Pk9nERi4g +E56pnVVQnO5POQe7HjFH8fPxFOxwoxxYYmDk6CdLg4iHY8mijaGVln3VRMaszv+BeCo RzXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uDPoWynI; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id wj11-20020a05620a574b00b007883bd44cf9si2037649qkn.501.2024.03.09.11.27.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:27:24 -0800 (PST) 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=uDPoWynI; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2HT-0000JL-5n; Sat, 09 Mar 2024 14:22:51 -0500 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 1rj2HR-0000IJ-Pp for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:49 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2HO-0002UO-Nw for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:22:49 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a3122b70439so407739366b.3 for ; Sat, 09 Mar 2024 11:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012165; x=1710616965; 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=dvPLYlBQAWmf1NvUY3LgRzjhJOxAzzfQLYDmKAk6+Eg=; b=uDPoWynIu2dvzNt3Ckd9UUX7TWwWMjKS5raMiqoWEz+PbBQJhFDo7WwtXUI6CdYlt8 gZ39MX/Yvedvd8FgIbGYtlt7KxB8Z0uV7I1pph3F4mv1Tx3lNwZmgO7NLSG0L5l9y6dj 6x+VMRCRdD3Ew7kx9Zll3o3qS2qtalPXpu5kD8e10HuGg/tgdPpYLIyTdDEKdEi4DBIg nB50eprbzaaIQp5tpddjTOpJxveydBA0zsJqstwSbfMq2SONQ0HZN+/7c6FyWNlWy50P mNqfmIFp+hOzPSEuqdPPPUy/qZ8aqmZ/B2WUhEmO65Z+vZxduzgjS9NWoKhLxSTgaYoy WONA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012165; x=1710616965; 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=dvPLYlBQAWmf1NvUY3LgRzjhJOxAzzfQLYDmKAk6+Eg=; b=aDPNRI91dKi/6gjiT0p+gJJsxLnQ0TEbVtVLKY7qfZXHGhy3fumOKBSoRJOA/IlaUS lhz5es16XDrQqz9hFZ/Ukwe0R3ODl+Qy0Bi+o3i+cOyrAF7pVo81eI/++IOE06UWzENs smf9vfxrDUMW9J5n9YpwLpl+3Go6be5sq9rRLgRlD4sV5N0LoS7AqaRMw++jeOl9JUPv ViL83s1bdfiJiytYuM1yjKsMlyzn3l5XSlU+VfIql7zMMKBizXgv9d06eK6a004LFDlR 5jTh8mo+RVdLFjBSCgFOqOwsqAhbNbBpxNginGA8Btozpsl/08xEV+4+u8VHzzIN9FGU Mu3g== X-Gm-Message-State: AOJu0YyHDNQtbQ0s1tGLvi0HksoCI5nrILKcdChuizB9bZ5LLtQzXUYk tMYDOqS5vKCdQfbhJyg6xlhoIrr6eTdOBCu3Nd3n0zzd8jLw7Lca0uBrF+3TRY4OjvxDN8p/0R+ 8 X-Received: by 2002:a17:906:c2d2:b0:a43:f22e:57a6 with SMTP id ch18-20020a170906c2d200b00a43f22e57a6mr1137454ejb.67.1710012164856; Sat, 09 Mar 2024 11:22:44 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id o23-20020a1709062e9700b00a44cf710cc3sm1170300eji.182.2024.03.09.11.22.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:22:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , David Woodhouse , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 05/43] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen Date: Sat, 9 Mar 2024 20:21:32 +0100 Message-ID: <20240309192213.23420-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 Similarly to the restriction in hw/pci/msix.c (see commit e1e4bf2252 "msix: fix msix_vector_masked"), restrict the xen_is_pirq_msi() call in msi_is_masked() to Xen. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Woodhouse Message-Id: <20231114143816.71079-7-philmd@linaro.org> --- hw/pci/msi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 041b0bdbec..8104ac1d91 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -23,6 +23,7 @@ #include "hw/xen/xen.h" #include "qemu/range.h" #include "qapi/error.h" +#include "sysemu/xen.h" #include "hw/i386/kvm/xen_evtchn.h" @@ -308,7 +309,7 @@ bool msi_is_masked(const PCIDevice *dev, unsigned int vector) } data = pci_get_word(dev->config + msi_data_off(dev, msi64bit)); - if (xen_is_pirq_msi(data)) { + if (xen_enabled() && xen_is_pirq_msi(data)) { return false; } From patchwork Sat Mar 9 19:21:43 2024 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: 779160 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp851874wrt; Sat, 9 Mar 2024 11:24:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWh39xdPc5BqroNEWwGUlBSa5LJqmuvTRxvy1ISMrpKKKsRJua25tnsqzs+bUaZthZWIcSeUrQJRQ8/JZHKAFBI X-Google-Smtp-Source: AGHT+IHpZD/U043E66bvEuFtXLFPjNf96LLbnagPN/IJVXF0cJZsAhwRiyVFgEM6xTS/2fS7zlm1 X-Received: by 2002:a05:620a:22c5:b0:788:2ec8:448a with SMTP id o5-20020a05620a22c500b007882ec8448amr2636523qki.69.1710012269561; Sat, 09 Mar 2024 11:24:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012269; cv=none; d=google.com; s=arc-20160816; b=y5mSxRf515RsMN3MLg8gdopggnoTi4DhHUhiMQKEGUvzrcFH50niPrrPCepN+CEGcm BzYlvWaMo569ZZ4kRwsL36cuXE0ewzJng+pqeSq3H3dCveAU/wgKzrWEouCU1nS7uOr3 FzfL+5NjkV7ckHERiMVuTYF1ouOqPIC9qN4wQecONBb6boPM/h5FzwTwzVYBIARB/C5z p0eHa/iGKg2scmQCpTE7HicHvgXZWcyWZsCV2mu2qfdrlbPEm5DKLFmdpTTnqY/UM5UO w//pZtM/3QdmCxTiX/pK/Gx2GBZfEvEfi0Yhx58cZjDUyjO+wDLyAA3RZv8VqBu1EdR2 hS4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=0qhkX9N0f7mv4U6Enm7PREVuXkmrXKzBrsiRapOf0sE=; fh=z7PvG37Pc5xdl5EeicY7lYGVvN3N90273hJi7zlgas8=; b=sjBNgqzzlQ68+YKGvABKHAQ6ARROy0dh12LpYpOBUFbjJpEqdrQIcmU223p04Cbxry SlL42zX3/fQ5Fglrv+aR1kWjzwrcIDYpFNohy7mtBhv6M2YagmlYOk8/40ZNzLnsXSfj LVqocnQAnwQMTsFSQ8qtOjQ3KjMKfFx/ZFB2isufb+Zm5O9Yq35tlGN0ZDvINCLuJ7ga 35nY7ZuNfM/vdkGhqh8NFG3HZY3RUbgTQW3X3FX/tBsJWbpzA71IVjgzq5n/EWblCBcQ 8U+2y/SPrzecyr4REKlT7mN7kNOGP4j0KcAAysbgkXuG96ZwEhiDY4l+XCJMbfOKCqto K1Jg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D45f31p6; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h1-20020a05620a244100b007884afd1843si2257392qkn.244.2024.03.09.11.24.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:24:29 -0800 (PST) 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=D45f31p6; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2IY-0001uc-4T; Sat, 09 Mar 2024 14:23:58 -0500 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 1rj2IW-0001tb-WD for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:23:57 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2IU-0002fj-IB for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:23:56 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a45c006ab82so385732766b.3 for ; Sat, 09 Mar 2024 11:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012233; x=1710617033; 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=0qhkX9N0f7mv4U6Enm7PREVuXkmrXKzBrsiRapOf0sE=; b=D45f31p6YZNSPGyEI0JMwiP7W9vLR7q+9eAsn+HmAteLYhMy49YrwCppbmSS+Ik4kb Xq9enhSzrG7H5a1LfkOA5r0oW5dNhXOYwO1bGjkSu3ScXXkFWjdr2bntvDHhqTGobGlI N5eTJ4f49MJ2l2BKEkI2sN3FmoV2XN2cvOwWdvtnT0/hnLpReLwK0JBLsBKyHPS6floa dnYHW5JJKP2XoPR4pJ6DwtAdU1mmRi75oMhpxwxpkSepGw45x9GQthFbf9lBCLMAxHIT 18T8/IYJy8Nh8q5pjZbY5OWgHqSRMv5TpdDb9GI8vloYRI7hQhTtFDFtKq5EUKg5KDE+ 9KWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012233; x=1710617033; 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=0qhkX9N0f7mv4U6Enm7PREVuXkmrXKzBrsiRapOf0sE=; b=twUggYnfnQHZFBSOQSi8z74EOZTpEQ/VkzmAbzh5edU8YT0ZEKikZVvWxVDdapX/kU 8dSrr8TT0nf5nIKyypKCfHiT7hB9ah0qfENGS0oETf9w1sK1wrDgGmHCfne6htRWvesI XLvjoFWXqB2KN7gPvd8u903/OHECsq7GMaOjhqG0KMmvvfMGYIcuJTu+7DzVP/3zLtf6 m50tQXuYY35Y/dn4l6mB/c0Bd3xT3EVX/pfSyHtQGa5BlKOX2W/pEMRDIEY81NKavyoK EoIHd91M/gdiPvbXBkVnOxvgmRuMWiqtyV21LHwVkIEXbN6nHHUWq9E5e1PIWFqkqxVR ugLw== X-Gm-Message-State: AOJu0Yy6yaZqpAjlY7CnJYI7TjS5VevLiDg2ku5InZD3JxMBoPqK+AIw EKTB4DGEyYcRxkx5QfNkTokMibXRXQf7ASzNVOdQqChmCKmg4b00fSime/+FCNKZpkgby20P+6g P X-Received: by 2002:a17:907:c28a:b0:a43:900a:31c5 with SMTP id tk10-20020a170907c28a00b00a43900a31c5mr1698253ejc.4.1710012232757; Sat, 09 Mar 2024 11:23:52 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id k5-20020a170906578500b00a449ebf3d58sm1178448ejq.85.2024.03.09.11.23.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Stefano Stabellini , Anthony Perard , Paul Durrant , Jason Wang , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , xen-devel@lists.xenproject.org Subject: [PULL 16/43] hw/net/xen_nic: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:43 +0100 Message-ID: <20240309192213.23420-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The xen_netdev_connect() passes @errp to error_prepend(), and its @errp parameter is from xen_device_frontend_changed(). Though its @errp points to @local_err of xen_device_frontend_changed(), to follow the requirement of @errp, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Stefano Stabellini Cc: Anthony Perard Cc: Paul Durrant Cc: Jason Wang Signed-off-by: Zhao Liu Acked-by: Anthony PERARD Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/net/xen_nic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/xen_nic.c b/hw/net/xen_nic.c index 453fdb9819..89487b49ba 100644 --- a/hw/net/xen_nic.c +++ b/hw/net/xen_nic.c @@ -351,6 +351,7 @@ static bool net_event(void *_xendev) static bool xen_netdev_connect(XenDevice *xendev, Error **errp) { + ERRP_GUARD(); XenNetDev *netdev = XEN_NET_DEVICE(xendev); unsigned int port, rx_copy; From patchwork Sat Mar 9 19:21:44 2024 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: 779175 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852974wrt; Sat, 9 Mar 2024 11:29:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbqHWxXTcW1dkKzd/71+S+OQv2FNp8ehY4Z2Syf7q+bCWKKQMzVfAxDh+PKUGC0jUFXqOg1zK8ZYlJoH4nf/vl X-Google-Smtp-Source: AGHT+IH/Qj6WhMkYhkX21gezG6vk6p+mTucv4rYZX6CeY3I0Q/apwOzdcWNKf3CWUC9bwbLg5v3H X-Received: by 2002:a05:6358:468e:b0:17b:5c65:7f99 with SMTP id w14-20020a056358468e00b0017b5c657f99mr3213025rwl.1.1710012579069; Sat, 09 Mar 2024 11:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012579; cv=none; d=google.com; s=arc-20160816; b=m8ORkSysh2IktnKsn1Kp9z+9h6RM4M028hgmAkfyjg5p1/yzng0DYQJpxiKpaHnOkQ K9T1yYU9v+O+9G5Ib/z9q7+6BQRL8VRX9o6ysqpPeGy1hSKK0FhaRHxQAsBfa5b2ExW+ SNu+HX7huqKMe8hEC3A93Ao0YhXORf2ysR0P8cYlh/LXtEwTEtpVR48vKIagOco4Qoi6 lj8TTXsRJqEOyltsk0aq7z/EGkqRz4Kc7w7TxJdIy6XhSb0PNqVw1EH7VOZexme6NogZ 8DJB7biZEoC5aq2GuZdRPIvEarqN3QSUZH+fvTtUT5rLnEcP5wCUP9LWretJ0HQls+1t WJuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=eUfL1w5ZY8ZGsSxKnH4ewPtSTSCallxtJeVJzhKEKHw=; fh=ShCaBC/RVtwi0ImYIFPfb6kLEQngTfmByX86FyahYA4=; b=RAcpiNENIB34TfOwzOG6pmax7rWs8f62I7i9FtenWHQeaYtc8nb/l7SpcqlCFamylJ qdd0n/+jBTq0i7S96A/viC5nORH4D+gmOLUoGLbn8fdPLymDGRQq1bPrDVepmXaSyYbi qR3f7vLfAuYGINRrY3xO0xlIeotolD80MpTE2led658H34qrLPzq73HYce6Bq+xgtoJ2 mpmyk6QI/PiP1P5GKm8aBxp8jjnlj370QY9AuT2eN/J9cSXgEBsn4P4lC/88iojE3G+n o0FmIPVdYPW9lINxwQzr7/fFX+OpzA7uDUWsGq4P2brQ8Q4kvvye9G6HBY7GOdkpfLqF n4jQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=phxrHw2B; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f20-20020a05622a1a1400b0042edd2c7a15si2168268qtb.146.2024.03.09.11.29.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:39 -0800 (PST) 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=phxrHw2B; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ie-0002DI-6b; Sat, 09 Mar 2024 14:24:04 -0500 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 1rj2Ic-0002Ba-Re for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:02 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ia-0002gp-HN for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:02 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5684f95cc9bso25879a12.1 for ; Sat, 09 Mar 2024 11:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012238; x=1710617038; 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=eUfL1w5ZY8ZGsSxKnH4ewPtSTSCallxtJeVJzhKEKHw=; b=phxrHw2BBwh2uFzWHY3uVG2xMA2LfJche52MECwKCXkFyzZZjOGMreejZ3ItqQxILI 4THaEuD/VGoiG+UbSgBcvh9t3H/lv3wYUMLlc+Ajg1XZDLt+XZfBHAwOfnPPffIA8fi+ s8405NdGqj3dF/hnV9qxuGdFKrSPl3FhsNKt6xbeneVHv/ii6yyt137JOC4XjKRcwCP0 L5d5M4hFiyk4VXWZWLKWzyvpDhKr5D83hnWj0DFzqSL1lUqXy4sDE5fghG+36PKakcq0 YiQsxsmg7eWHf+m/ihCmBm537rq3f73VRWAAAbZdJ5CX/kJSlXp5pW0KDnpuaKPQNKRl oCFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012238; x=1710617038; 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=eUfL1w5ZY8ZGsSxKnH4ewPtSTSCallxtJeVJzhKEKHw=; b=cZw12KB2Dk0Va041J+yhGhODXp74iOj3XsklwyX0levlDCacL8Se18UO7PpKdWiYQz 9H1FqKIAlCPp9SkdV50oa2Ff4vUDi/1Jcu7PzIoMJI7Rgg99MIKPX15rrFulLTKBjpkO oY9IhCbFQ+9tsVOASMbwVPApwyAs5HIk3ek4QkwFJtis4Dx+TEOGkMJnxMtkvirvNNgv eGBsEMr+BdCHOmXASticgGrQe7xR4vR9FARPAqvguQSrztixf7cu2OXwbV2sxxr5eJVV PwkxCTjzdAE5obx7uDINLBeMLeoRnaZCzYfjSJcF/d1ofcrKYlfj7C/UCOu3n0KA+YQO PJVA== X-Gm-Message-State: AOJu0Yw72CvWtI6+UjeiTzPX3/UoOIa3I8cingQzTyCtdq5PBFKCD/Hx N+pf+3ocYovxgCH+dzXrBdXM7UeJ84AOmo4ey4eFM7RbhaYdPO3K/E2oSHkMdvZL0sCvrbOmjRF 4 X-Received: by 2002:a50:8ad9:0:b0:566:1952:afc4 with SMTP id k25-20020a508ad9000000b005661952afc4mr3675368edk.6.1710012238657; Sat, 09 Mar 2024 11:23:58 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id et8-20020a056402378800b00566a4dec01fsm1154716edb.11.2024.03.09.11.23.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:23:58 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Elena Ufimtseva , Jagannathan Raman , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 17/43] hw/remote/remote-obj: hw/misc/ivshmem: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:44 +0100 Message-ID: <20240309192213.23420-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The remote_object_set_fd() passes @errp to error_prepend(), and as a PropertyInfo.set method, its @errp is so widely sourced that it is necessary to protect it with ERRP_GUARD(). To avoid the issue like [1] said, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Elena Ufimtseva Cc: Jagannathan Raman Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/remote/remote-obj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/remote/remote-obj.c b/hw/remote/remote-obj.c index 65b6f7cc86..dc27cc8da1 100644 --- a/hw/remote/remote-obj.c +++ b/hw/remote/remote-obj.c @@ -49,6 +49,7 @@ struct RemoteObject { static void remote_object_set_fd(Object *obj, const char *str, Error **errp) { + ERRP_GUARD(); RemoteObject *o = REMOTE_OBJECT(obj); int fd = -1; From patchwork Sat Mar 9 19:21:45 2024 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: 779176 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852975wrt; Sat, 9 Mar 2024 11:29:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWFgLCPHNDKTODsi2VrI+zi+vWznzm3MzEr6/R7lTEGL56LAXrchSFFx7oI9ZHdhygDdSUrUuokk2E9hiIu0lBV X-Google-Smtp-Source: AGHT+IEav/30h4TdFwP4YcY4VYINB3QmaiJrBf2myRRiaTZ9I6vpBlWXwbJgVqQ97mBcCYVACEyT X-Received: by 2002:a05:622a:100f:b0:42e:848a:95ab with SMTP id d15-20020a05622a100f00b0042e848a95abmr4132332qte.55.1710012579283; Sat, 09 Mar 2024 11:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012579; cv=none; d=google.com; s=arc-20160816; b=jWwc+p9EWad6sB+dYB3Cmq2Q5L8aECrCfmXIqLEdDDIjprU9Lt9mNs39AMEQ4z/Qq9 I8G1PbZG94s2a53KDlZuJGNkjg68jErgZAhp0IK6WVME2BR4m4RzhGn2GneZX2dPAuS2 yVpWqTVR2qp//B/WV/QX1HmObqWUh7LoIBZWO+1NeWJVrOSb60z01n36NXn129Zz9cbK FKPWX0xC1FM/wz1h++AUXkX9M12RUAsWGHmFr9Nzk2fPw7IzpVQX+7bJ1aOVn2nqj+XP pz7Juds3LRCWS8Mo3u2H0Vt7yOCywVwYUUrqeVq/vswstfjzqnscjMHhHspxTr13Lq9Y Qhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=w5JHLoxMjL6tDi9iKJsLNg13AWr77+ZJm44MiLunTng=; fh=VVL9S728RflAihtvP55z6aKvYX3tLnO/29oizXZqTzY=; b=lQwhedauFVFHHKtYcgPkphWRAw9euYN/g9vj80a6Pl9p1SGnydoIAEDhjeV+3V53f7 fwBQwfhXtMhBtlVkJSBR/GmpHGXHGCv1dPCTYkLkqpBALFpO1zlnznKYPFx9F3AdiMSy 4+GqG2TECC8jpYa1xOCCR91bE1YVuGmjr1Uv3Rkj6dI3CUTo66suLzmbNO5viMQzxPqU DIOI/VukXydzsnOdprBtfS97ZnLBW7DgQe/zbnbD4ChQRjl6f8WlVjeMXg3/JD0wg5Sj fBzlCqlLoufj8vUoV9dU7RpY4UP/l2nOHZOHPeQuFib8Dz1WZybC80BHNJOnYmtmIzDu AA0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MmdwC1MM; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u38-20020a05622a19a600b0042ed109d771si2168219qtc.308.2024.03.09.11.29.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:39 -0800 (PST) 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=MmdwC1MM; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Is-000388-Q7; Sat, 09 Mar 2024 14:24:18 -0500 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 1rj2Iq-0002wW-OW for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:16 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ig-0002hZ-4y for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:16 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a293f2280c7so503132666b.1 for ; Sat, 09 Mar 2024 11:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012244; x=1710617044; 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=w5JHLoxMjL6tDi9iKJsLNg13AWr77+ZJm44MiLunTng=; b=MmdwC1MMKT6KDmA3Pn+r4RpSuGSI8C7+rM0SgtGR6cwGOvYgZp2MR4UDT/QG/v19mx 3NNYJGQCskDz9cjNexhPl2ZbKvYMocnryyygfxtR7gYNLSgMICUk3DsvaOd5V4uoIPwD tNAUTcC+OzYhaDoVAOqQ1SH+A4TVqfVS4p96/Vr/ubemvSo6I34WHnJkbmPLNy5vNMf4 xyZ1ImbyBR/ZN5o0YQeAaMgVvcWOWQhGmwM1IeWh4QCo2/XuvI5pI5f9enyDThF9E7TQ uagd9fxoRwoGigd2tDvmwMPBVr8/jeW/3cwXes9XLugzwajlR4o0+ibNl8DxXz7LX17a DMlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012244; x=1710617044; 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=w5JHLoxMjL6tDi9iKJsLNg13AWr77+ZJm44MiLunTng=; b=bzFeU5/ZBnjEfqQBWdbEf984Lsr6vfP4oVyF1HLaI7RqjyJiL8RkIkSLew3GlLyJX8 Va+mVysWQrymEJ4X1X4sWBtMJ/R+Me9h7TNyf7S66q0mVkngF11TXNDQ17yYW27NrNnw 5W4XNcEyI1tqCxp+EL847qJvVKFp6WPCwi2rqWFij3IMIM0S4BBbG4vSeMTiiFHu7Rb+ 3B7MwwbbBeDtKtRJqM3uB/ONUIfGFwsiF8aKKefyni9w80SGxCv88xLy59LACpZPuTbb xlndcHJzN3iDoAkfek+NZvAvV2CQCor3XT4uPSUmVXVXQyMQFzLIWhxHVz3J2PIyNdiO jqFg== X-Gm-Message-State: AOJu0YwUdgZpRSDNVCNAyjQCamRvwndPrZnqWXhigBULKe7x/xdWAN8J e4hinR83IzNJn8r6AkisYuxtDUVaEt8WohsjQZO7jDw0uEMuEvs7oTRqZPpAY8qcSHY3xCOtlXT K X-Received: by 2002:a17:906:3984:b0:a44:1f3:e474 with SMTP id h4-20020a170906398400b00a4401f3e474mr1261620eje.23.1710012244545; Sat, 09 Mar 2024 11:24:04 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id w22-20020a1709067c9600b00a45a72fadfcsm1180096ejo.23.2024.03.09.11.24.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Paolo Bonzini , Marcelo Tosatti , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , kvm@vger.kernel.org Subject: [PULL 18/43] target/i386/sev: Fix missing ERRP_GUARD() for error_prepend() Date: Sat, 9 Mar 2024 20:21:45 +0100 Message-ID: <20240309192213.23420-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu As the comment in qapi/error, passing @errp to error_prepend() requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: ... * - It should not be passed to error_prepend(), error_vprepend() or * error_append_hint(), because that doesn't work with &error_fatal. * ERRP_GUARD() lifts these restrictions. * * To use ERRP_GUARD(), add it right at the beginning of the function. * @errp can then be used without worrying about the argument being * NULL or &error_fatal. ERRP_GUARD() could avoid the case when @errp is the pointer of error_fatal, the user can't see this additional information, because exit() happens in error_setg earlier than information is added [1]. The sev_inject_launch_secret() passes @errp to error_prepend(), and as an APIs defined in target/i386/sev.h, it is necessary to protect its @errp with ERRP_GUARD(). To avoid the issue like [1] said, add missing ERRP_GUARD() at the beginning of this function. [1]: Issue description in the commit message of commit ae7c80a7bd73 ("error: New macro ERRP_GUARD()"). Cc: Paolo Bonzini Cc: Marcelo Tosatti Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240229143914.1977550-17-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- target/i386/sev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/i386/sev.c b/target/i386/sev.c index 173de91afe..72930ff0dc 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -1044,6 +1044,7 @@ sev_encrypt_flash(uint8_t *ptr, uint64_t len, Error **errp) int sev_inject_launch_secret(const char *packet_hdr, const char *secret, uint64_t gpa, Error **errp) { + ERRP_GUARD(); struct kvm_sev_launch_secret input; g_autofree guchar *data = NULL, *hdr = NULL; int error, ret = 1; From patchwork Sat Mar 9 19:21:46 2024 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: 779187 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853768wrt; Sat, 9 Mar 2024 11:32:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXkDmqXVAEdmMJWcvj2AwepfZeU+OqmmK0jyW00H0d3vW2gKfathk+whyOc/volpeccYIlvMWjtdeqWfqbMlsFn X-Google-Smtp-Source: AGHT+IHnEHqKE3jTNMkS9xeVWOUSnuIJ587dcBW7Qj7MaJUE3032XshfXfswuDHtNQFFfPBsLEmf X-Received: by 2002:a05:620a:8388:b0:788:49f3:ab57 with SMTP id pb8-20020a05620a838800b0078849f3ab57mr5703876qkn.34.1710012767185; Sat, 09 Mar 2024 11:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012767; cv=none; d=google.com; s=arc-20160816; b=lKGM7Hl3xVLCGZosYtzCG9hqKrHDFNUinVZ8q+qMmxsC0FdRgGqS36sGFG+PsMIi8N oawBZXzxc3Qs6epSGF7t2sj7JBLhHZqO7OFSASxRnn/8nkg2rTh9dEI7iFsBd9gfrOXa 4toBknmVyVkjVDuKRlhhhT+mihZI2gFNKdIBAyvoW8HsyTCUGbM83S8Pjcn0EybN7FoQ uyfF2ddBkNlSRHmF2iVMl0z27IC1OdTOsS7cPwdMf8tlJ4vAHolGud9xm92nNP1og8zr XVzE1qpMZRDCFFQ1USgq5hykWxajiVdSPcjsK3rFKl7ox8/rrlVgS+XBFPCjxgy+lb2K fSCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=qjFrwxdzh9cIFuy3VrLZl1YDUiO+UYomEAH8YyqLi9E=; fh=4pHT5Irqz3+0Ol7nNfZhQ0N19m8YcVxoOWDxMDPBzpU=; b=s3TAi2s8B94/IRmLkCvuhRqekDNA5pwMy8pk7reSda/QLfp55qyjCTw00kTYb+dGJL 2Oy4ipdjGvPDnjT0OOufXwtrMlo+qDBraD0H2xS920wEV2gefih+TsAJObio+yYokpGt no7gqKoPwyjE4twIrcDwmK+gwiIihp4gO9PcL3/oLQvUpTrzQiBZ0Duwm6NS/VodkBtP 8SZyyxt6OEaHKs1iDCUjubcsQoKoWR4BnazN6MGu5Nx1DhoaWR5tc6aBVZncz7I09AOy /5sm6OwiT9O3KPuN4K9mo2d0qbca1G+E48cMnTPQZxz1iawxcWeVBzwfoWlJTLKlcLtB d7Aw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="P7/bU2la"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ea17-20020a05620a489100b00783ee6b5db5si2313264qkb.53.2024.03.09.11.32.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:32:47 -0800 (PST) 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="P7/bU2la"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Iq-0002sX-1c; Sat, 09 Mar 2024 14:24:16 -0500 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 1rj2Io-0002lP-He for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:14 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Im-0002k2-4D for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:14 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5684f95cc9bso26029a12.1 for ; Sat, 09 Mar 2024 11:24:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012250; x=1710617050; 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=qjFrwxdzh9cIFuy3VrLZl1YDUiO+UYomEAH8YyqLi9E=; b=P7/bU2la/osimESifAkLanHeMCSxf8dYX3GeUifgR0pf3pcS7E5MaTlPj7fN3e+wV7 h+tBcnWBLvFVFFmvET8ChI2a+tnW35VTa+/NczjcYTDNset2v2ahJU6fClZrNmrkVU7z zS2S//Eu4+XRRZD49WfZhvNpnGZlEisclAKZm4vQjQx+w3c3KamRt2KAbrw5udzafMjM d05f2FsMifBNjNytjWC5f1ds8JDf8xkJY71/1My2qYsb13WuKd41lIgLzKSwN1pG6MBD cpUsdNKCIYb24Ksl2aogcjdCSwVMg6q03On9Qr93jwHtrdInHxP4yLEm0bcjY6uHy/Li Owfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012250; x=1710617050; 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=qjFrwxdzh9cIFuy3VrLZl1YDUiO+UYomEAH8YyqLi9E=; b=c7Ev/UOtZdZ2ozvBl9ZwGVyBzaqgWnvXxOQ4h89lqL9fKDgHH9lgWpu5/0vzktrLi5 x/rg6KUfXoCKRw53M3/EputaEY0IVUZB5kimZWo5RsAbyu6nUh5+vkAfs1H6WiTu1Ifv SyJtCO8RgZWfWXaf4UJFeNGZeB1D+2+fX+OqV9e5CfH4Rb/XdKrvv1aLVE9CgJHnsosk nYWE5rO5kS5xuhCA/UZJS266lhO4MNhNw5F3BMF1uW66mQjUm7pQn6R35PRy+NGxA8Se DxUUPtjcYKdw+YXy2fnakWtl5o0xOnkcYf4ivDuCO4zkzXZQeKy6sRr25JNKYXCWBRHZ NXRw== X-Gm-Message-State: AOJu0YwMsZY10aAy9r1n+TXWzYPK4Y84+39fTYIk+vfbf0ZPpGIxMfia JavOZbAD36PoKVD6bj6VW1EGLDISUApSCb2SOuFBsaCcXnphU1VYNlYhueG2XjeUkaLeraY4jpK K X-Received: by 2002:a05:6402:5c3:b0:566:cfca:e56f with SMTP id n3-20020a05640205c300b00566cfcae56fmr2549323edx.19.1710012250332; Sat, 09 Mar 2024 11:24:10 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id 9-20020a0564021f4900b00567e27c72c4sm1153365edz.62.2024.03.09.11.24.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 19/43] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Date: Sat, 9 Mar 2024 20:21:46 +0100 Message-ID: <20240309192213.23420-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=philmd@linaro.org; helo=mail-ed1-x52f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 These definitions were removed in commit ea985d235b ("pc_piix: remove pc-i440fx-1.4 up to pc-i440fx-1.7"). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-2-philmd@linaro.org> --- include/hw/i386/pc.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 5065590281..b958023187 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -288,18 +288,6 @@ extern const size_t pc_compat_2_1_len; extern GlobalProperty pc_compat_2_0[]; extern const size_t pc_compat_2_0_len; -extern GlobalProperty pc_compat_1_7[]; -extern const size_t pc_compat_1_7_len; - -extern GlobalProperty pc_compat_1_6[]; -extern const size_t pc_compat_1_6_len; - -extern GlobalProperty pc_compat_1_5[]; -extern const size_t pc_compat_1_5_len; - -extern GlobalProperty pc_compat_1_4[]; -extern const size_t pc_compat_1_4_len; - #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ { \ From patchwork Sat Mar 9 19:21:47 2024 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: 779180 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853382wrt; Sat, 9 Mar 2024 11:31:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHgI3MN+8JCA1SgVHrHJ2Yw4LadUNncZ6DbwzlpZzLZC7/AKGSTd2x4xjPiYGK1zg5WUXtKP6J1jOjqjQAQ3L7 X-Google-Smtp-Source: AGHT+IERgpvoaCTy9OpbOsrm5d/a8qgv+pd02e/g6Fl0z7OM1//UvWQr4FD3mkfSDLEAT9OpzJvv X-Received: by 2002:a0c:cdce:0:b0:690:af37:6fe8 with SMTP id a14-20020a0ccdce000000b00690af376fe8mr4154213qvn.3.1710012673942; Sat, 09 Mar 2024 11:31:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012673; cv=none; d=google.com; s=arc-20160816; b=n9parfGHHPXfLSBEiTRMB3eCsTNA2jjMTUe2RUq/JnTdHvwc0/mpTsHrHQw8+eQyu5 ODh4ZfW2xVC0OJAaxMyEpzRV9PnLr4zVxEt8VN3TwQyK5xD3NbbBC2s9kiqAnydT6TCF obcnNggxSx9vv9tmXpo+ajMsmp8RBMC2c+f8jje+hUHO4x/prly/VN7JBp1yp1Qq0zmI SdlQDoFmgmhYudLQT+tC/0wWUQ0Iwi18ngl4kyzBw9DH+VjS49cR636pAX0jIuVNQ/sG x6uUtL5UOf2LNYF9r2cAEZAfknLJyFGDjZN1ffbKYPz4fa3yJkD9JZ7JYfarLVBMfRi/ oNmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=97WMuYDRb3w8xARFK/GrtRAFlIvridMB6pm6DUjdKys=; fh=pqIcpSQvLI0TvEnunCJLB3VAMKGR97V1bW/lp8VXiv0=; b=Gr9aISWVjqRAtahY6khMHeM2to0VJfs/ExnuI5IvEXEKigGk0xR/c/NeV5iQrtxbO4 I8yogTaniLQkghRs/uFpLn4vSgfrVje+cJy6dn8G8HpKXFDx8dTZkwB0jBV9C6e0+VdC i0CkeRneCzFX+67wnsn1csxMZpqVawbecdcZvt9Hazht8tlHB9VSpaSWUbuOOSMJhG4H zon1RFziV5wJjpJLaZ1N3qe9OsWKjdFoGGIvjxGR/nZTxuCNkoAgyPjhDsqBJrkNDMCv L1Cau+NdQaAs/HdEGdi5iJoxIsVw8XQPDFnrWXdT6vne8kVpkU+Y+RI5XuQW50687YNN HbzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RW1+ZiNn; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r10-20020ad4576a000000b0068fe280f42esi2124832qvx.75.2024.03.09.11.31.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:13 -0800 (PST) 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=RW1+ZiNn; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Iv-0003Rz-Uv; Sat, 09 Mar 2024 14:24:21 -0500 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 1rj2Iu-0003Ki-Hv for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:20 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ir-0002lL-R5 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:20 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a293f2280c7so503146466b.1 for ; Sat, 09 Mar 2024 11:24:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012256; x=1710617056; 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=97WMuYDRb3w8xARFK/GrtRAFlIvridMB6pm6DUjdKys=; b=RW1+ZiNnMgLzrLGBaoUUPSwngxaNdd3W+WXdEhzOXZOWCy+yZcdobHSaXJ+zldWyTS oGaMmb3fGBcRz0r8bZEFWshEt5SaC3h8hCe3P12d6WDYKfm4CmO+DvdYHSxoZCyHxlxh w3QLC/LTMKMwc0nmImY0x6A28KOL49ikbvt7PZYYfNzKQ9Y/jxAFblXggbQnGWMvF18R N1s/58tvUAU0pi4GiOMGpus95CSRR0lH7Vyfg+dtubUjISF+dzPZEHJUAUZXssAhE40o 44v7ffVBpilwvuoRwMnOf2mBdV6ECRduBL1w4aHZFyio1NXPU6CxLgH0MwuHbV+LkGXH mRGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012256; x=1710617056; 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=97WMuYDRb3w8xARFK/GrtRAFlIvridMB6pm6DUjdKys=; b=nyAYjVtqXijPiJC0AqRlthce9uJhPAbhFETSOYSkenhjpoZrr6//6RSXGruvGXY7RY A/T0r8k7Viha1IWcwaNeYIzMoUBS/EvSADkDIfc80iN/IiUdcZT2xVgIhTEAOaCduJ6X ZkXsXoH22Y7n5ezU6yH6t7AMeIzwNbOeT8fRDO41+UpyHhwLgaJP1S7KEUcr/mEf35Nq 4rCFr0G7TyUQsR6lcOo6xC9TMzSeSq0B2cMPjIAfINSqs+X8bpqu7F36TUWV/K+NHGif 4PNNP9Bq2mJU19G5CNJRRxFK9DcdtTSCbLm05Y0gEMzLu5Vl9213qIdj4FFF5cs0zfHC Uykg== X-Gm-Message-State: AOJu0YyvIssTxKA1dX6WiCGyPjfEX+gbm/Y3lE0aAoUqgEQi6JhPuEP4 fg/X0XDKh8a2ejUTyn+QOTJjRG5L4m8XgOSs1wxLYHF0onZP2GSdsZUmCwj/Q9VuF82j9F5aPJC 8 X-Received: by 2002:a17:906:ba87:b0:a45:f262:bc2f with SMTP id cu7-20020a170906ba8700b00a45f262bc2fmr1624704ejd.5.1710012256103; Sat, 09 Mar 2024 11:24:16 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id l23-20020a170906a41700b00a440ec600e3sm1176464ejz.121.2024.03.09.11.24.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Eduardo Habkost Subject: [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str() Date: Sat, 9 Mar 2024 20:21:47 +0100 Message-ID: <20240309192213.23420-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 NotifyVmexitOption_str() is QAPI-generated in "qapi/qapi-types-run-state.h", which "sysemu/runstate.h" already includes. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-3-philmd@linaro.org> --- hw/i386/pc_piix.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e123458bbc..ed777e3d61 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -61,6 +61,7 @@ #include "hw/xen/xen.h" #include "migration/global_state.h" #include "migration/misc.h" +#include "sysemu/runstate.h" #include "sysemu/numa.h" #include "hw/hyperv/vmbus-bridge.h" #include "hw/mem/nvdimm.h" @@ -383,9 +384,6 @@ static const QEnumLookup PCSouthBridgeOption_lookup = { .size = PC_SOUTH_BRIDGE_OPTION_MAX }; -#define NotifyVmexitOption_str(val) \ - qapi_enum_lookup(&NotifyVmexitOption_lookup, (val)) - static int pc_get_south_bridge(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); From patchwork Sat Mar 9 19:21:48 2024 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: 779162 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852208wrt; Sat, 9 Mar 2024 11:26:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhSR6Qxfii3Q2UcVhY3DQkmPF+bIuK16FnOBrFX6tTnCzpaBHXJpnqRptW5wUJ1LKmB9xiARAC1rrrdO0EVeqd X-Google-Smtp-Source: AGHT+IFq+VrGC183q11pOYrYfdRlGKklQKBN6W0t8vWEba/JA/mwCaUt6/igLy65CgiejZ32CsZ3 X-Received: by 2002:a05:620a:222a:b0:788:61ee:7fee with SMTP id n10-20020a05620a222a00b0078861ee7feemr1790146qkh.61.1710012364696; Sat, 09 Mar 2024 11:26:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012364; cv=none; d=google.com; s=arc-20160816; b=Ce4Vx+16jZx/o5Bee9Sxv9ebNLxa9ilzF3S4lSCLdrDLYS5lkGZ8jvH3FUy2grfbK/ lDRNRONKUdCIcAZceecZy1cpHhHYYzsYUl9pjI2X81QoBEDurMGqur6tt/e8AQSgJCQl nLhengrzhTYI5J5YoC8sMf95aMdZd7s964yXiQoTrQzkIqrRvv2P4RIiRzz0NFJkF410 ufXrm7iAxJ3+Cru0WbUDDm6PL1f71uF2xRvbNWpSPFLS1+AoZgxDyBL7D1lXB1vVIqhe fQ0eExHwhs0D3iVJwvoKCBleACQHZNiomhkrhiQEkg+Vjk19BMK0sJaLCXoRsSZhomuS 5pcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=gNfhZGSEMDNFGE0Bt1N9Am3VGUZ7rx8bc74P/nXROpw=; fh=Jhc3wN46nvOzNFh889lkemlbj0uy7xvSsHbSCOiPTII=; b=OGAAdY6TsPCVft5d76qQKh+7nRvMKZgtSPae9LyR0+gxlYPWduFL92SN99XDuR8UKM p4p8GaxNQtZp5G4w9Kd27X0EwHF9Py+vWAr3S3wP8JPH7p8TYwpUwVifHn1m6N8GHxJO RNxBYTQZ6lUwVoRFUE4vrcL9MCSs2VhvjoEGNLzwnA78t8n3PEK1tNkbMt7aqQECS93S a8PjGz2clsAmbCW/dKABL0I05u40x/+Lh3I+Ufikwt2bATsV69p3+oBMpNYOsuvOvENk /jDBQdljDdGkH1XCEMfWfvT66o3yaj/AyprFa9CPPalNjz4uW5JOPHcjdlabTwqlFiTv 0jDQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ne1rZ2Vf; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 12-20020a0562140d6c00b00690083fcda3si2181282qvs.584.2024.03.09.11.26.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:26:04 -0800 (PST) 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=ne1rZ2Vf; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2J2-00040e-PW; Sat, 09 Mar 2024 14:24:28 -0500 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 1rj2J0-0003oT-Re for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:26 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Iy-0002mV-CT for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:26 -0500 Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2d382a78c38so36700091fa.1 for ; Sat, 09 Mar 2024 11:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012262; x=1710617062; 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=gNfhZGSEMDNFGE0Bt1N9Am3VGUZ7rx8bc74P/nXROpw=; b=ne1rZ2Vf3nDTNU1KeRP3pQ0Lt+fHPTUsppkIg+7v1TPYIUOiMcBQXh6XwMaUTYVhVd RMJfoLOozhUJTEGaj+XOBH4Ry/zMU9JYd30J3FLYBWOqOFJNyo6APzniQP8MJtDYnCmE 02+SQsQmgQk69x9Qz7GfydSlp3iZlxgD5SCpSd9ehFL3KKbvtP6Kico/FFA4WjYdIPZg BjX8lQKkKxZUjhsJ1NCAB2+bNrwbcY37axSFYxl66KVESr6oMs5Gc8EOp8SaqZbuV6Nh uJVNBOcP4aFnNkihA3/ejWlspGhk02ondPBcgPvRz8fVfBmzjizdfZZw5WyZApNZDjsx 4vxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012262; x=1710617062; 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=gNfhZGSEMDNFGE0Bt1N9Am3VGUZ7rx8bc74P/nXROpw=; b=Jnz8+X5qauhyNFMItKW4YYZX4zmdutuDqS9ZKcWbAyO7k1+s9iqXPUB/aZNRjENQHW CQA9vdw1ywBTGLelFdR0/SvZc6kYWqzeyWwmeOB+q+2jde2iemJLBO2vXn4slXuA3PdV Tg6UO6QDKI4FU2pqPj7UJDjBDwhc3ndcMpQsMD3BC7lr4SE7+eWUEXfK2A8NM8ZxV2Ok SFMWkdGIPas1LHD1Yj0DKDHqifFp/uAb0S59Vw++FD/4ihqitCStVakngSH/v6vfPk1x yNXwpJehiTYLeYbFKVUKXFSzFfW0l5JwR8JEqrF84rdQRnbd2bxVNkrk4MhnwOtJ2sOZ 5fFA== X-Gm-Message-State: AOJu0Yzu/VwPKZG7OF3qCQPNQLtM4l64znpEnTeAn4+OqBX9gGEuWBAo jQ/LyE4CtHJgHPMXmS01EAR5no4SUhtopZTJ4I3z7+dcePYRxCEknqU6VkWsBtZ4QQSLyRka0e1 8 X-Received: by 2002:ac2:484a:0:b0:513:3741:7357 with SMTP id 10-20020ac2484a000000b0051337417357mr1595051lfy.56.1710012262092; Sat, 09 Mar 2024 11:24:22 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id l6-20020a1709060e0600b00a42ea946917sm1177309eji.130.2024.03.09.11.24.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 21/43] hw/i386/pc: Remove 'host_type' argument from pc_init1() Date: Sat, 9 Mar 2024 20:21:48 +0100 Message-ID: <20240309192213.23420-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=philmd@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 All callers use host_type=TYPE_I440FX_PCI_HOST_BRIDGE. Directly use this definition within pc_init1(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240301185936.95175-4-philmd@linaro.org> --- hw/i386/pc_piix.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index ed777e3d61..e14dce951d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -101,8 +101,7 @@ static void piix_intx_routing_notifier_xen(PCIDevice *dev) } /* PC hardware initialisation */ -static void pc_init1(MachineState *machine, - const char *host_type, const char *pci_type) +static void pc_init1(MachineState *machine, const char *pci_type) { PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); @@ -194,7 +193,7 @@ static void pc_init1(MachineState *machine, memory_region_init(pci_memory, NULL, "pci", UINT64_MAX); rom_memory = pci_memory; - phb = OBJECT(qdev_new(host_type)); + phb = OBJECT(qdev_new(TYPE_I440FX_PCI_HOST_BRIDGE)); object_property_add_child(OBJECT(machine), "i440fx", phb); object_property_set_link(phb, PCI_HOST_PROP_RAM_MEM, OBJECT(ram_memory), &error_fatal); @@ -451,7 +450,7 @@ static void pc_compat_2_0_fn(MachineState *machine) #ifdef CONFIG_ISAPC static void pc_init_isa(MachineState *machine) { - pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, TYPE_I440FX_PCI_DEVICE); + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); } #endif @@ -461,9 +460,7 @@ static void pc_xen_hvm_init_pci(MachineState *machine) const char *pci_type = xen_igd_gfx_pt_enabled() ? TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : TYPE_I440FX_PCI_DEVICE; - pc_init1(machine, - TYPE_I440FX_PCI_HOST_BRIDGE, - pci_type); + pc_init1(machine, pci_type); } static void pc_xen_hvm_init(MachineState *machine) @@ -488,8 +485,7 @@ static void pc_xen_hvm_init(MachineState *machine) if (compat) { \ compat(machine); \ } \ - pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ - TYPE_I440FX_PCI_DEVICE); \ + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) From patchwork Sat Mar 9 19:21:49 2024 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: 779185 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853505wrt; Sat, 9 Mar 2024 11:31:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVEOo8SY1o30Hw5ctOn09ZZF7rHov1yFE8ysMFCx52GyV+HF/3SrP2SKdr/E2XhwCgN8BLzj6Jcx99gG6HPOZu/ X-Google-Smtp-Source: AGHT+IHGr5QmKZnXXlfmkMg318Q0c0/8yZyTM9qLbSu3qBoi8TWb1EOiSuhEqi8XvxDSLBkZiEvQ X-Received: by 2002:a05:6358:7516:b0:17c:2ce0:f76 with SMTP id k22-20020a056358751600b0017c2ce00f76mr3134981rwg.20.1710012703623; Sat, 09 Mar 2024 11:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012703; cv=none; d=google.com; s=arc-20160816; b=fwdfj1sZ6jy4478oZYcVG7T6paP0peAZTibUtW5PawkzUzTsMjYlIQo2x8k1XPYXxU 0GxO9CXsCbYyiWLPBVMVgXN7hVbYaa3B4UoEpj3naeC2sTlcvim8pkBskB2fx7HAmEl0 J6e0mBn7TjL3Y1mfMKp57mpMo3pi0uawKnFPpXFDur93MqMngehwX5+PKePMLBnw5KM8 r4lWN+3B+FWAgTYO5H4+PYCS0nZ+U/TZDVMMhOcVtFdT4+zOST1hs0bqmYjJFueOFB6Y LgiF+dxojv2NeWgtrIcUazS+0MhxFHgw8LJkhGQ9lE5f8NVitoTR6SLQyFhUQwWR/T24 O/Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=+fuJ29vWBRe9UmwN0pN4V44UAyM0aAmIqNcBSmPyHVo=; fh=gqx0n3Ue1h09mayLThXsu3fzIoSeqIrGSk2lXDTLc2Y=; b=ccDEpURs1KnrzPTjUBn46MCcXKOKGZsXdH4UJBL4BK/cbIwNXMmPvLGCZaqpWY+wV+ pP4cDhf3o0GjXM0mLzr3MUIPsX3ddmquRao9aFo/GGT0ce/wwmEE4CsaE6h6h2vCIm7u mOamBSbHxgX/c21xliQUI4KDoVvohnAKZ+diSn5Yt53BqTrDr7GjiFUz9aX1Nl1dwDnN s6LPLwpSsOK7VBpYirznbYD/VR5EK1PAZCNef1ezmpoA2IMuncPZQS6OhKGpq365u6xa QwJudzyv+OZyZz3C9AeOshN6OXZ0Dw/3OLnhcwu9HAjQilYNMNfQMOCtsYLsRz6JyJZ1 FgLg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TQBRYj9o; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f3-20020a05620a20c300b007883f9bb7f8si2081610qka.579.2024.03.09.11.31.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:43 -0800 (PST) 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=TQBRYj9o; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2J8-0004Uk-3Z; Sat, 09 Mar 2024 14:24:34 -0500 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 1rj2J6-0004PJ-FU for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:32 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2J3-0002pN-NL for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:32 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a45ba1f8e89so379418566b.1 for ; Sat, 09 Mar 2024 11:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012268; x=1710617068; 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=+fuJ29vWBRe9UmwN0pN4V44UAyM0aAmIqNcBSmPyHVo=; b=TQBRYj9oVVvJad8rlOOGoPAGnUBtBMrNe/KfipJ2jsfgNFLgJxpMGrdpMZv15cBU66 wjguUt/JuktcOw2K0+vt8zScN+6wSx/NBgZHzKVh3KWtKc75qrERDku+w4XSChZfIO2z bleR5uAlL4jsH5ceFZqO54jUW/jiIWkSiXejrD4rlD4dWsCPAkbZ01yZzxH1uookLpdV Z8P9P417ZNiTMOIYk16VQR+EST5v513AththRotSyLW+rE1SBzpjR3NWje0/IRWVDagI //pd4mf7Mn71K+mKquo3XfOoiATSQJRuBVXzuNdpXs+OtT+x+DDp7g8KjDHjCt8D+pQG TFqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012268; x=1710617068; 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=+fuJ29vWBRe9UmwN0pN4V44UAyM0aAmIqNcBSmPyHVo=; b=vVBqN4H/ReiXN3Qm2rQBB9KclYh0p7SBmO/kW2HSq4UpxmNZMtnzY1F5XMgHzFMWS/ by/vP6kKQgiZSIazJcQC23xDw0JDNB+3si5NGsCJ2L0K6+wlP0Og6IRCqeuv/00mLRMs fKT+od9vCmu0t5F8QgLiWDWAcD3rSnrB31DBIe9WOWwjQe8lSv7JrW/HCPDFjTjem9fa cYhP9TGheZsCux7t3DRwAbu4MGQNJcBc4tvarTnxvuCrOfCM1SOU7U1p+PUguVfSDLKn WZOceVF35YXjYQoVpjjhtF7n8n+2UEXonGg1Z2bIx+Y7qk/T3K2jIIzuRxSXLn0izsjV /h1g== X-Gm-Message-State: AOJu0YyTNsDgCJdUnCYKiFpaJn9V1Sp27gPvgNx3FqRcDJowkzcF7r9y ncBk4aF8/bnY6wnY0b6dglW+FZhq5y/a4FB3hsoIDZFFjkGt9qWlK0IM8JCWSmyMYJXGtrEM65s e X-Received: by 2002:a17:906:52c8:b0:a45:a2cc:eb8d with SMTP id w8-20020a17090652c800b00a45a2cceb8dmr1224240ejn.25.1710012268039; Sat, 09 Mar 2024 11:24:28 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id bk15-20020a170906b0cf00b00a4617dfc36bsm124195ejb.178.2024.03.09.11.24.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Bernhard Beschow , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PULL 22/43] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Date: Sat, 9 Mar 2024 20:21:49 +0100 Message-ID: <20240309192213.23420-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 The "isapc" machine only provides an ISA bus, not a PCI one, and doesn't instanciate any i440FX south bridge. Its machine class defines PCMachineClass::pci_enabled = false, and pc_init1() only uses the pci_type argument when pci_enabled is true. Since for this machine the argument is not used, passing NULL makes more sense. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bernhard Beschow Message-Id: <20240301185936.95175-5-philmd@linaro.org> --- hw/i386/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e14dce951d..319bc4b180 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -450,7 +450,7 @@ static void pc_compat_2_0_fn(MachineState *machine) #ifdef CONFIG_ISAPC static void pc_init_isa(MachineState *machine) { - pc_init1(machine, TYPE_I440FX_PCI_DEVICE); + pc_init1(machine, NULL); } #endif From patchwork Sat Mar 9 19:21:50 2024 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: 779179 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853356wrt; Sat, 9 Mar 2024 11:31:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWulKIXOnehYVs2XTWFhM8IUXpl9tbF5r13KZAWfJOdu150FedXNtRXNJsRRoJlP8/57Y1esa+RNHDWJEFC6zKL X-Google-Smtp-Source: AGHT+IEHkHa9XnnETYAAPlZhEnei0XImvM4t1u471WkO9dQq8WIQBrWYDXNB7PXSLAemfMerrjfp X-Received: by 2002:a05:6870:a70b:b0:21f:2a0:17b8 with SMTP id g11-20020a056870a70b00b0021f02a017b8mr3212408oam.6.1710012669246; Sat, 09 Mar 2024 11:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012669; cv=none; d=google.com; s=arc-20160816; b=uC71lWfOgC9AJMx91NvAFG2cpIDJRAV9/0JknLhQ9lQPxT5fMbrJKUU041zHKVfuTO 94gW3DUdEFIXgSIvk1mBbfLoPgU+vVZVmTcaGzFPOFL6wfVzreZUuSHxiOmg+/kzk49U u7ia52gk2KpvTsL3tZmsV+EtGU8vI5y1fhGLGGk2OhEUrR2pEVYPmDMC7hpVM/ESBpST 9Fozd8ZrmOUJ2F/AxM5VIMGu75ROBrgcY+MzXlo3KX1guQwss5O9tqD3X6dRWC8WlYpl Tqptd5+TPgHkJSrIef9qpt8HzN4oClt9OHJWW0IsTaRPpYZ1qfbO5N7GUwD3FjXuI3jH FkLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=b9ZBcWCorweFf+2JD84jMS2xk8ntDrtFmiyqB/cRtXw=; fh=8MNRPuYIQqjoet53F1eDLmG2QYUsk5ocsWiJSR8fdvY=; b=CqzpV9UoGrD2N06vGslyHAW7N3L6pWLu3D3iYCj1lZlD5SCz5ejBT89xlT976BaYvd HAiUTAEsNprpnFo3Xm8H78zxvd4ftTfMazQnKbdJPyIC6xTELL2znam16XgmTL3GtevB DpCWYvujB/+eJXf8RCKUUqEGyocsdVDUeCTYFfl6CFc2FI0IqW800Q2lPxbH8Q04LiyF 6qqmcoZ3a5r6RxqFdhYVSt3iRtHTCmW618xi0+s0l2/BspGgdAHnkyqgTk5DBkHvDK84 U4aReGxvkWXsP5ck+xgsrG5/SULtvULfbCUm1Tp7Q/GAwxK+5PL0BQy115Cfi/7Z8yhl wzwA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="JrP5/veX"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qo11-20020a056214590b00b0068f7071cd09si2142991qvb.100.2024.03.09.11.31.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:09 -0800 (PST) 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="JrP5/veX"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JD-00056m-OP; Sat, 09 Mar 2024 14:24:39 -0500 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 1rj2JB-0004pU-Mu for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:37 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2J9-0002rw-F9 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:37 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a28a6cef709so272739066b.1 for ; Sat, 09 Mar 2024 11:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012274; x=1710617074; 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=b9ZBcWCorweFf+2JD84jMS2xk8ntDrtFmiyqB/cRtXw=; b=JrP5/veXhnTCbopgrBHIatDR4Kk0YJftX+qGahmc3Ocyr7/S3jvI4RsyTKVmVJzXXh mvVaNYbflIiy0XlwwO3vkttCT/MDByIO9FlndAOqfhsENaqVhVVjVhR67vRWEHXA9tfM ZbQUyDB6d1hemZlBEdZkohNwUbycuWQuOCZnA+1yOuSNU7ucP0j19ZscIOg8+G4NuzTU REkapdV68Fplq6VaElHzFhyWa1PIXdFawAfc4sVl+IMPgVBbOChB/rLpc5mCcLqEneoT rZY3RbntcrnFWL7Vk54NseDG+0/zNgkQ8auTJsHzJ03+T7WeJpjTn6bHDScgJXGTT4Uu GCKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012274; x=1710617074; 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=b9ZBcWCorweFf+2JD84jMS2xk8ntDrtFmiyqB/cRtXw=; b=kvoQmQMTPbNY7QkTLeW/xPCbc90aLmP82actt7vVJsCJsXo+fNvnyZ3OGyV3duZevQ YXGxUuyJ2PcPrBM90LSjPVp42pCqQYzlzrHLomfUOrgoJFlt9eHBUh77ttNEdBrER8+X U68XY6QPhfM7u6YxHdvvvn+MoYr4d11IvuS0z1Jy4/3fB3cn2yrf3R71T4T3AeAocCJR jwwvAllwWC7wOP3tTh3o9V9T86ELub53edSTLWPIR2gkygakZl0vd7N9MtYc1ERL2i+v PfWN8TjFGfRhGDEtC/WVoFY9F2Iz/wOp+ARRR2BgXWPr+2v7R3ivcv77AyjrWYHP+ThV YUzA== X-Gm-Message-State: AOJu0YwJleDyk2QAw5LZQwebxTqFZTUQSmQDpTTSfRIVnZm82emtKELv EnZXejH1wk8IdQ0dxPjpD+YIf3LbucciW8HTQL+RXpcTZYId/Duqo0E4NvUZ3dtx8kGXbuNf0Un W X-Received: by 2002:a17:906:9c8e:b0:a43:b50d:1074 with SMTP id fj14-20020a1709069c8e00b00a43b50d1074mr1601200ejc.23.1710012273937; Sat, 09 Mar 2024 11:24:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id gh16-20020a170906e09000b00a45380dfd09sm1168535ejb.105.2024.03.09.11.24.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bui Quang Minh , =?utf-8?q?Alex_Benn=C3=A9e?= , "Michael S. Tsirkin" Subject: [PULL 23/43] hw/intc/apic: fix memory leak Date: Sat, 9 Mar 2024 20:21:50 +0100 Message-ID: <20240309192213.23420-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Paolo Bonzini deliver_bitmask is allocated on the heap in apic_deliver(), but there are many paths in the function that return before the corresponding g_free() is reached. Fix this by switching to g_autofree and, while at it, also switch to g_new. Do the same in apic_deliver_irq() as well for consistency. Fixes: b5ee0468e9d ("apic: add support for x2APIC mode", 2024-02-14) Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Bui Quang Minh Reviewed-by: Alex Bennée Message-ID: <20240304224133.267640-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/apic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/intc/apic.c b/hw/intc/apic.c index 1d887d66b8..4186c57b34 100644 --- a/hw/intc/apic.c +++ b/hw/intc/apic.c @@ -291,14 +291,13 @@ static void apic_deliver_irq(uint32_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t vector_num, uint8_t trigger_mode) { - uint32_t *deliver_bitmask = g_malloc(max_apic_words * sizeof(uint32_t)); + g_autofree uint32_t *deliver_bitmask = g_new(uint32_t, max_apic_words); trace_apic_deliver_irq(dest, dest_mode, delivery_mode, vector_num, trigger_mode); apic_get_delivery_bitmask(deliver_bitmask, dest, dest_mode); apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, trigger_mode); - g_free(deliver_bitmask); } bool is_x2apic_mode(DeviceState *dev) @@ -662,7 +661,7 @@ static void apic_deliver(DeviceState *dev, uint32_t dest, uint8_t dest_mode, APICCommonState *s = APIC(dev); APICCommonState *apic_iter; uint32_t deliver_bitmask_size = max_apic_words * sizeof(uint32_t); - uint32_t *deliver_bitmask = g_malloc(deliver_bitmask_size); + g_autofree uint32_t *deliver_bitmask = g_new(uint32_t, max_apic_words); uint32_t current_apic_id; if (is_x2apic_mode(dev)) { @@ -708,7 +707,6 @@ static void apic_deliver(DeviceState *dev, uint32_t dest, uint8_t dest_mode, } apic_bus_deliver(deliver_bitmask, delivery_mode, vector_num, trigger_mode); - g_free(deliver_bitmask); } static bool apic_check_pic(APICCommonState *s) From patchwork Sat Mar 9 19:21:51 2024 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: 779188 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853792wrt; Sat, 9 Mar 2024 11:32:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVvopbQxaXv7b9MUL2tT54f/jUF86b7JJ1z57c0j0hWBiyY4tKIJ+90plmJH2Va1ljRbpG90Jey++csW16BCusY X-Google-Smtp-Source: AGHT+IEB41Ax7PjHsLxjB4i6ZvudHabqPU2YF1KPKZL/rgC4yZkwcyrZ/iFphblf/yo3F3NCuKIf X-Received: by 2002:a05:622a:18f:b0:42e:f98f:2fd8 with SMTP id s15-20020a05622a018f00b0042ef98f2fd8mr3346209qtw.21.1710012773666; Sat, 09 Mar 2024 11:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012773; cv=none; d=google.com; s=arc-20160816; b=dlMsGXnzJ23LDCr0SzNWBnMJyvTcBvv2/O4oDTMDECi+9m8yuTP+aC2s0fE+NFz133 q6L3yr+WrP6w+xoWpJjqPOQQcm/omJK3K+s/TrOeTpkmdpTCmdSdxUjKWNUWS0HnlrvB DWYoh3Bc4xy3JFojhLycxnrmdRr8obnaPh14zaCXX4L9Uz+sGGzENXPwjco3Kv0/A6Y2 VmvmKrXTcc4hsNG4COvcjeHWiSXeGlxfy+c0fD3QxPUS/hApqJZen79uJcv4DYE/VpkU 45KlRdu0e3tI+Vodi+Z5hSDDV843m58L957zkgE8JNgLC5lJi/1W2hWo/hHGBvDs2/QK L+aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=D23dj2T324O3GGxalmLgdyenzdMnRbpccgTLg/T9/aw=; fh=w4rXPrIFYX7/WoxnhTFxz23mOlxSvGJZy3PV+mOhmUk=; b=kC2aCSvI1JOlVOM+qMpku6uYhXcOGxz89ujnS7ELTjHH9l2dG6Kw2W+zsL6FI25wl5 pESM1DleytsMSOhbyKiBO6uDTpCuPnfaXK6j0DW4bw/KeUfb0ekwqGA9F/P/dlRtO7qQ 0tMSLluewPFjZ2zZrVIEZQJu6GthegxkwbAdoVi3HVXwjWml7KGJygMR9uRLcLq7dUaH gtfnslwZ8GqDCp7yDxbCYjddyS+Snv6BCxOOloOdFsJkXWRD+YU4p/HbevnNoluzuTeK 5qXYCsD9a8I8Xognbr718whk/4LY661W/NClzQvrUligsg84hJVDCce1n8z5RKNAgO4A MS5w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ERIDBqFz; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m16-20020a05622a055000b0042e7290324esi2210061qtx.677.2024.03.09.11.32.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:32:53 -0800 (PST) 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=ERIDBqFz; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JK-0005WU-2Q; Sat, 09 Mar 2024 14:24:46 -0500 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 1rj2JI-0005VG-Mn for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:44 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JG-0002wM-47 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:44 -0500 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-512f54fc2dbso2841812e87.1 for ; Sat, 09 Mar 2024 11:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012280; x=1710617080; 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=D23dj2T324O3GGxalmLgdyenzdMnRbpccgTLg/T9/aw=; b=ERIDBqFzmZ17pH8SpnAgGNi8hOYLx4icONDj6FjNkH8a9Lu86H+sb5p714/R3MmdMI tTUH/MCx004PSNJ3wsEPn89NsUoV8J/4Sh/boI3gwrhoBqepIm8kZh55/bJ+WzXUB3ra kAR0/XJCG7N+4vOUVvIq4mJ74GmNh7SyGInoY8frLjvAK+SBJloJjBpVhHidlL00fBIJ vw4XZkoXdP5AXC4BO4WeMEoOHqeThtvd8nyY6BWlm+IIEsKqm+89HhIXMJTSm9e9cH+a Nx0FFYvs1LRIVBZzPsr2nrq+yNk4SHW+/91JRl2ldY56z3sY6pVa+6QRc8K+mJyY8aeq ngzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012280; x=1710617080; 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=D23dj2T324O3GGxalmLgdyenzdMnRbpccgTLg/T9/aw=; b=ntDEez+tGl/7z4ft651jjySZary/rgeuo5oOR/7zPKu9ol1WR+IIirkRNBH/+ZNF/v X0zkTD5dU4eTiwvDJoJjJEnMpKsBraLPAtZtfEUYwDvJsNOw2UM/Ag2SZCnIjg1AaOHp 4ZEB2tgwzxoakpqLSSNHblDdTVOFYKpDO88PmJGaJLbX+fxV+vxHwjFQ7r2ySMO6E04s yXwho4Te/nMq1DVQ/LOIeCPkEi4ZEKrn7yf/pqdd72RjdtD8AiceNJDkg9x5VpePTAkj lX4FwlMppS76l7rx0gs2h7mI41dJb/SZ75pqE2f+0x5UfSospROZZRN8gLtL+b7TFONx 0vhA== X-Gm-Message-State: AOJu0YyqL5b6+tKO1AcFoSvpwopsaJaaHwclmC2nIm4F97pLv7eh0fBK ozCyGuHQXAOi53mK5q3iSlW991xDvor4kX4nBLrDdAI/joHCj5iOcZFwBgjboFsq8vGerfCyHZR + X-Received: by 2002:a05:6512:a96:b0:513:1cc7:ae4b with SMTP id m22-20020a0565120a9600b005131cc7ae4bmr2003705lfu.4.1710012280216; Sat, 09 Mar 2024 11:24:40 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id rn16-20020a170906d93000b00a441a7a75b5sm1174678ejb.209.2024.03.09.11.24.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Eric Auger , Zhenzhong Duan , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , "Michael S. Tsirkin" , Eric Blake , Markus Armbruster Subject: [PULL 24/43] qdev: Add a granule_mode property Date: Sat, 9 Mar 2024 20:21:51 +0100 Message-ID: <20240309192213.23420-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=philmd@linaro.org; helo=mail-lf1-x12d.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Eric Auger Introduce a new enum type property allowing to set an IOMMU granule. Values are 4k, 8k, 16k, 64k and host. This latter indicates the vIOMMU granule will match the host page size. A subsequent patch will add such a property to the virtio-iommu device. Signed-off-by: Eric Auger Reviewed-by: Zhenzhong Duan Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240227165730.14099-2-eric.auger@redhat.com> --- qapi/virtio.json | 18 ++++++++++++++++++ include/hw/qdev-properties-system.h | 3 +++ hw/core/qdev-properties-system.c | 14 ++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/qapi/virtio.json b/qapi/virtio.json index a79013fe89..95745fdfd7 100644 --- a/qapi/virtio.json +++ b/qapi/virtio.json @@ -957,3 +957,21 @@ { 'struct': 'DummyVirtioForceArrays', 'data': { 'unused-iothread-vq-mapping': ['IOThreadVirtQueueMapping'] } } + +## +# @GranuleMode: +# +# @4k: granule page size of 4KiB +# +# @8k: granule page size of 8KiB +# +# @16k: granule page size of 16KiB +# +# @64k: granule page size of 64KiB +# +# @host: granule matches the host page size +# +# Since: 9.0 +## +{ 'enum': 'GranuleMode', + 'data': [ '4k', '8k', '16k', '64k', 'host' ] } diff --git a/include/hw/qdev-properties-system.h b/include/hw/qdev-properties-system.h index 06c359c190..626be87dd3 100644 --- a/include/hw/qdev-properties-system.h +++ b/include/hw/qdev-properties-system.h @@ -8,6 +8,7 @@ extern const PropertyInfo qdev_prop_macaddr; extern const PropertyInfo qdev_prop_reserved_region; extern const PropertyInfo qdev_prop_multifd_compression; extern const PropertyInfo qdev_prop_mig_mode; +extern const PropertyInfo qdev_prop_granule_mode; extern const PropertyInfo qdev_prop_losttickpolicy; extern const PropertyInfo qdev_prop_blockdev_on_error; extern const PropertyInfo qdev_prop_bios_chs_trans; @@ -47,6 +48,8 @@ extern const PropertyInfo qdev_prop_iothread_vq_mapping_list; #define DEFINE_PROP_MIG_MODE(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_mig_mode, \ MigMode) +#define DEFINE_PROP_GRANULE_MODE(_n, _s, _f, _d) \ + DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_granule_mode, GranuleMode) #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \ DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \ LostTickPolicy) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 1a396521d5..b45e90edb2 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -679,6 +679,20 @@ const PropertyInfo qdev_prop_mig_mode = { .set_default_value = qdev_propinfo_set_default_value_enum, }; +/* --- GranuleMode --- */ + +QEMU_BUILD_BUG_ON(sizeof(GranuleMode) != sizeof(int)); + +const PropertyInfo qdev_prop_granule_mode = { + .name = "GranuleMode", + .description = "granule_mode values, " + "4k, 8k, 16k, 64k, host", + .enum_table = &GranuleMode_lookup, + .get = qdev_propinfo_get_enum, + .set = qdev_propinfo_set_enum, + .set_default_value = qdev_propinfo_set_default_value_enum, +}; + /* --- Reserved Region --- */ /* From patchwork Sat Mar 9 19:21:52 2024 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: 779168 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852556wrt; Sat, 9 Mar 2024 11:27:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcyIwHuX7Am+KAdc5vMh+qCIin9/A744yA57oHxr/RvQ+s7JB28pP+fuDF+8t9Q1fJ6ykJRinUVpdvi/RqaPIE X-Google-Smtp-Source: AGHT+IHsqVFHtlrslBbsUWzMA5h+kgl16u5jFOdUVbp3wB9GEjgWTXXQFcBTBqKd3D5lpWb5hDUk X-Received: by 2002:a05:6870:55d0:b0:21e:9aa5:f3f7 with SMTP id qk16-20020a05687055d000b0021e9aa5f3f7mr2809704oac.58.1710012463476; Sat, 09 Mar 2024 11:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012463; cv=none; d=google.com; s=arc-20160816; b=pfpeIWTHf5QyFuNKLoyrtKWHQ6ZHYHY2P/CRu/CbiJpt4WLVrndgdAUhoE0jM/TzM5 1kHXgrsvp3D06r+NE5Ry/C0AF3soL+ho+LWyp7j6Xs7MSb/NXAFkBEP9VgkBYih8meyo aOO9YlwaaBnjSq5E/2ZGD6XJPBRbX+4bqvtvbUWccqs+glRFDnb3oGTtlkKK9CsyrKPp NXa45obTctx6NneapGjHQHUQpVzup0avhdJZZcpEuXt80dZd6OMtn+/XgTph7MqDfToM G8yRE96X0fBJWHY7Q8rPi3mrMjnq5U96XMMPUVX9rjH0nzr8liXC1CSZ9WYfa9mD8KA8 ZJow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=8IXK0wenZmYfT6yBITIHGYESwGfPru4qC6kLvjxG9yg=; fh=Cr15mewC4Uv7+9p0lDRJ6E6UWai1I4BI1QKNEe/gga4=; b=C2312Uz0VoxdaU7TfjAXGpFkneUQYe3jkxzd8bOVtgAMr8m/LYl0/+1ArS20cYkaGX 6/x6hsfTUcsJx1tS5dEfHuzW2NH4kIokk5wFAaJvW7sJC/MX+Rk6+C5T0WIczHl5YPDi 9z61TKmhtm6EEJ0BLHufV24htgk5o43kW5vCIXR/ZnL/Kp55yHWoi8tGOVDL0XOdmT9S J5GMhDvfnXeU4HZbZ1qOWuaZDqf6Pa3fIUI5ITnHoPiQ5u9+lrmLSX/t7dad0Gj4AFIQ SMXpNzcaB4UWuyJeVNn39wS0LECtNPDLH0HBkXdFbqnUWsU6L6RHx/Q9VMsqhKyrniG5 mSqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TRpMwXKF; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 8-20020ad45b88000000b006903c8455a6si2016872qvp.440.2024.03.09.11.27.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:27:43 -0800 (PST) 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=TRpMwXKF; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2JP-0005wh-Hf; Sat, 09 Mar 2024 14:24:51 -0500 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 1rj2JN-0005mI-Ep for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:49 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JL-00030L-NO for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:49 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a4467d570cdso222999866b.3 for ; Sat, 09 Mar 2024 11:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012286; x=1710617086; 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=8IXK0wenZmYfT6yBITIHGYESwGfPru4qC6kLvjxG9yg=; b=TRpMwXKF63pdPAvGMgc6ixM4eoIBkr6yoc4X6K1oEkSpy9Wxpw4JPI+kljWmF0wg9D JE9PEE4DVSgebju7pEz34rvWN8LDjE6Tm8SYgT2BVCFRVZ2cTLc2/alKPlBFtEvr/csk 8GYG7NWZQwjgkGEseMrljxcEEbdVltS3/Ztk8VOZQZWAiM+FuNCcQ1Hh5OBGrXZ+VCDh sqUzjSBMrV25pyBviNeemAv0vw2EICEWfXOlAYAEQBWUxP+CvUms5441fmU2yYJ1jLUY GQSknB36f5mXe6W7Npw/Ei3aGNQjsbVgEQYPmnpH9/ksumQlzpavmapwQvXyfbkpX5B9 T5/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012286; x=1710617086; 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=8IXK0wenZmYfT6yBITIHGYESwGfPru4qC6kLvjxG9yg=; b=VU4fD9WTDwr5xjeufF6VM1BlpyRQUzh3bkm57T7lr5IljdfhWXr8Mzmdo8ss91cuOg KyZmdvr3mNddIyEHILWkG0J0DdVYxoAkOSAATsc2N7p43BcvaryHvEvDvdMW6wDKckpA SjdsB61SiSWbjdma5GoYREBSGwW2bkKAncF/OJd+0qJsoaI7i2v7u2uw3Eq4YE+yvZRX xocKhk8SKi92Ai8n7ablPrJh/gbdXizz+PLh7DCkjnULO7yrLChYGVOwunILp5YZMDOE 5TpwkQc0L4FosSsaeJgtf8rISlxBHO3J4Je6SWJhMn42LF8sb77/dZyN7iK/473ShEJL TVPA== X-Gm-Message-State: AOJu0YwiztgXDDydi0PxgXmKgEdlhkgTKJX1m+7UbsLOM5cNPxgeeL3q Oda6h63rry9kowsQL5lmrEss1naBAc/kCL0QdSwgCiVZ7kRzi1X4s+IjlBr1ldabTCRPE4gXNl4 n X-Received: by 2002:a17:906:d0c5:b0:a45:110e:568f with SMTP id bq5-20020a170906d0c500b00a45110e568fmr1452152ejb.37.1710012286153; Sat, 09 Mar 2024 11:24:46 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id kq17-20020a170906abd100b00a40f7ed6cb9sm1173609ejb.4.2024.03.09.11.24.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, BALATON Zoltan , "Dr . David Alan Gilbert" , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost Subject: [PULL 25/43] hmp: Add option to info qtree to omit details Date: Sat, 9 Mar 2024 20:21:52 +0100 Message-ID: <20240309192213.23420-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=philmd@linaro.org; helo=mail-ej1-x62a.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: BALATON Zoltan The output of info qtree monitor command is very long. Add an option to print a brief overview omitting all the details. Signed-off-by: BALATON Zoltan Reviewed-by: Dr. David Alan Gilbert Message-ID: <20240307183812.0105D4E6004@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé --- system/qdev-monitor.c | 27 +++++++++++++++------------ hmp-commands-info.hx | 6 +++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index a13db763e5..ad91e74181 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -744,7 +744,6 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp) } #define qdev_printf(fmt, ...) monitor_printf(mon, "%*s" fmt, indent, "", ## __VA_ARGS__) -static void qbus_print(Monitor *mon, BusState *bus, int indent); static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, int indent) @@ -784,13 +783,9 @@ static void bus_print_dev(BusState *bus, Monitor *mon, DeviceState *dev, int ind static void qdev_print(Monitor *mon, DeviceState *dev, int indent) { ObjectClass *class; - BusState *child; NamedGPIOList *ngl; NamedClockList *ncl; - qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)), - dev->id ? dev->id : ""); - indent += 2; QLIST_FOREACH(ngl, &dev->gpios, node) { if (ngl->num_in) { qdev_printf("gpio-in \"%s\" %d\n", ngl->name ? ngl->name : "", @@ -814,12 +809,9 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent) class = object_class_get_parent(class); } while (class != object_class_by_name(TYPE_DEVICE)); bus_print_dev(dev->parent_bus, mon, dev, indent); - QLIST_FOREACH(child, &dev->child_bus, sibling) { - qbus_print(mon, child, indent); - } } -static void qbus_print(Monitor *mon, BusState *bus, int indent) +static void qbus_print(Monitor *mon, BusState *bus, int indent, bool details) { BusChild *kid; @@ -827,16 +819,27 @@ static void qbus_print(Monitor *mon, BusState *bus, int indent) indent += 2; qdev_printf("type %s\n", object_get_typename(OBJECT(bus))); QTAILQ_FOREACH(kid, &bus->children, sibling) { + BusState *child_bus; DeviceState *dev = kid->child; - qdev_print(mon, dev, indent); + qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)), + dev->id ? dev->id : ""); + if (details) { + qdev_print(mon, dev, indent + 2); + } + QLIST_FOREACH(child_bus, &dev->child_bus, sibling) { + qbus_print(mon, child_bus, indent + 2, details); + } } } #undef qdev_printf void hmp_info_qtree(Monitor *mon, const QDict *qdict) { - if (sysbus_get_default()) - qbus_print(mon, sysbus_get_default(), 0); + bool details = !qdict_get_try_bool(qdict, "brief", false); + + if (sysbus_get_default()) { + qbus_print(mon, sysbus_get_default(), 0, details); + } } void hmp_info_qdm(Monitor *mon, const QDict *qdict) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index da120f82a3..ad1b1306e3 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -540,9 +540,9 @@ ERST { .name = "qtree", - .args_type = "", - .params = "", - .help = "show device tree", + .args_type = "brief:-b", + .params = "[-b]", + .help = "show device tree (-b: brief, omit properties)", .cmd = hmp_info_qtree, }, From patchwork Sat Mar 9 19:21:53 2024 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: 779164 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852333wrt; Sat, 9 Mar 2024 11:26:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBdunXx7X1K1o65eeexyRAwmPORPFbsqQCDpj8mfGd+SFm8yGbgj5bsSq34+7dev0tBOZVQu9ib3eHn/YDH8w0 X-Google-Smtp-Source: AGHT+IHbiJevNcrXvBKrue2m9BoekQU4DfKtK2RiZcu0RbZFn5QoV+n3+eCxjZF/H0zs/cLE7oHg X-Received: by 2002:a0c:c24a:0:b0:68c:92ca:fec5 with SMTP id w10-20020a0cc24a000000b0068c92cafec5mr2597159qvh.51.1710012403856; Sat, 09 Mar 2024 11:26:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012403; cv=none; d=google.com; s=arc-20160816; b=odGxxipxblkP3og5tnlDUZ+Cj+6TJyl5oKxBgzVF2UvjVVFM2BDSsLBHGS3KS04nfl vjJnRB512D6rWtkmJ5GgUI72lpsKYB9WtDWuQ58829o5s3co6bCIaWFcZ0ABnHfhw7yS V88+KyRzPnobx+tD+gdw00XKDWZDDkbbvdHT8sZIJPSqLx8zVgDuTZIYkmEwY/LO0Ytk ml3Zamx2wiJbFR2BSeGgbj7HMx0+r8wsgmmw2Dxc2fraageFNbgvYh1qz0pWlBMSKzzV wefMJHaSO+1zmKvYdwZdJo5ASSKXY/7yIU5oVLUtCeGzdZjLcUjWPZKo7HXBmF+He0HY 1cRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=sOxMDvWG7fYCMvOESgkL1lEMXJ1JQ08vQMhMIpxGM9I=; fh=5SqorCU4NjFi3WWDRAR9cvY3uyvURqWUsp1nT/zGHw4=; b=EPVyf0ZEYShHhiWrPG1vcdRh+U2F8IUKZqJXZVXOaARMZtGrEQGQOxWPgMmG2t/Nfi GFIUCqf8m/z5gvZaL26DPIigP3Qn76MmWTrQvFnvbjE7xrbBWvJHIQoPOuAzcnWTXClU GrbFsocqsTJUh8YfLkLI298DTRI5+gaw66pcPM9F6MDjweABTgLFIkc9+lVEShWURAA+ fp26VWoplnqGdOnnWLVW81LnjoCAcWzY9TxCd8/JD2vQWe3zEw0uOSXjMIIpkQxNZQv7 yNTqWcEVVhQ3gGwwwoHlxMF+k6+wdtpbe1tSuv6tg6CIRRviZlG5T6yaYujhBqVsqH1R 2SIA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J38xq4PG; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id kc27-20020a056214411b00b0068fa9c997e8si2149198qvb.351.2024.03.09.11.26.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:26:43 -0800 (PST) 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=J38xq4PG; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Jb-0006n3-4E; Sat, 09 Mar 2024 14:25:07 -0500 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 1rj2JV-0006T4-9m for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:57 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JS-00034W-4L for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:24:56 -0500 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d269b2ff48so48618121fa.3 for ; Sat, 09 Mar 2024 11:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012292; x=1710617092; 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=sOxMDvWG7fYCMvOESgkL1lEMXJ1JQ08vQMhMIpxGM9I=; b=J38xq4PGGwtuqZGaJYM1qDPUggGtv+n5tzGS4pYERNsyVkqA7CDjhVHDXk31MW16bc hhHWlc90iduw8WwVaHM32aJEIMcPLDc6O9Rf80Uu/llk9p4QamSL8FWHc17uyQ3P28Ej OMNYvEfRbWivCBJ9bu8OEdfIZ5uG3vYlTsAaxqUw5LD2QS/nlcvRDDlzTJv4e3fsyY+5 KhVEBGQgZddbuwf2iD8L3jPXwPYgtB7sKt72wM/5lqcZhTvMmWBWVWe7nnc7ZDciE/cf JMi6fPQ8nMpSBq+SyEZQF6kgDd7w5KWK2pPp60Bd3Pg/Eeg/YyaD38bu0ax94ZqrfFd/ ZKVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012292; x=1710617092; 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=sOxMDvWG7fYCMvOESgkL1lEMXJ1JQ08vQMhMIpxGM9I=; b=AnQH+jBjzRnaVfg9W5NU/8OP9wyR9iJQkBhHalxYRKiSCYqWVHzQ9xNJIDZhW/Asa+ 1m13kTr7zUlDjNh3n8ZeiTB100A/5AlmrZK/5q9yhnI/gX8wyjJn/vA/NzxQUzJ17K+F DlJrD/hwJqkst2vS91kNbjBUEd+Imw8HTuYN14zwQXAbw/6Jcs33DkJS04SdAxnhD2FK ROWj9mgOUTgKnHA1rI+EyfIVZZYWDybI1UmwvT3o/JNmzUfMXe7jvvY2x4rCQBY7H4ZF ctE08OtPPEpkVxL2o8Rc9WZZNfWM/GG8P0Yl0/5up3o30ZLKXVGzfWE2z9gMiur+z473 J4Ag== X-Gm-Message-State: AOJu0YxOo33x5k9ef4I3bEH5awjw0Z6AO3YCmUyuixfbpeevwjfIggR7 hKWH65Rzw6G2/nOylfaItFqBLw16q5QnX9w3DR/zcAOpO3xur2kXmR89YzgIpM6kLvVL+PvEeoG Z X-Received: by 2002:a2e:9b8e:0:b0:2d3:fa6b:9104 with SMTP id z14-20020a2e9b8e000000b002d3fa6b9104mr1393478lji.20.1710012292045; Sat, 09 Mar 2024 11:24:52 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id n10-20020aa7d04a000000b0056826248468sm1156009edo.89.2024.03.09.11.24.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine Date: Sat, 9 Mar 2024 20:21:53 +0100 Message-ID: <20240309192213.23420-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22f; envelope-from=philmd@linaro.org; helo=mail-lj1-x22f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Mark Cave-Ayland MacOS X uses multiple techniques for calibrating timers depending upon the detected hardware. One of these calibration routines compares the change in the timebase against the KeyLargo timer and uses this to recalculate the clock frequency, timebase frequency and bus frequency if the calibration exceeds certain limits. This recalibration occurs despite the correct values being passed via the device tree, and is likely due to buggy firmware on some hardware. The timebase frequency of 100MHz was set way back in 2005 by commit fa296b0fb4 ("PIC fix - changed back TB frequency to 100 MHz") and with this value on a mac99,via=pmu machine the OSX 10.2 timer calibration incorrectly calculates the bus frequency as 400MHz instead of 100MHz. The most noticeable side-effect is the UI appears sluggish and not very responsive for normal use. Change the timebase frequency from 100MHz to 25MHz which matches that of a real G4 AGP machine (the closest match to QEMU's mac99 machine) and allows OSX 10.2 to correctly detect all of the clock frequency, timebase frequency and bus frequency. Tested on various MacOS images from OS 9.2 through to OSX 10.4, along with Linux and NetBSD and I was unable to find any regressions from this change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240304073548.2098806-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé --- hw/ppc/mac_newworld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3e796d2f6d..ff9e490c4e 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -77,7 +77,7 @@ #define MAX_IDE_BUS 2 #define CFG_ADDR 0xf0000510 -#define TBFREQ (100UL * 1000UL * 1000UL) +#define TBFREQ (25UL * 1000UL * 1000UL) #define CLOCKFREQ (900UL * 1000UL * 1000UL) #define BUSFREQ (100UL * 1000UL * 1000UL) From patchwork Sat Mar 9 19:21:54 2024 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: 779163 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852331wrt; Sat, 9 Mar 2024 11:26:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVxw5d6Z4W3Nw5qof0ftgYRBFeY84dpiGtT5asPPzuQkB6Nw2AD20aK+x6vx/V5Ih6j4RU3qpubqnvqSs1oBJgX X-Google-Smtp-Source: AGHT+IHTW+SY6AWzg8IlDzMiCnNIDecPZQl+L2QBuQTm4d2zCPXavSSx8erp4RgSahBRlJkUdoCE X-Received: by 2002:a05:620a:2089:b0:788:2a0d:6f90 with SMTP id e9-20020a05620a208900b007882a0d6f90mr2584115qka.74.1710012403573; Sat, 09 Mar 2024 11:26:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012403; cv=none; d=google.com; s=arc-20160816; b=zl03Cd9q2UaAuoQGYmqgz2LN2n+uz7et6OfMjksb7WvASxDHOk3htnkavcpJvbHm4f 8UDdcEcKaIkdNI6+3MWa7P9YsFCyPisRNgCG/znQtkiPU6MIapyARF8z/wzgoENzGvVs f7RWilGFfECwZ121Dfw3kOKX1wg1QKypPgD8I4hsjJO0gwK8flWtOpYaqR08rweQInP+ UpLxH9Mar/OHYxUe8KvzLzZEXqBXk+Up/n/BwodP5Ihi1tJTdluDJo7oSK2LglZrsQCu kpGG7yqSz+5Rl3k8vi1QYjlfleCx6vZmkHXQYeQG+PWBXsBDxn3P3JxljWs/fbmSj2/p lDFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=LXk2FBAU/I+Gq91SQ8W6u6cQEBqnEw8TniXn77xAtfE=; fh=NlDOEFt680eBPvA80vGZs7w+yS9VdznKuU46dP0Ceto=; b=lPt746qJghfUtjWJYqoo+Ww5th81ISG+/N1FyT1/6s0HSlXdudqLGA4oM2NOaX71Zi Pws0WUjucJLGnR7XBpTZM060E0bIvesMD8aJRmxjlQaOqXX7JH1PNfKeUCdrrHHaU4bO 0ba78ChS9VSuLIwoUIygdV/LljDfKMW2tyOMntqYRWyZOnCW8W82bFxo8BKq6aDuWsD1 7H+CcV6QaaoJA6NcOp2d9Sq8Hv71C9f+jVnbpppxxwnmO2fQG9qscBAU34/utR+xhAFN v3hmUGXImimDN5nDPCFITavL2/wZgrJwm/XQbvmfHj/jV0CG20cMZtxedzRZ6EK+AKrf ylXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="hW/y+TVQ"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c37-20020a05620a26a500b00788384e0066si2308268qkp.159.2024.03.09.11.26.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:26:43 -0800 (PST) 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="hW/y+TVQ"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2KI-0007DT-At; Sat, 09 Mar 2024 14:25:54 -0500 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 1rj2Jc-0006pH-T1 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:07 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2JX-00035R-JQ for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:02 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a460185d1a7so75719966b.0 for ; Sat, 09 Mar 2024 11:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012298; x=1710617098; 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=LXk2FBAU/I+Gq91SQ8W6u6cQEBqnEw8TniXn77xAtfE=; b=hW/y+TVQNEGOV3R6xUfA6rbqvDgFVTmeyaeKF6nw4CdPPoWGD+YUtJ8uUeHtiSXO66 Cs4lDp+wXeSNo6TvLWGy7bwR2U0tYGpFudeQ5osJ1nWOQ3I4D7CfbXmVHrHxjQUcln9J Joc48+Ki03C4j1Q24MnT9V5pwWHlZHoaTfPlQpZnnC+dYEuQjXF/OeUgUDIC6dRI4k0K uiPE1x6fypUQNsMoVcatwmuv53xrDWbnP2xCKz0vmNNJE9nD7Du/f/cGQxOsN8UcAKlu iy+1dHnqHFQubWdYPdt0bRL1H6ds8enlTXVFDGAYFJIKb5wvc3uaimWr75QWEkt8KKqK ip0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012298; x=1710617098; 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=LXk2FBAU/I+Gq91SQ8W6u6cQEBqnEw8TniXn77xAtfE=; b=KNpY2RF7NMrfweWKolJNx5xKfK66KlMjAfUIr/0cV3SgU0CRG3cF2gJglTY/588xaX RF5XZAMb4QYyuRTtYWqU/C4pNVPr+6JxtsmcktCOb+q+wTzpb+NT3A9VdFX/wR5kkFIP bnwfq6uSUEO7h0aCqYdXmejWsF4FOYB+Wcbd273Ah6zto06LjqxE3O3t/8b1zx6Sl5n3 lw/tPI7BARUtntJYrHAUj0+lfWqwZDrlWD3Zt4D5uqJ0roz9BDhD0mflqq5LjeLRv8zz PKfUrST0w5s+8i+/l1qJKonC3MFF/sCcX0LPvvNOAUZKQoMfR5ilcCTxH2CMRwmiEL0q 4A8A== X-Gm-Message-State: AOJu0Yy0nX9MBAl5yw6KH+sySnUC7U3BPh40Qx9zViKg3f4awQOaqjPZ UxW/umJd5lFtvh7g67E1u8QSfDCz+Z78q9PBp0rkCr9IpsHVBOvV/DBow2Vr0tA+/lHK9GUe8AP a X-Received: by 2002:a17:906:310f:b0:a43:dc5f:f271 with SMTP id 15-20020a170906310f00b00a43dc5ff271mr1326849ejx.42.1710012297770; Sat, 09 Mar 2024 11:24:57 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id r1-20020a170906364100b00a4320e22b31sm1195761ejb.19.2024.03.09.11.24.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:24:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Cl=C3=A9ment_Chigot?= , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Frederic Konrad Subject: [PULL 27/43] hw/intc/grlib_irqmp: abort realize when ncpus value is out of range Date: Sat, 9 Mar 2024 20:21:54 +0100 Message-ID: <20240309192213.23420-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Clément Chigot Even if the error is set, the build is not aborted when the ncpus value is wrong, the return is missing. Signed-off-by: Clément Chigot Reviewed-by: Peter Maydell Fixes: 6bf1478543 ("hw/intc/grlib_irqmp: add ncpus property") Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240308152719.591232-1-chigot@adacore.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/grlib_irqmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/grlib_irqmp.c b/hw/intc/grlib_irqmp.c index 144b121d48..c6c51a349c 100644 --- a/hw/intc/grlib_irqmp.c +++ b/hw/intc/grlib_irqmp.c @@ -356,6 +356,7 @@ static void grlib_irqmp_realize(DeviceState *dev, Error **errp) error_setg(errp, "Invalid ncpus properties: " "%u, must be 0 < ncpus =< %u.", irqmp->ncpus, IRQMP_MAX_CPU); + return; } qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS); From patchwork Sat Mar 9 19:21:55 2024 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: 779170 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852700wrt; Sat, 9 Mar 2024 11:28:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUCGxwPscq7B65TzAp8isWk+KXmdAzscQ4weicC2ts2QBu94uQV30ImO+BU4UV0fPFGf8XGSHVj+I9u2tpQkTxo X-Google-Smtp-Source: AGHT+IH15+5HzWEq8rdjRblBoeeahaInID56ta2rR63z0c1XHYdDc12WycYYNnGouCstZczupAPQ X-Received: by 2002:a05:622a:148f:b0:42e:c1b7:81ec with SMTP id t15-20020a05622a148f00b0042ec1b781ecmr4312989qtx.10.1710012500168; Sat, 09 Mar 2024 11:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012500; cv=none; d=google.com; s=arc-20160816; b=s2nbXI+sH6fihVj/brIW3B/T5PUd2lw/WLbA7u7Pb9XXOVpUf4FCovLe1r/fY8QyvJ t4ELa0ppJxPLw+oAdmgrxyt21TfbUCDDArGubvt4Z5Dbav+60wvz4KD/+QH342ESiRRl Hxw4C0WZIG63KUrTVlWK3wuvKCQ1ySnS66rALCCuS2RNwOqkFVfVg5yh5o3dbaq7iSMg ZaAm7f28IB6scBD1Jr4swL2Bh3NoJ9ysKTjCj7lA+K0kspMlh60d6IibnocDziDhd+xh q3jaDk13mJXM5vhh1MK+kQ/8tiW9PSVE+qhX+sXimNiehhdLGWggky2hNZyP9S5te3RW WI8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=7zPZ+tfLA0kEM+leCIAJpOJfakF+P7OF5niFNRbs0QA=; fh=MlOZp9VfvR63yPyjLwOIIdTR59GgVm+Dmy+Qe3yo7cg=; b=SWvsJCbdT6nL0OZEpVK0FxpJGhjWgQQ24KwSutSGxPtJeBkfV1bXl0VkjfTg+Qll+8 WuzJbSD+8ABnTGT1Z4/sPKtMBcqVkmtjiWPUTELdJVtAMy2q68iOWhRcseX7YolRpNZ+ vpxEqdVtopZeAAg5lmAEVIaWVX0SahcLXcuWkCFCHGiATzkhZiakafeSjZ8v9SMGhoXZ /yoov58nN68jz2vyoGv5vFtEYrFZTfmHMxK25NEFooXiBmKoYr3mGuCSfXT/Z4ZoTdew Z+QEX+41sc6fJBOk0cPPCEStEf5fTnqaxJh7+qfpga179QOlkCBaKg2fxqVnIDnVJFjd O/WQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AHBwVgXq; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w9-20020a05622a134900b0042f0c821be0si2184268qtk.266.2024.03.09.11.28.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:28:20 -0800 (PST) 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=AHBwVgXq; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lb-0008HE-QM; Sat, 09 Mar 2024 14:27:07 -0500 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 1rj2Jl-00071k-Tr for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:16 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Je-0003Gp-Qb for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:10 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d269b2ff48so48620111fa.3 for ; Sat, 09 Mar 2024 11:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012303; x=1710617103; 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=7zPZ+tfLA0kEM+leCIAJpOJfakF+P7OF5niFNRbs0QA=; b=AHBwVgXq9ZG3/uDg62TUf5rnj5n6AJIgCw2RdDjkDn7Re4d2QILaZs2k5kW71jtwoh rm6zAao15W9zINZ3R2OKC+q/vdo6pbjLZ/UYX/3yMW5TSHtdn8pEMg1MQtHnENWpa/mG PJM8e57q+iJIWQS1ZIlwzvhWDEGA0GTjnOV1uvZVQ3sed7toNFxtDOIMDVW74UnUBRWt 2ZWnl7R/uDmtqOU36ZSmwOIcV+s9IzmarAuFOMHq8O/l/7uF9zWW1LcHd4G+eljxvGNH 2mNgOMIj13yIqI/ddN4mp5asQKSunHm1p96NKJCoNZGg73gPwQ6KAmDfQFg6Xvr6iLI3 6hPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012303; x=1710617103; 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=7zPZ+tfLA0kEM+leCIAJpOJfakF+P7OF5niFNRbs0QA=; b=Fo9rfDWgQaHDuz45XxuAmY3tUwVCt5OLkOk1+zIlsH4Q+iiehvFygxMCkSE4qwoFxl yaqyaHFwjU5Z0hsfUJ/YPzZdBGcKNNnonhzsGbmNh1AI+I5O2qDCgD67R1adMOERICWx Bryz+4VR/JTbxf1o8r4lehN3wI0/EX0cBU4ynzMBycygUjJUT9DXHDXJE9C1TTY9TqdS 8fCtL8Rseg7xd9vmP46cbZtPvwBe0e+3ZqKpM9BiuBFl+k49dKFdgcR26UtsPugA+1+k RN6dzd6jBPoWAAeJxEYRFwwKQVS1sgkSTyYE1KJNG/0ORhIEu4QYyQk2bcpZ/8W5pBf4 gI3A== X-Gm-Message-State: AOJu0YySule8H/LhPN7RyyXnmPDW2I32ZKom16AqXNJa+x8gWZEVaBp0 Yz4XeTAW8CzYN9SXLID6qJ2yFv+xS3d5l5Rxa5FIjcoNymQrbqtypCmT23scjH7IU9mNGfCrKCE K X-Received: by 2002:a2e:87d3:0:b0:2d4:31a0:6adf with SMTP id v19-20020a2e87d3000000b002d431a06adfmr299482ljj.24.1710012303605; Sat, 09 Mar 2024 11:25:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id cn19-20020a0564020cb300b0056828004c75sm1167790edb.51.2024.03.09.11.25.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Thomas_Wei=C3=9Fschu?= =?utf-8?q?h?= , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Kashyap Chamarthy Subject: [PULL 28/43] docs/interop/firmware.json: Align examples Date: Sat, 9 Mar 2024 20:21:55 +0100 Message-ID: <20240309192213.23420-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Thomas Weißschuh Adjust indentation for commit d23055b8db8 (qapi: Require descriptions and tagged sections to be indented). Signed-off-by: Thomas Weißschuh Reviewed-by: Markus Armbruster Message-ID: <20240307-qapi-firmware-json-v2-1-3b29eabb9b9a@linutronix.de> [PMD: Reword description using Markus suggestion] Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 374 ++++++++++++++++++------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index cc8f869186..a024f1b9bf 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -435,203 +435,203 @@ # # Examples: # -# { -# "description": "SeaBIOS", -# "interface-types": [ -# "bios" -# ], -# "mapping": { -# "device": "memory", -# "filename": "/usr/share/seabios/bios-256k.bin" -# }, -# "targets": [ -# { -# "architecture": "i386", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] +# { +# "description": "SeaBIOS", +# "interface-types": [ +# "bios" +# ], +# "mapping": { +# "device": "memory", +# "filename": "/usr/share/seabios/bios-256k.bin" # }, -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-i440fx-*", -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "acpi-s4" -# ], -# "tags": [ -# "CONFIG_BOOTSPLASH=n", -# "CONFIG_ROM_SIZE=256", -# "CONFIG_USE_SMM=n" -# ] -# } +# "targets": [ +# { +# "architecture": "i386", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# }, +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-i440fx-*", +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "acpi-s4" +# ], +# "tags": [ +# "CONFIG_BOOTSPLASH=n", +# "CONFIG_ROM_SIZE=256", +# "CONFIG_USE_SMM=n" +# ] +# } # -# { -# "description": "OVMF with SB+SMM, empty varstore", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# { +# "description": "OVMF with SB+SMM, empty varstore", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", -# "format": "raw" +# { +# "description": "OVMF with SB+SMM, SB enabled, MS certs enrolled", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.secboot.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.secboot.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "enrolled-keys", -# "requires-smm", -# "secure-boot", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a IA32", -# "-a X64", -# "-p OvmfPkg/OvmfPkgIa32X64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D SMM_REQUIRE", -# "-D SECURE_BOOT_ENABLE", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "enrolled-keys", +# "requires-smm", +# "secure-boot", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a IA32", +# "-a X64", +# "-p OvmfPkg/OvmfPkgIa32X64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D SMM_REQUIRE", +# "-D SECURE_BOOT_ENABLE", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "OVMF with SEV-ES support", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/OVMF/OVMF_CODE.fd", -# "format": "raw" +# { +# "description": "OVMF with SEV-ES support", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/OVMF/OVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/OVMF/OVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/OVMF/OVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "x86_64", -# "machines": [ -# "pc-q35-*" -# ] -# } -# ], -# "features": [ -# "acpi-s3", -# "amd-sev", -# "amd-sev-es", -# "verbose-dynamic" -# ], -# "tags": [ -# "-a X64", -# "-p OvmfPkg/OvmfPkgX64.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D FD_SIZE_4MB" -# ] -# } +# "targets": [ +# { +# "architecture": "x86_64", +# "machines": [ +# "pc-q35-*" +# ] +# } +# ], +# "features": [ +# "acpi-s3", +# "amd-sev", +# "amd-sev-es", +# "verbose-dynamic" +# ], +# "tags": [ +# "-a X64", +# "-p OvmfPkg/OvmfPkgX64.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D FD_SIZE_4MB" +# ] +# } # -# { -# "description": "UEFI firmware for ARM64 virtual machines", -# "interface-types": [ -# "uefi" -# ], -# "mapping": { -# "device": "flash", -# "executable": { -# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", -# "format": "raw" +# { +# "description": "UEFI firmware for ARM64 virtual machines", +# "interface-types": [ +# "uefi" +# ], +# "mapping": { +# "device": "flash", +# "executable": { +# "filename": "/usr/share/AAVMF/AAVMF_CODE.fd", +# "format": "raw" +# }, +# "nvram-template": { +# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", +# "format": "raw" +# } # }, -# "nvram-template": { -# "filename": "/usr/share/AAVMF/AAVMF_VARS.fd", -# "format": "raw" -# } -# }, -# "targets": [ -# { -# "architecture": "aarch64", -# "machines": [ -# "virt-*" -# ] -# } -# ], -# "features": [ +# "targets": [ +# { +# "architecture": "aarch64", +# "machines": [ +# "virt-*" +# ] +# } +# ], +# "features": [ # -# ], -# "tags": [ -# "-a AARCH64", -# "-p ArmVirtPkg/ArmVirtQemu.dsc", -# "-t GCC48", -# "-b DEBUG", -# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" -# ] -# } +# ], +# "tags": [ +# "-a AARCH64", +# "-p ArmVirtPkg/ArmVirtQemu.dsc", +# "-t GCC48", +# "-b DEBUG", +# "-D DEBUG_PRINT_ERROR_LEVEL=0x80000000" +# ] +# } ## { 'struct' : 'Firmware', 'data' : { 'description' : 'str', From patchwork Sat Mar 9 19:21:56 2024 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: 779171 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852756wrt; Sat, 9 Mar 2024 11:28:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVtqLxfdSRSyQLSJ+QmJojnOQAl9UwlO1jOHyZdsGsSxRKF7LwDKFRuoTSka3Ld+PPQzSQjqs+VFbR0z57IHPj6 X-Google-Smtp-Source: AGHT+IEXu6F9/fdQXPqr3HjtHYH5RfqazbQBy6flm+1q1I0BuGV8TQaIZxP5cbtbeCQD4vkA87I/ X-Received: by 2002:a05:620a:5584:b0:788:2901:cbd8 with SMTP id vq4-20020a05620a558400b007882901cbd8mr2448961qkn.28.1710012518582; Sat, 09 Mar 2024 11:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012518; cv=none; d=google.com; s=arc-20160816; b=RzGFMiOfP/ADJq3cb7GOawy242xh9eMQ8oquuxjnZbuo5M/PfDZKUq3Gv5uzCqAbpL ayhNErV91vneV5IfRpEbfTCHMNke0Gsnmeg2n/1wFkZb1G4AN2IL/Ga6RanrjS0UOIxb ZZNtS6/csH6VloOUxfCVoWdAUNDoG52+DNzcYEGEgeFjBaL5IkuFnqVeXKGmxFwPB4a6 31ap0dBu53iCLjFTeMy5w906wi1IahYxk4feN4PnF7k8QFN8q6ZhDe8uSaFZ5h0qNY76 rur1AV8Rqtwv0HICvrjm6/Bl9IRt+1ykZBcrU45cPIbFj7kwbV3ELl6ZMx+1fYbWMTwm l6ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=shKXB5mcwJL88T3p8o75GRzqkLr6uG1jmqPC2UukzhI=; fh=BE6MZhFgQ+vESRToz8548hMEtrvy36dnVW/KHUFM08M=; b=DkT1Fzd8AQy7pTNUioYP5omylriLKCKb6C4ZxPlPoCdy5CXBqnuC3PIWZY5qw4QoBH GS1hwP0pU7cPPZi1va3gWcc2g161cLhhGQfzDAad+hw4EKRytE0G5agCyLQD47Ltmsn+ 7Z2A09TfU312/K67BfDSFx8Biiv8gLb0tc/wMWlsrR5Dw73v1lwHTUvpHDvfLFU8BTxd /zx3JpTHk4I9R02XljTb+rT8YzbYl5pyX8dEAkIP02kddS6mKYJN2RYKzWw3kFtLrICS wEIl8XUdhqTyCwgW8qxnLQ2X9mm8ttw2Am3NGofNQJ92Chy5sTBot7yZ/KjmUNeDXqSF b/HQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pY4+LBsm; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o28-20020a05620a111c00b007883187d1c4si2020875qkk.153.2024.03.09.11.28.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:28:38 -0800 (PST) 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=pY4+LBsm; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Ld-000097-Kd; Sat, 09 Mar 2024 14:27:09 -0500 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 1rj2Js-000769-Mu for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:22 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Jl-0003Is-SN for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:18 -0500 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-563cb3ba9daso3523889a12.3 for ; Sat, 09 Mar 2024 11:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012309; x=1710617109; 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=shKXB5mcwJL88T3p8o75GRzqkLr6uG1jmqPC2UukzhI=; b=pY4+LBsm4cXmBzCJybnR2Hy02QkbN0Bt/FH+E/VAwK8DCHjAFkyQ1ysrS7ckIyLDpr q0P1huPa1iAHzlkDqQlubQGYsdypCsGkrZO5sKMzurFY+tVGLt2OtcMm8klHbjwCYx1m UtVXzZSu3fZPpwQbwCwZIrihHeaPUVnR9iPJ9h3uIk0eOLoyUFZhUYkttNVJ5+LPHZB4 DijuYjuOUsu/tYq9RB5OAou816u5NakeAhA8Gtu8xhiDNcqFzSSMD4EPU+840x1ZlyiP yfjX7bcmffnthpvWh8lUCMk4scgSetGPhNXbACO7o8uS3mJJfaR8tMQkoAI1kn5mFlHb CW+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012309; x=1710617109; 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=shKXB5mcwJL88T3p8o75GRzqkLr6uG1jmqPC2UukzhI=; b=PsnV/EXBSTrJazg9Aqr5hFN329JPxAdO7qv+otesJL/bxO5qghLHM2v/Ll9m33qmMA ePJRigyMqiMrunorat5su0C/vDY/UYLhC3GXkCWW0bSDJWqY5g0kp6JZnZBoUlLGtmq5 bD4MnglLDmAg5VXHDIFCDpzH50URSLbcIQuP0tS3J1Cyal/Nd0O8KCpJQj0DYUF4CSQs 9t1Z/Hp30wXGSenliInJ0d6TiUl18YkGFFfOd1lgT+BS8oJSyb2zwNRokah0ZaeW4/BQ ZGWWBhcUWYgiqlzJjScLEaZ12pYaLB2BhEzdlV8oqBKOjXI6TpREQJMite2mlTDty23Q okjQ== X-Gm-Message-State: AOJu0YwHAa+eT3J9VTriNFDqRUjqkzm8pCoKdcT+sU/F5Gqjptt8TQaq R2Gb9XFWKmkL6ysxsNFfyOYSPthEPz5S1D6+iW5TIEzdM8AwhuMIKOeP/buoavwHTiEXstnAZEx T X-Received: by 2002:a17:907:7856:b0:a44:415d:fa3a with SMTP id lb22-20020a170907785600b00a44415dfa3amr1436642ejc.40.1710012309349; Sat, 09 Mar 2024 11:25:09 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id y20-20020a17090629d400b00a45cc1e8fe3sm1169038eje.211.2024.03.09.11.25.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, =?utf-8?q?Thomas_Wei=C3=9Fschu?= =?utf-8?q?h?= , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?q?=C3=A9?= , Kashyap Chamarthy Subject: [PULL 29/43] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Date: Sat, 9 Mar 2024 20:21:56 +0100 Message-ID: <20240309192213.23420-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=philmd@linaro.org; helo=mail-ed1-x52c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Thomas Weißschuh The doc title did not match the actual definition. Fixes: 2720ceda05 ("docs: expand firmware descriptor to allow flash without NVRAM") Signed-off-by: Thomas Weißschuh Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240307-qapi-firmware-json-v2-2-3b29eabb9b9a@linutronix.de> Signed-off-by: Philippe Mathieu-Daudé --- docs/interop/firmware.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json index a024f1b9bf..54a1fc6c10 100644 --- a/docs/interop/firmware.json +++ b/docs/interop/firmware.json @@ -223,7 +223,7 @@ ## -# @FirmwareFlashType: +# @FirmwareFlashMode: # # Describes how the firmware build handles code versus variable # persistence. From patchwork Sat Mar 9 19:21:58 2024 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: 779165 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852468wrt; Sat, 9 Mar 2024 11:27:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUC8tSLAQ3Jkti1FUzuaRAm2SWsHTlgvKvVLnGPjpR8Es6KjwLhtRX/QR+DyRW72Uo40Qy3wFmSazyMQ5vQ9/Ps X-Google-Smtp-Source: AGHT+IFNx8ERJjMEL+/HIBiYLyXJal1JqeHCXH2PcVLdNjdQu37NwwBfdoEpxwsL5CzHzdd9iOtb X-Received: by 2002:a05:622a:1c8:b0:42e:ecdc:ce5b with SMTP id t8-20020a05622a01c800b0042eecdcce5bmr4881868qtw.10.1710012439210; Sat, 09 Mar 2024 11:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012439; cv=none; d=google.com; s=arc-20160816; b=AmU6yHBSkWKXfBxGeUv/LwYYnAaxp3BNf6ifEMpGed1PxJOM8Bd1kNXreKtUAIn0wY 78k4s0c7OW6xr4FFMl/9wCarBPRFFfZ4pPzZHP7g8jng8HtUwRq1T/t62fLaz+1BV2UF 1XZ5XFaShQv8f01SYysX616jOkdptdLakroHaKPtLCZ1BVzpxkUlNap+8F7WvfsyLB8I 0qzu5oakUBshOuFZRMBAWhIGkVyOP0khF7wpi7muydCtrsk4YB0sWherq2cSMDTHGStA Fs8R3wBBw07d7AJHfeeJel7L6lh36FKhN4TIXuup8UGDJTqcWGTSOOS/4ikhjyk9Vi4Q YA6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=y5wggQ6ZmpYal9W3iEFAyHN5UYyn6LPkIJHsTwN5wMc=; fh=H5We735HM7ixm4oy9fY2JEKyejOR7OsciZcDaqKVioM=; b=tQZxJATaskhfG60phC3KALjxKviBYZqTR0RrBLQZw+d20T4YofK36xASfOBTSOoNES dzUIPycnnuETFkJ/iMU17CMu+GtMJWyKAWxHiSzXUN3yh7mghUU5ZjtEQfdo+/w49FVQ +b42kD5og2C4dsctDNf/NEvpvSTPOI1uZuY+a6qD2/yJdm7ByC/EG1YD7o8JbngFWJwa ZlJD7DE/OEER5EM/9N3IVzXQ4XBa+ZGIbfhuPKh3Ut43v3dVs3osxzwA2vpdO3euOjWt mJ5yjpcnc7/N5ht7xanOeAKCXROL70QW6RNafuur114r6faOWrDSlA2Uhwri9TLGRpud K74w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gzHWvyZY; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u11-20020a05620a120b00b0078820f8eb54si2089927qkj.284.2024.03.09.11.27.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:27:19 -0800 (PST) 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=gzHWvyZY; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2LP-0008BN-GF; Sat, 09 Mar 2024 14:26:56 -0500 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 1rj2K0-0007DV-Nc for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:36 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Jw-0003K8-Iw for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:27 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a452877ddcaso369179666b.3 for ; Sat, 09 Mar 2024 11:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012321; x=1710617121; 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=y5wggQ6ZmpYal9W3iEFAyHN5UYyn6LPkIJHsTwN5wMc=; b=gzHWvyZYMBxYglvhK6bLYIG+VIsGll18hNTto7mG+tkI1rOST7EtfjvtibDSNo1DXj xexX6ajenpfc7kbdX/iKHoyiXNkxGFGsinkP5FgVGzIQQl5xSIrxtcTW5JaTttXmHy8K 8xMC9oBD9OX5mlcSgmkI1dB6ezQDKVmlCNiQzmRsxlbu8tmkAMOSS6hUcOOgpw/s02ur ITES9owP4sELrsUNFdSHdzAoTbDbPNxA6aBc2Xnh0OxIFmbqIHrzKJPBkDjblkXsKY42 RdiDMEJC/XbnqZ9MreurytdMZKusSQ/JySPlVamwUdkya1CvsGkwcuU/t0su6fsLdtJl Q4WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012321; x=1710617121; 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=y5wggQ6ZmpYal9W3iEFAyHN5UYyn6LPkIJHsTwN5wMc=; b=PheqnlMWosxOdf+ieELs0iBZGhwpzBvSv6fl20/WPE5srwt8YQuLsipgkpfypHQ1SB FTDEcSD/pcpZaQ+F9n57hxn2aUGlNY12t28pWfACZnxMkhyIld3rqerYiZ3tChZvq+M9 2YDVTy4sXnjSTWtrrk/39+yQYQSQPF3Ca0WXzFhGeFTXwwqHWRfmbn7HzMWwKC76V6fM m3RUytWLp85tXYyGWd2MS/WyzWBtOEkHa7lROp7rcVI79+AGQTZg9HxVO42/26dbOCK1 rLf+EXi9oLAcufcjGLTObwmHoejWqEMytSMqkDTFr4OM2QB2HDze1rK3ZRjxVMmGdgbk mEoQ== X-Gm-Message-State: AOJu0Yz80LXXyyn2bqKzgjLt2/DpX+Tbcj9WTbVLT/Ni2ydRFGnxsYav /h91dRf7JzBmvPAXgmQ1mUl36pOefixiBFFJZ+2Jg355ixSdiFkYoOLoL6cjUx1aBSogfPuWStN 0 X-Received: by 2002:a17:906:f6d8:b0:a45:f89b:a916 with SMTP id jo24-20020a170906f6d800b00a45f89ba916mr1406551ejb.73.1710012321544; Sat, 09 Mar 2024 11:25:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id qt28-20020a170906ecfc00b00a45bb14b1a5sm1171650ejb.89.2024.03.09.11.25.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , devel@lists.libvirt.org, Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" SMP configurations Date: Sat, 9 Mar 2024 20:21:58 +0100 Message-ID: <20240309192213.23420-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Currently, it was allowed for users to specify the unsupported topology parameter as "1". For example, x86 PC machine doesn't support drawer/book/cluster topology levels, but user could specify "-smp drawers=1,books=1,clusters=1". This is meaningless and confusing, so that the support for this kind of configurations is marked deprecated since 9.0. And report warning message for such case like: qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported clusters parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported books parameter mustn't be specified as 1 qemu-system-x86_64: warning: Deprecated CPU topology (considered invalid): Unsupported drawers parameter mustn't be specified as 1 Users have to ensure that all the topology members described with -smp are supported by the target machine. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-3-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- docs/about/deprecated.rst | 14 +++++++++ hw/core/machine-smp.c | 65 +++++++++++++++++++++++++++++---------- 2 files changed, 62 insertions(+), 17 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 6e2f557682..dfd681cd02 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -57,6 +57,20 @@ The ``-p`` option pretends to control the host page size. However, it is not possible to change the host page size, and using the option only causes failures. +``-smp`` (Unsupported "parameter=1" SMP configurations) (since 9.0) +''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Specified CPU topology parameters must be supported by the machine. + +In the SMP configuration, users should provide the CPU topology parameters that +are supported by the target machine. + +However, historically it was allowed for users to specify the unsupported +topology parameter as "1", which is meaningless. So support for this kind of +configurations (e.g. -smp drawers=1,books=1,clusters=1 for x86 PC machine) is +marked deprecated since 9.0, users have to ensure that all the topology members +described with -smp are supported by the target machine. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 96533886b1..50a5a40dbc 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -112,30 +112,61 @@ void machine_parse_smp_config(MachineState *ms, /* * If not supported by the machine, a topology parameter must be - * omitted or specified equal to 1. + * omitted. */ - if (!mc->smp_props.dies_supported && dies > 1) { - error_setg(errp, "dies not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.clusters_supported && config->has_clusters) { + if (config->clusters > 1) { + error_setg(errp, "clusters not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here clusters only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported clusters parameter mustn't be " + "specified as 1"); + } } - if (!mc->smp_props.clusters_supported && clusters > 1) { - error_setg(errp, "clusters not supported by this machine's CPU topology"); - return; - } - - dies = dies > 0 ? dies : 1; clusters = clusters > 0 ? clusters : 1; - if (!mc->smp_props.books_supported && books > 1) { - error_setg(errp, "books not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.dies_supported && config->has_dies) { + if (config->dies > 1) { + error_setg(errp, "dies not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here dies only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported dies parameter mustn't be " + "specified as 1"); + } + } + dies = dies > 0 ? dies : 1; + + if (!mc->smp_props.books_supported && config->has_books) { + if (config->books > 1) { + error_setg(errp, "books not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here books only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported books parameter mustn't be " + "specified as 1"); + } } books = books > 0 ? books : 1; - if (!mc->smp_props.drawers_supported && drawers > 1) { - error_setg(errp, - "drawers not supported by this machine's CPU topology"); - return; + if (!mc->smp_props.drawers_supported && config->has_drawers) { + if (config->drawers > 1) { + error_setg(errp, "drawers not supported by this " + "machine's CPU topology"); + return; + } else { + /* Here drawers only equals 1 since we've checked zero case. */ + warn_report("Deprecated CPU topology (considered invalid): " + "Unsupported drawers parameter mustn't be " + "specified as 1"); + } } drawers = drawers > 0 ? drawers : 1; From patchwork Sat Mar 9 19:21:59 2024 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: 779174 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852973wrt; Sat, 9 Mar 2024 11:29:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWfbt4mhtwZx6GEtFTopdcJ4QlPO1H4llwdu7ogOJQk3xv0KwN7mjZ0hppPMtUWWGRpH8IPlmHq1WbWQ5Ot/ogx X-Google-Smtp-Source: AGHT+IHDNSy1MQ/9YIrvZbOfIe2y3UxMGm+1xxBbXI8kQhnKMKl2wEF8NqFLIXjxk3JBjS3/HgBh X-Received: by 2002:a05:620a:13e8:b0:788:1f51:5822 with SMTP id h8-20020a05620a13e800b007881f515822mr3140202qkl.40.1710012579075; Sat, 09 Mar 2024 11:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012579; cv=none; d=google.com; s=arc-20160816; b=TfwEfpfaQwxosdIm7pk9dlx8SMclsnWf4qxGGryNrh6qx+FKggDZDv7hFNcOQeX0xC v4Dti9irojmx9Ynie3MNlN7Jn1+0M//SdCYXk50opYeK3jN/18GxwjjsUePiW6SZJNKD UW84yJmKvLbHEbiHT0npNxaGgatPg7gh7imf+W7aVatki3Oy6gug5v9IyJ3pS1iQC3sh jee2HDYY2YIoiVIboyKtHxaxvaKGeH6y0ALO4g285MRg/O3W8YAUajJheGTYIHUtw7LY tTX7Tsku4V7Y3HRw3y2zFYSvbc5iuw9D2/7HPGQCRbPI809MiZannKCiNHIkeQ8coHCL ziXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=E1R5kgOTA3lFvXSZnN7vgERJPXvNPz5gmsixt+yKpBc=; fh=Ic14JDoLBYDubWTsH2KULrmNiQg5cQayF2aE6TGgUCY=; b=xpW3ByLhkYsjKMVjjqsT1/5vdpj4MLGUA0NCCmMDsiE2Ragzi5KYYao9OUL+qMgsDH qVMUxFEBL5abXroQOkNpBNQ759i/hnvyhdL9dPBZHHNjqOhYY4voKtc81gz3g4alxl1p YpDFQxmXCj7Eq6CTcK7HDxYR39pKD/MrYL/1dcnfeO5c7gMFjRhAH/+SZK53RmgohETn 3x5BS4kv9OKrL4JtmRmSZPvOWqV9Hv8CLTPssjNwR5VWWuwehYupfK91yssl2Ao/MiYK UH16uo5XGEptwGwOwFth15PyfQnoUcS2mGDgIo7ixx/8gL7G5gWlRDPoKNx3jvZnAO/f RdPA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="J3+6eU/P"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n20-20020a05620a295400b0078822280e7bsi2368799qkp.361.2024.03.09.11.29.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:39 -0800 (PST) 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="J3+6eU/P"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lg-0000qg-GW; Sat, 09 Mar 2024 14:27:12 -0500 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 1rj2K7-0007Fm-HD for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:39 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2K2-0003Kx-5B for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:34 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a449c5411e1so409072966b.1 for ; Sat, 09 Mar 2024 11:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012328; x=1710617128; 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=E1R5kgOTA3lFvXSZnN7vgERJPXvNPz5gmsixt+yKpBc=; b=J3+6eU/PUwZW9aQ96ujTS6hvGa3rP7nq8miwGloalQ8rrKMJ95FjgCbcts9Cra58lk +JHRrnjp+82MalvBHSMDOvcMDP3e1Ba816NJLTRXVurC623MX9LFi/YCdkzLNN+iuKYD P1xqRacEG5pfplCPl2nltSyilXUxwIVNiJLQQLxlbE1qIHyrXmk3iecj2qqxLVA+RxDO XgqItcnazo+1nqt1IBWwcPdc1pf16Cd8MxaYmgVm8gqBvJjEOZ/ib3KixMueAKD5ntGQ HoGCR80UK21t6B2HcpcOJ12OdKePHGGY6KtcARgaUqWhCxoAjypn7xFq1RW6scO/NOIk 9fjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012328; x=1710617128; 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=E1R5kgOTA3lFvXSZnN7vgERJPXvNPz5gmsixt+yKpBc=; b=XHWOIJWjhBEhdOgY4oXuEbRRVQxumy33o72U5uE5HOUit2sr8raUN/ochEIKG1QsBk qf0oGNO8488Vi5gXtq6iC2FihL993kC4uho6l7yCyVjEk1XHTwYD6oMieo7IFoQhtP+s a4b8Z1M+5enSCscU5DZ7zimfSkQ8miZ2Dbd/XNGGTTRcQshCvPaXAzpv6uJMilRofGoo bmZKpKI+TEFJCeXY4q7pbQhz6j4FQb9nG6wbVOV9j61jPe+3MX4MZX8DgTh45hShU51M tNVQM1XFR7ViRTBHLsPaYXcpZHSl/UgsJDT4JslVDcvPnn4M/K08R71kCJdMfsSKkVV7 BTvQ== X-Gm-Message-State: AOJu0Yyg/lFuh8ofoCEZSrIyalmeLETF4oprRTszFYYJRrCuNt4zY380 S19uUhjRP5BPfeVq0E57e8rNdaif7zmlr0LCCapc5N1juEutB1+VT2Q4gY54NchmtvkxUiEUbeG 4 X-Received: by 2002:a17:907:7644:b0:a43:eb29:a293 with SMTP id kj4-20020a170907764400b00a43eb29a293mr1284262ejc.5.1710012327713; Sat, 09 Mar 2024 11:25:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id hq31-20020a1709073f1f00b00a45c09107d6sm1182777ejc.29.2024.03.09.11.25.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 32/43] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config() Date: Sat, 9 Mar 2024 20:21:59 +0100 Message-ID: <20240309192213.23420-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu In machine_parse_smp_config(), the number of total CPUs is calculated by: drawers * books * sockets * dies * clusters * cores * threads To avoid missing the future new topology level, use a local variable to cache the calculation result so that total CPUs are only calculated once. Signed-off-by: Zhao Liu Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240308160148.3130837-4-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/core/machine-smp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 50a5a40dbc..27864c9507 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -91,6 +91,7 @@ void machine_parse_smp_config(MachineState *ms, unsigned cores = config->has_cores ? config->cores : 0; unsigned threads = config->has_threads ? config->threads : 0; unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0; + unsigned total_cpus; /* * Specified CPU topology parameters must be greater than zero, @@ -211,8 +212,8 @@ void machine_parse_smp_config(MachineState *ms, } } - maxcpus = maxcpus > 0 ? maxcpus : drawers * books * sockets * dies * - clusters * cores * threads; + total_cpus = drawers * books * sockets * dies * clusters * cores * threads; + maxcpus = maxcpus > 0 ? maxcpus : total_cpus; cpus = cpus > 0 ? cpus : maxcpus; ms->smp.cpus = cpus; @@ -228,8 +229,7 @@ void machine_parse_smp_config(MachineState *ms, mc->smp_props.has_clusters = config->has_clusters; /* sanity-check of the computed topology */ - if (drawers * books * sockets * dies * clusters * cores * threads != - maxcpus) { + if (total_cpus != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms); error_setg(errp, "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " From patchwork Sat Mar 9 19:22:00 2024 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: 779173 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852949wrt; Sat, 9 Mar 2024 11:29:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWOKd/N5aUMJVm71xHBk2nihfXmAcr8U5+9Z8rixq5xJ+mz7Lktqj/arJ3YvcTSzf9NgRVFpDJ/1Idl6CBOX2v5 X-Google-Smtp-Source: AGHT+IFUtshN/q/8bQ1mX9fl9pCfFPOwhc0SvnntQJXW9dL3I0jRaCyYOTskRwo2wrN8UL6+obWe X-Received: by 2002:a05:620a:450e:b0:788:3ed2:7da8 with SMTP id t14-20020a05620a450e00b007883ed27da8mr3862639qkp.3.1710012575994; Sat, 09 Mar 2024 11:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012575; cv=none; d=google.com; s=arc-20160816; b=NCBIf+LTTgMUNrTfwdZMRaDJr9IaiPL8v5GzAgo44imMGNhXAkzB0MXxt/+tKosMit OA+jcW/yyx6sqo8Cs77mAqkYxe5UvbBEAbS2zJ05hrZfnzKAgPW5HwKu7ngf3CuErk3O 6Vg/g5TNm9y9I/g9wG21f1cVYHbAQ184qZXQxCyYVbUeHnA7TqkZWwl+UqoBtA1BmU4/ MRfMPUmdXfB3B9DrudAjezoo0Xe9wiysTpupk5xdUjjL+Xgcp/+XYZET8rXVPO05ybLa XUaQYCtNTWIAAApHeWk5WhoxT/0d444UTRnnpmKiwoEbPXfa3h6CVbo+JMnKHjMV1hIJ 6J/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=i2x/6JhOMSh1e4AFrzigsCMOr4MSgOhrpELj7cZb/3o=; fh=S9WQPGLWsBWknqalzlH4o2qrER0/PTbhZltwTmPAzps=; b=PZtp9RHgZDwz0MAPoL6Nic9xJ5OqF4sdmp0a2/pYypfZAGknpltTOKhpnj2LKEw2bn 3w656s9N2iZUDMcG7uAxSAUwzMBiwnFEKgcDWxIoy6ftcNqgqCP9F/gIOlOCFVUg4aUZ vMbZbq19tATDQbSAKUBUinE8mFawsiEH/RssvQyahlPxR+i3WUJHPdfmv+AeI3DX11qe 70YQqZPGocGylt7sFA0odNyEtJFBrjdqwEKzTI7EGNCZqvBsmq+510MdQohh0JJ5nIuy HLYNfBluiWjwQ5QP9zioCBCscRghrHfj77bKlmiFj221zKx99H/PBA2XZChxWy/W+b3Y 7wHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="o71V9S/t"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id yf13-20020a05620a3bcd00b007885da3627asi1846119qkn.63.2024.03.09.11.29.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:35 -0800 (PST) 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="o71V9S/t"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Li-00017Q-Lu; Sat, 09 Mar 2024 14:27:14 -0500 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 1rj2K9-0007H7-Nu for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:43 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2K7-0003Li-BZ for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:37 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-56838e00367so1123581a12.0 for ; Sat, 09 Mar 2024 11:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012333; x=1710617133; 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=i2x/6JhOMSh1e4AFrzigsCMOr4MSgOhrpELj7cZb/3o=; b=o71V9S/tFWCUUoD2gRbRDJumvGbsCbOE4vR3j3PnNWuG7uAa3wBxq5Iir8vUgJ+dRe 8Oe6M9/K1sxIexy3Io77iYFRO+mX1MWcPCxReK3boy/3hdkCJEF+FNj7ve1AydeTsHyE sKGnBC/TdM7VgsG/Yg5O31Jd4SLvEpM9ZhTV017X1J2smOatt2Xws0GWPZ9AdbG0552b y6dIK5x3ut+shu+w/W3B7qIzH07Wca45bwkWMam0nTs9+r/3q6X6TxlGEQbOFAsW5Y+D NbhjvgjU9mguO/Q0MPe9daryfmemZDruILxgte0WyNzOAtqJZFpsVvAPNQjZsmAG8yAi Yg5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012333; x=1710617133; 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=i2x/6JhOMSh1e4AFrzigsCMOr4MSgOhrpELj7cZb/3o=; b=R4+CBLIgKN8LG7jhLMUKL0UgbjFo3V0aq/5DxHvqbT53XcOh7RfpO2QjZKkPbICGnR CLwIqmQ5GXdXlEU6Shi32RLFOmGycQjbDO1Cr5aUQgYEVrOHKN0l07JBjm4r6q6CoqnH kPyGgqIOA8erQhIX99BPdu4pdGd41Zn92BxdWYy0NeFD6uPfUB1iMeRcvosatFFOIzhg auCPDQXALE3+nHmRvtSpot5XX2ZEZthMnYvEeY9OMUvqQz+XgP4EGjgg2IX85nrfPhna fJyx8TGinQrvKpC5oAM/UY64OBD7IMsbhklMg83E1u56F08HI+NVLluJgymK1BOzDGHe 7Wrw== X-Gm-Message-State: AOJu0YxusqlcyKRCx36lU3NBHuvGu7AMhiHxWuxKLOOVqWxczbCCjlV7 XizEBltJ46cFVUNvVytefWqBMIiA5DlPOPGyGV31hqe1F/yRLvTjzyhdgBHv0PxdnYp8CdZWX78 o X-Received: by 2002:a17:907:a0cc:b0:a45:f6fa:8c20 with SMTP id hw12-20020a170907a0cc00b00a45f6fa8c20mr1533733ejc.14.1710012333792; Sat, 09 Mar 2024 11:25:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id h16-20020a1709067cd000b00a45f63d2959sm1165361ejp.210.2024.03.09.11.25.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:33 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 33/43] tests/unit/test-smp-parse: Drop the unsupported "dies=1" case Date: Sat, 9 Mar 2024 20:22:00 +0100 Message-ID: <20240309192213.23420-34-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Zhao Liu Unsupported "parameter=1" SMP configurations is marked as deprecated, so drop the related test case. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-5-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 24972666a7..1874bea086 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -607,11 +607,6 @@ static void test_generic_valid(const void *opaque) unsupported_params_init(mc, &data); smp_parse_test(ms, &data, true); - - /* Unsupported parameters can be provided with their values as 1 */ - data.config.has_dies = true; - data.config.dies = 1; - smp_parse_test(ms, &data, true); } object_unref(obj); From patchwork Sat Mar 9 19:22:01 2024 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: 779177 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853067wrt; Sat, 9 Mar 2024 11:29:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVh+XF2wMdRzmz7zD+06aHHnp7L+dha5VEXdT7z3ZUMUZ0Sm1ZPTiu5vPQeVgkJ9hGV3EJAWev9jLDH5r3AuALo X-Google-Smtp-Source: AGHT+IET9YsxRsxwvTn5METKRyqoLlM7/vMtlMuV+VZy3s5wImo4lHGW6Uzvmw2q1xLcosuli175 X-Received: by 2002:a05:6214:176a:b0:690:abb1:7e92 with SMTP id et10-20020a056214176a00b00690abb17e92mr2835669qvb.3.1710012599055; Sat, 09 Mar 2024 11:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012599; cv=none; d=google.com; s=arc-20160816; b=rQyebXokz1UfHbnV3U1dPGCG5sNFOlWh840AukgZKwEfdkuzlWN8WFnnDN8fO4b/aC qj1jRi1hIYqACaMcbpjOVldabIC76U10YhnwYAOFOti7/4e4kYA2/Un+GbIn8Pena7Ud kIhurey6r6/hD0d6IGeasq3mdvFOhUxDaLzUPVZenm8Gum68D8aD8pl3+ZnmsFwBmWEF D/3efL3JFJHPorRDlEEj/nQ/bgIxldhxtvuMMhc7oE/MaWbnyDsV5XKNhuU413JHlr1L gy6kDzRGIOaFQyV4tm3C1YbFLLoWEs9ycK+87eJK1GvOjjtZltVqSKszZi803kIFoVCo 4dIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=A6Y997HuYNvtlPcvN+964OFbkN9Qba48oYl4bNvQhQfWphkAzLCBLUaLb/uUOzFmXi +4twq6CpRP1rtaargNei52boBpmIV2GdmRpIRHzIbV7OKVVms7vIijL/AlgUOoposAsd qchXM/fs6/XIiO9N8It3WH/qumeN75NdK4bnwhYUxFTshfEi2ICFFaMuuG8ikFkhaBIO MwKbURt85GrbKAR268O/8FwatChUWuLpweK6+S4+9ZbM9y4e2T4iI3FLf54aZ3R0Aj7f GY7cmG/2cLXGh8LK/QnYcQ4eDC6l4Ysp3hyUfTQELAFAV5tgywIKcyJ7tSe6QPXCMhSP r0TQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N/fn7aln"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id qo19-20020a056214591300b0068fe843bc61si2111552qvb.80.2024.03.09.11.29.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:29:59 -0800 (PST) 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="N/fn7aln"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lf-0000gQ-0d; Sat, 09 Mar 2024 14:27:11 -0500 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 1rj2KJ-0007NN-Gk for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:54 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KF-0003Mf-Jb for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:45 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-563bb51c36eso3383410a12.2 for ; Sat, 09 Mar 2024 11:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012339; x=1710617139; 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=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=N/fn7alnSp9IdsX0dSZWScKpNNh+gwvaIuz+GllWqNE40p3+nUzNYUMqxxGqLDsBkW SY4L09EcM/AswTVjPfQlsbDbkgs3tq4fTnR+qjD6Sk2Qhm0okiO2PfRYbxmOxEPItX2V X9zNZZu6Fro9VLEaELA14czQ8KPOunIX+7N2/XDxFUYwAwCV0Pg3zW3o8a6s5bJ+/Xzf vMAqCm2IhnAF66GvjFAWhbxddPopXFaDbcRKHOngPoBWfjXlEHwesucX+Tfvl2prRX0z JMBZovSm9AWUzezluT4LMTjGIJ+O0Z+nLtvnLFwVIJ6K4XR+XP7+UiyBD6udqWwi9Ywi 9lQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012339; x=1710617139; 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=4izzVDpY+AQ8hh1OPoQkok5+Cmay4u8VvPo/ani8Qjo=; b=n0wmNcK4Jvl0XcjqN0fl20z3FjeN6tyhvhpkLBqOjYLV8eVyySO3HB1jO1rfw2J0vs iviTq6atbEHhYJ90tEPogepAaS/bEki/7IqZyQ/r3cBLbitE5nwniWoLXxzQSoD5XrZx ckWrXIj7+diqNPti0tMidvyq03+bHiTbeCqYIPIFj/xEFVhXCltQuQAM6KxXVFrODpPd T9M5zM89r3HyHSl7XGEGNCH/6SAyDtb+FgT7UtGlCZu0cyAONmi6QbgH9Yzk58umn039 JEa0i42pSjWLTw1hax9j9/7UHP8ZxRuoYp9zrfYWpHvMXbW1zaxrU9gMFCTLvR6M7Gvk /ZoQ== X-Gm-Message-State: AOJu0YxgZgDXxnRPBwazW/HX6U9OCBpz5F/Nk+U6BOM1j01UYzczfC4c 3OTZkvSfq+mBbUSV5HbUZXM3d5MLGw7VcnBCwxlOly9WXd5qmKMhUpMfxNZgBMc7f6QWj0G3YFQ g X-Received: by 2002:a50:cd45:0:b0:568:2578:f520 with SMTP id d5-20020a50cd45000000b005682578f520mr1778835edj.35.1710012339700; Sat, 09 Mar 2024 11:25:39 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id n1-20020aa7c441000000b0056452477a5esm1183979edr.24.2024.03.09.11.25.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case Date: Sat, 9 Mar 2024 20:22:01 +0100 Message-ID: <20240309192213.23420-35-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=philmd@linaro.org; helo=mail-ed1-x52b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Use MAX_CPUS/MIN_CPUS macros in invalid topology case. This gives us the flexibility to change the maximum and minimum CPU limits. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-6-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 1874bea086..84e3422774 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -323,15 +323,21 @@ static const struct SMPTestData data_generic_invalid[] = { "sockets (2) * cores (4) * threads (2) " "== maxcpus (16) < smp_cpus (18)", }, { - /* config: -smp 1 - * should tweak the supported min CPUs to 2 for testing */ - .config = SMP_CONFIG_GENERIC(T, 1, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 1 + * The test machine should tweak the supported min CPUs to + * 2 (MIN_CPUS + 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MIN_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 1. The min CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 2", }, { - /* config: -smp 512 - * should tweak the supported max CPUs to 511 for testing */ - .config = SMP_CONFIG_GENERIC(T, 512, F, 0, F, 0, F, 0, F, 0), + /* + * config: -smp 512 + * The test machine should tweak the supported max CPUs to + * 511 (MAX_CPUS - 1) for testing. + */ + .config = SMP_CONFIG_GENERIC(T, MAX_CPUS, F, 0, F, 0, F, 0, F, 0), .expect_error = "Invalid SMP CPUs 512. The max CPUs supported " "by machine '" SMP_MACHINE_NAME "' is 511", }, @@ -575,8 +581,8 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) MachineClass *mc = MACHINE_CLASS(oc); /* Force invalid min CPUs and max CPUs */ - mc->min_cpus = 2; - mc->max_cpus = 511; + mc->min_cpus = MIN_CPUS + 1; + mc->max_cpus = MAX_CPUS - 1; } static void machine_with_dies_class_init(ObjectClass *oc, void *data) From patchwork Sat Mar 9 19:22:02 2024 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: 779167 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852555wrt; Sat, 9 Mar 2024 11:27:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFKI4gcYIieBaQVyJxOxXD8bQ+LGgaG+3++sDuIOrgp2tmGYCP5TmbiwJ6aM23pbNK/oFotQ7NxQKgyy83+X24 X-Google-Smtp-Source: AGHT+IEv4EfwCQsJvS2gVW/G0kvSAww9OFoRNFvFy6GA9ecSLzVYDJp3Fb35K93PlbW3LU2i2sVd X-Received: by 2002:a05:6358:2918:b0:17e:6906:51af with SMTP id y24-20020a056358291800b0017e690651afmr900416rwb.15.1710012463299; Sat, 09 Mar 2024 11:27:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012463; cv=none; d=google.com; s=arc-20160816; b=Dbs0/qSzbdFz2bai+9x6+vpsRhebuWnmzkP/VoaAvnv3qQMLX/mdbnumLhFsECWFeP /rYT1yiEAm79lH3QI/CK/1hYiaDOzWgOSu0j7KgcNZC/vRURjuuUW0Cp7ypmYk4o+bfg s0vaBGEEbsOMQZqpyHumjwCa8UoBO3zaPLDd8z4e4wDplTOH+DjyS0VjLELKRTJHHBVp mOzRIzd+6wVpwIr9hLTNgiJ8fO4GDAK+uR/M8OtXAz477XHhdWGeARMAkNKOHf54NSui c9F0SlFuiFfzNHbrBdK4AOdfGm8pwUBoXb6AUXDhvVI9k/oF5ClhywSU1mgBV2YYw/VO wA/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=b8wT84tp5Ct3Koz7/1+DQ3KNhe44GTMwlt4WEbo2CyY=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=cZYM6WAD7HRdqt/uqHfR26usGvilFvEiQFo59cGT0BTPqej8juvD7+oCQ+SDr0REQw tuFGhGgKNNjitPdEGPxGRBqSrN1hn+AUu7PIiI5ZEx3OnI7cV/4TeYO6q+K5p6iMzfxG 9jGFi8xedy7TEpI3f9J4KmWiVjUPqNHkmy0MiAam/u98WjfSxmxk0SLehc/F33Z5q02U lwuOKAi0g3Mmmk+B9IKD3dBwUxWopthu8MSUItDOTgbvdUL/SCzMe8BKtt0sM7FozfO4 wg7vf3KjtU4yBMsArDl6aCJPxNboHgBW5IwRI0394wfv14zwyCFabGz2CkjziegOecDG b6JQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wTAGvnU7; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u21-20020a05622a199500b0042ef356793fsi2205700qtc.137.2024.03.09.11.27.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:27:43 -0800 (PST) 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=wTAGvnU7; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lk-0001HA-Hq; Sat, 09 Mar 2024 14:27:16 -0500 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 1rj2KL-0007NQ-T5 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:54 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KJ-0003NW-BF for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:49 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5684db9147dso112896a12.2 for ; Sat, 09 Mar 2024 11:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012345; x=1710617145; 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=b8wT84tp5Ct3Koz7/1+DQ3KNhe44GTMwlt4WEbo2CyY=; b=wTAGvnU7iv8knhIc9QM/CApgXDYdur06A/RIpA3EnwHXT30pnBduKbE8jxFdDLpkm8 lKPVdEEVsYEY5Ffp4AlujOMQq4YC4QQVT/iuaCOPX0n8s2Ti8SjVReIMFqqifIiYakXn LxLwPTh9Rn6zVNmvt/pPFx4LX+iSOnj6XTHgkt60EiI6Jr5g7/4DB4ozzN3m3FWi0eNY 5lkT1xHtK6mNb3K/1ZOdONNWx0ZKZj2VFrNjISN+UAmNAkMczQ5sIBou6XRYZT/BQFhU 0PeDplfTF1n2shOSLdJkXfGgPI/MVDEjRkDCvUSB73NyfGw6ERPFJa0De+o32dxfJAM2 rZbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012345; x=1710617145; 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=b8wT84tp5Ct3Koz7/1+DQ3KNhe44GTMwlt4WEbo2CyY=; b=T9sqak3maeybx/l8eGdgvHUfpD/fOwH7jSNriT7gtd5LCGMShp//ZJiMu+z+F0vBfw GoojSQkpvZWtcUeHVpdZVQcsOdu9pQmmpbXFKSrklcMdC1kzhMHAKhf+AsiLZ3YduhNC dpcx/zs5Zd4baCjXtHHktPKfHWpvs0LP92wvm4gQh1v6m4/D28h0tKcVHWYzYry2r7rt 2o5nChgAdk83k3tfW9H5Q+mNGWC0/1Se6WBJLfInKe3Xosmx/AstrHbmTcJ5TOu8v7ar b8+VTVCcFcRs2JHPpxZPyORj755VzhMEm1z9j+b5NVA8xj+9H0sUkKZoi++S7U2KPAsQ h9Ow== X-Gm-Message-State: AOJu0YyC6inb2g9IMx8z8I5shx05j7ZId2AeKZ+/d2D92Onf3q1Qkcc8 KaxMiXYypolXTnzEv8BnWj1CTWfhEOo/suzUJWOvFQ7DEjlrvLmPHEDvXAgACI9t5KGqquN50zd o X-Received: by 2002:a50:ccd6:0:b0:566:d274:a41d with SMTP id b22-20020a50ccd6000000b00566d274a41dmr1546436edj.42.1710012345670; Sat, 09 Mar 2024 11:25:45 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id y18-20020a056402359200b005648d0eebdbsm1143695edc.96.2024.03.09.11.25.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 35/43] tests/unit/test-smp-parse: Bump max_cpus to 4096 Date: Sat, 9 Mar 2024 20:22:02 +0100 Message-ID: <20240309192213.23420-36-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Zhao Liu The q35 machine is trying to support up to 4096 vCPUs [1], so it's necessary to bump max_cpus in test-smp-parse to 4096 to cover the topological needs of future machines. [1]: https://lore.kernel.org/qemu-devel/20240228143351.3967-1-anisinha@redhat.com/ Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-7-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 84e3422774..2eb9533bc5 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -20,8 +20,8 @@ #define T true #define F false -#define MIN_CPUS 1 /* set the min CPUs supported by the machine as 1 */ -#define MAX_CPUS 512 /* set the max CPUs supported by the machine as 512 */ +#define MIN_CPUS 1 /* set the min CPUs supported by the machine as 1 */ +#define MAX_CPUS 4096 /* set the max CPUs supported by the machine as 4096 */ #define SMP_MACHINE_NAME "TEST-SMP" @@ -333,13 +333,13 @@ static const struct SMPTestData data_generic_invalid[] = { "by machine '" SMP_MACHINE_NAME "' is 2", }, { /* - * config: -smp 512 + * config: -smp 4096 * The test machine should tweak the supported max CPUs to - * 511 (MAX_CPUS - 1) for testing. + * 4095 (MAX_CPUS - 1) for testing. */ - .config = SMP_CONFIG_GENERIC(T, MAX_CPUS, F, 0, F, 0, F, 0, F, 0), - .expect_error = "Invalid SMP CPUs 512. The max CPUs supported " - "by machine '" SMP_MACHINE_NAME "' is 511", + .config = SMP_CONFIG_GENERIC(T, 4096, F, 0, F, 0, F, 0, F, 0), + .expect_error = "Invalid SMP CPUs 4096. The max CPUs supported " + "by machine '" SMP_MACHINE_NAME "' is 4095", }, }; From patchwork Sat Mar 9 19:22:03 2024 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: 779186 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853506wrt; Sat, 9 Mar 2024 11:31:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVrN84zlJJtz9r354mpg9wvPgu8OECX0j4DrlcrPv1AT56ZU/RoDWPbO1KKQRKDI304bMTFP3U0Zbh6A3M4y6HC X-Google-Smtp-Source: AGHT+IGSwty6p4Rzf6majUkaLKrZoORCRgxLWGC96apUezl0CS90rbExqB0U5TY85RSf5QS6M/L9 X-Received: by 2002:a0c:e2d0:0:b0:690:c678:fa00 with SMTP id t16-20020a0ce2d0000000b00690c678fa00mr1706357qvl.8.1710012703753; Sat, 09 Mar 2024 11:31:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012703; cv=none; d=google.com; s=arc-20160816; b=f+Cu12LKcNZ+mxroJiT7gKYqwnsNuPFfXZjxi+l0wd2fQgaTM+Fe1F9LKz78LBraN4 hytpOtLxXzINXZJxasC8Phj+jA2E0ddVToe8tqJEqQfBDX3YH7FGmYVy53d3NZhozh6/ 3BA+hDW4TGEjcnJn35uLiEzdZVMtpQN1QaYcxaT/XPmSlf/EB3SFQY0qU/nkQul7II4m Kmf1JNq5L/Fx6Uw0CyGF4JF1KYmCVhgPAVq8Mr23FFG5xDD7iQnvpbuzjNQFzNWf1mvI B34WQdncAX6qDH/kVM3gtrxe/ed2tIiHn+KAWpO4FB0NKvppDCvDmlFxBS6Q2Jft33TR 7Mjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=O8i9QPEOlWhmU7xWF5BCURrysJXNiI85mOLr+pl+Sq0=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=TOxgtAOKkAHs0ygPjKFneHqJt0DdQRlKaOwoMoSh5m5+/0w/yHe1/zXSh7SehVegqD Xb1w0REbzNc6Da0TjOjjBKnAKTna8BI2vhj4ArgyqSeY1FHnaawl8tp7kneYBbBgpgK8 4RaMO3h8YwgDVaQt0t2mUFdXHLvPKRa3RzyO6gUpr6WTqFC3ymmMj7Rh/s+GEqArjh0D ulhHwhVsotxvogT208gYnl//9eGNwVwMKu0gHg2Bvt6RoMTLYnZlxLK8VHEGCA8aFPsf XqmGibBNKY08PqdolsPX6uEcDXcVDQRrvfWjYC4K9fxManvIm7ukwbWJDk4ohxnFggqr E4cQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y4zrCr6N; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fo15-20020ad45f0f000000b0068f3624fa5fsi2142197qvb.302.2024.03.09.11.31.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:43 -0800 (PST) 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=y4zrCr6N; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lh-00012V-FM; Sat, 09 Mar 2024 14:27:13 -0500 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 1rj2KR-0007Qj-5m for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:03 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KP-0003OS-HI for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:25:54 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a4604c8bd61so45709166b.2 for ; Sat, 09 Mar 2024 11:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012351; x=1710617151; 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=O8i9QPEOlWhmU7xWF5BCURrysJXNiI85mOLr+pl+Sq0=; b=y4zrCr6NEJnj7wLuGdTWAvRnxx1fixFoDxypupMViHonccW3SwDnTGeJdGvu3+mzPk Kzf5h7ottiBT01ztt/V8/cXhSXfxjZ/be5eoNh3MZRBTrwqpr0jGGJhwZjd57wlyQcMq 3n+XEHhxy9/3K/zLEP8PbS1X4El+1X/KEUzT2viklt02T0nlDXerB283M/aQhplOgsS3 bF69AaDWEvKc+QL3uX4eU5PKqlw33hbnxRG4lRV0MGmZWR4YtE5beW76cI6FhhVvIZq4 3zXoUPXQuJwhFPXGrNiLZNiqD2heIUzXML7VqInfDn5Z7BTpQEt9MZ9rzzRZgMer+wIj k9mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012351; x=1710617151; 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=O8i9QPEOlWhmU7xWF5BCURrysJXNiI85mOLr+pl+Sq0=; b=PqIriR2bn7YFzUHJtgomHRyIh8cYHokhoAM8VtVLAfGRG2C1yvhxvSyAynUM1Ap5aZ XXjvuXPzUzOOEbubjvnS72zgEH1SdtvILOo9RMdu0ZLuZlcJuPzDIgbVCLnYWr05P0vk JQlm9skbfSfWTSZRmPK822y+w1rND+xl2J/IXvdTTkP1xpsv7aHfIy4e4+ahMDuhYcM2 FeCJU2M/MzwQNcMYd0HYWsOXS2kRjJkrrus60gKNI1yd50sZKX+29Eli/RDCZLaaOrQ5 kJ9n1loPOBLdQatRZlI05RfBZ+WDEQUhnmt+jZjWURM1cQgKahSWcxvnVRVaeaCYpC+3 x6zw== X-Gm-Message-State: AOJu0YwsJTtL6goT3yY7eTCNZRuMYxjWt2ilIWm56EQ3S+8dO7YSa2BO 4amYlWzyzMAx6hdPLfsVOciHnk3n6DpuTbLa+I8cuMSfqyYzxsX92oC/bIUc5QVP99F9VjRPgPX 9 X-Received: by 2002:a17:906:390:b0:a45:9347:e3d6 with SMTP id b16-20020a170906039000b00a459347e3d6mr1362000eja.66.1710012351548; Sat, 09 Mar 2024 11:25:51 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id lr1-20020a170906fb8100b00a442e2940fdsm1186112ejb.179.2024.03.09.11.25.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:51 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 36/43] tests/unit/test-smp-parse: Make test cases aware of the book/drawer Date: Sat, 9 Mar 2024 20:22:03 +0100 Message-ID: <20240309192213.23420-37-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=philmd@linaro.org; helo=mail-ej1-x635.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, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Zhao Liu Currently, -smp supports 2 more new levels: book and drawer. It is necessary to consider the effects of book and drawer in the test cases to ensure that the calculations are correct. This is also the preparation to add new book and drawer test cases. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-8-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 2eb9533bc5..f656bbb6da 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -384,6 +384,8 @@ static char *smp_config_to_string(const SMPConfiguration *config) return g_strdup_printf( "(SMPConfiguration) {\n" " .has_cpus = %5s, cpus = %" PRId64 ",\n" + " .has_drawers = %5s, drawers = %" PRId64 ",\n" + " .has_books = %5s, books = %" PRId64 ",\n" " .has_sockets = %5s, sockets = %" PRId64 ",\n" " .has_dies = %5s, dies = %" PRId64 ",\n" " .has_clusters = %5s, clusters = %" PRId64 ",\n" @@ -392,6 +394,8 @@ static char *smp_config_to_string(const SMPConfiguration *config) " .has_maxcpus = %5s, maxcpus = %" PRId64 ",\n" "}", config->has_cpus ? "true" : "false", config->cpus, + config->has_drawers ? "true" : "false", config->drawers, + config->has_books ? "true" : "false", config->books, config->has_sockets ? "true" : "false", config->sockets, config->has_dies ? "true" : "false", config->dies, config->has_clusters ? "true" : "false", config->clusters, @@ -404,10 +408,10 @@ static char *smp_config_to_string(const SMPConfiguration *config) static unsigned int cpu_topology_get_threads_per_socket(const CpuTopology *topo) { /* Check the divisor to avoid invalid topology examples causing SIGFPE. */ - if (!topo->sockets) { + if (!topo->drawers || !topo->books || !topo->sockets) { return 0; } else { - return topo->max_cpus / topo->sockets; + return topo->max_cpus / topo->drawers / topo->books / topo->sockets; } } @@ -429,6 +433,8 @@ static char *cpu_topology_to_string(const CpuTopology *topo, return g_strdup_printf( "(CpuTopology) {\n" " .cpus = %u,\n" + " .drawers = %u,\n" + " .books = %u,\n" " .sockets = %u,\n" " .dies = %u,\n" " .clusters = %u,\n" @@ -438,7 +444,8 @@ static char *cpu_topology_to_string(const CpuTopology *topo, " .threads_per_socket = %u,\n" " .cores_per_socket = %u,\n" "}", - topo->cpus, topo->sockets, topo->dies, topo->clusters, + topo->cpus, topo->drawers, topo->books, + topo->sockets, topo->dies, topo->clusters, topo->cores, topo->threads, topo->max_cpus, threads_per_socket, cores_per_socket); } @@ -473,6 +480,8 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, if (is_valid) { if ((err == NULL) && (ms->smp.cpus == expect_topo->cpus) && + (ms->smp.drawers == expect_topo->drawers) && + (ms->smp.books == expect_topo->books) && (ms->smp.sockets == expect_topo->sockets) && (ms->smp.dies == expect_topo->dies) && (ms->smp.clusters == expect_topo->clusters) && @@ -564,6 +573,16 @@ static void unsupported_params_init(const MachineClass *mc, SMPTestData *data) data->expect_prefer_sockets.clusters = 1; data->expect_prefer_cores.clusters = 1; } + + if (!mc->smp_props.books_supported) { + data->expect_prefer_sockets.books = 1; + data->expect_prefer_cores.books = 1; + } + + if (!mc->smp_props.drawers_supported) { + data->expect_prefer_sockets.drawers = 1; + data->expect_prefer_cores.drawers = 1; + } } static void machine_base_class_init(ObjectClass *oc, void *data) From patchwork Sat Mar 9 19:22:04 2024 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: 779181 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853385wrt; Sat, 9 Mar 2024 11:31:14 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVaLq9ofrcrFD0C0SVfEPBApXErGRYKgME/d65JmqPhyQ62dSlN//eJ63PCS/0Rqn4X74fvGbiv7+2yN4oNtK58 X-Google-Smtp-Source: AGHT+IGfhkiwNFmEWi7k2ZBzCp5gX0Ng8tYd0zLiQ/MBi0HgvogDoQb7FP3joJd291Py7IaNWcVb X-Received: by 2002:a05:6218:2811:b0:17b:5c97:28e7 with SMTP id vv17-20020a056218281100b0017b5c9728e7mr3356980rwc.5.1710012674409; Sat, 09 Mar 2024 11:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012674; cv=none; d=google.com; s=arc-20160816; b=0HTzn2D0jm+c47keeeCDtFcrM8ThWM0Xq7rEe10vOWqx0xZD6+r9K+IIo6s2CuHQtJ 8mEkL8tnHZw7kFiXsdFNproG0+Z9d+EHCd5/zd9rQemplEtnzc8V3BETotCVul1w+umh QMZWc+b9SdzOw8G3lDKuLYYigE6gUqbNxHn32OT5vPIr20QHhWgDSZtun2vtzO9iqNkW 0xVsNy6C8PWNAa7LPxcyiFYcmtvnY39aEwXDj8+PS6pm1ClNvON/sRonlvEiz6mouHKp bV5Zol71BerJUFLOeUDzg5EA/SBVBmBQF3Ak+2RFkcl9XEExrETlaVffNQMGyFyjtIv6 hqbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=81Sv1vN+6ujCHrYNAV0wa7bFS6ihhdM5ooxz7PBUBM8=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=qo2iIgUgM4yyfJcYuEOqF/AJQ3x5fA6mQ1UgtjP97yxRkk2HK9vo07ST9JhFtENDxx xyzEkjxC6VHlMmjzZGZ6P/ucJZi0+jrnU0+R5bQzb4TIgnC+wEDgKnDY2J3XRPzFzHWD qXfDtI2mSO16ygVpapIL929atm2pBL2GWueHHAIvx2dPhQzJdlPohtBaQj5836uAYspg lGVKUQUXRWvKPyVcMvZeC0wVDd0zi/wEQPNv6UR4oUZr3QXqV2uT1MprU3qw23dBbzSZ K3C+jhp0XTDIEeyX+pwHs+IQAGYz4B8F7VRDXsEll5G2Tga8QXJLUeW7EFY9RrfsMYOK qweg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fKeoVA4g; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bp17-20020a05620a459100b007882a39457csi2281380qkb.552.2024.03.09.11.31.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:14 -0800 (PST) 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=fKeoVA4g; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lk-0001Hr-Kx; Sat, 09 Mar 2024 14:27:16 -0500 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 1rj2KZ-0007Um-Lu for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:07 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2KW-0003Ox-5j for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:02 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a45ba1f8e89so379473266b.1 for ; Sat, 09 Mar 2024 11:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012357; x=1710617157; 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=81Sv1vN+6ujCHrYNAV0wa7bFS6ihhdM5ooxz7PBUBM8=; b=fKeoVA4gWnUf5UNcyQSH89SyThg7TU9J/i+i/72XTDUES6vMKjUD+SKx0LF8WqVYBR dXJqgyADJlUTROu/OORCev5+fYkSU49SC915XU9FNzb0pNimhjyIiHSQzJO6X2EB2z92 wen8Mj8kSpLuVkW2Pven6UpJTLeBfsaWyaww/oU9UACAkp32nFmS2xapskgiDscb7hcr qLJkKFLXhBByzevGTA9xEXJVj/6c8v/FqXHWs7TPRhcPkpcC46ogTPdC0rKUN6t72+Hl 0EXSVtf8+X75cUCJ48+1RaTbnH10x91gH5PZemtnPDJuo5rUoiMamufbCvFtcj12PweH cybA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012357; x=1710617157; 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=81Sv1vN+6ujCHrYNAV0wa7bFS6ihhdM5ooxz7PBUBM8=; b=bB92xkgODswx6KcyEeiWlm5mpTLaYzVZ822YNRtQ3k+DhShC704VMz4Mz9g0THz/Fk zjMrwPUCKsP+BXRUE67x06UdbvSI3HVqVWeox3fkqFeWOLTcZuhvebz8c6GUOBNM4tSF +0GnqEfMzXJUeI6zQyrARCuSjGgzciWjoeyXN8MXG52g6IQKS9CuUDOka4sFat5ss5N9 fQgqZdQlmkOoW6w4rcpmodapOGtCyNUdbFi6as1oc6S50yXbDo3ra4kts61cbyyid5/J 3/2yTNVNQtUSRKU/R1C1odviLvmHDwmMmo1tqqOdljVjTDdmrLAzk8SgQbkRWBSa/9n3 Vw2g== X-Gm-Message-State: AOJu0Yw8dXScIIBlzJnzdSzzc3wvODG+z5IlruEvlW2kauswbCXdvyrW 75dlmtZtCplCoKOutCN553RjgLVTNCuKDGSX8SnfWN35Gso5qrmWxVHyr8mxjUWRMHIWLzlFD0r e X-Received: by 2002:a17:906:ad94:b0:a45:8ab6:5f3c with SMTP id la20-20020a170906ad9400b00a458ab65f3cmr1404683ejb.45.1710012357525; Sat, 09 Mar 2024 11:25:57 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id zh16-20020a170906881000b00a44d01aff81sm1178678ejb.97.2024.03.09.11.25.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:25:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 37/43] tests/unit/test-smp-parse: Test "books" parameter in -smp Date: Sat, 9 Mar 2024 20:22:04 +0100 Message-ID: <20240309192213.23420-38-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Although book was introduced to -smp along with drawer by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-9-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index f656bbb6da..090238ab23 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -75,6 +75,22 @@ .has_maxcpus = hf, .maxcpus = f, \ } +/* + * Currently a 5-level topology hierarchy is supported on s390 ccw machines + * -drawers/books/sockets/cores/threads + */ +#define SMP_CONFIG_WITH_BOOKS_DRAWERS(ha, a, hb, b, hc, c, hd, \ + d, he, e, hf, f, hg, g) \ + { \ + .has_cpus = ha, .cpus = a, \ + .has_drawers = hb, .drawers = b, \ + .has_books = hc, .books = c, \ + .has_sockets = hd, .sockets = d, \ + .has_cores = he, .cores = e, \ + .has_threads = hf, .threads = f, \ + .has_maxcpus = hg, .maxcpus = g, \ + } + /** * @config - the given SMP configuration * @expect_prefer_sockets - the expected parsing result for the @@ -308,6 +324,11 @@ static const struct SMPTestData data_generic_invalid[] = { /* config: -smp 2,clusters=2 */ .config = SMP_CONFIG_WITH_CLUSTERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0), .expect_error = "clusters not supported by this machine's CPU topology", + }, { + /* config: -smp 2,books=2 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F, + 0, F, 0, F, 0, F, 0), + .expect_error = "books not supported by this machine's CPU topology", }, { /* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */ .config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8), @@ -379,6 +400,26 @@ static const struct SMPTestData data_with_clusters_invalid[] = { }, }; +static const struct SMPTestData data_with_books_invalid[] = { + { + /* config: -smp 16,books=2,sockets=2,cores=4,threads=2,maxcpus=16 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, F, 1, T, 2, T, + 2, T, 4, T, 2, T, 16), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "books (2) * sockets (2) * cores (4) * threads (2) " + "!= maxcpus (16)", + }, { + /* config: -smp 34,books=2,sockets=2,cores=4,threads=2,maxcpus=32 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, F, 1, T, 2, T, + 2, T, 4, T, 2, T, 32), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "books (2) * sockets (2) * cores (4) * threads (2) " + "== maxcpus (32) < smp_cpus (34)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -618,6 +659,13 @@ static void machine_with_clusters_class_init(ObjectClass *oc, void *data) mc->smp_props.clusters_supported = true; } +static void machine_with_books_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.books_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -756,6 +804,56 @@ static void test_with_clusters(const void *opaque) object_unref(obj); } +static void test_with_books(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_books = 2; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when books parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.books = 1; + data.expect_prefer_cores.books = 1; + + smp_parse_test(ms, &data, true); + + /* when books parameter is specified */ + data.config.has_books = true; + data.config.books = num_books; + if (data.config.has_cpus) { + data.config.cpus *= num_books; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_books; + } + + data.expect_prefer_sockets.books = num_books; + data.expect_prefer_sockets.cpus *= num_books; + data.expect_prefer_sockets.max_cpus *= num_books; + data.expect_prefer_cores.books = num_books; + data.expect_prefer_cores.cpus *= num_books; + data.expect_prefer_cores.max_cpus *= num_books; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_books_invalid); i++) { + data = data_with_books_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -780,6 +878,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-clusters"), .parent = TYPE_MACHINE, .class_init = machine_with_clusters_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-books"), + .parent = TYPE_MACHINE, + .class_init = machine_with_books_class_init, } }; @@ -803,6 +905,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_clusters", MACHINE_TYPE_NAME("smp-with-clusters"), test_with_clusters); + g_test_add_data_func("/test-smp-parse/with_books", + MACHINE_TYPE_NAME("smp-with-books"), + test_with_books); g_test_run(); From patchwork Sat Mar 9 19:22:05 2024 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: 779182 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853395wrt; Sat, 9 Mar 2024 11:31:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUcqvMq3xQeEcXKyzQDhNzGU/47ozFhoUYpRkmsRIYfEeuNzpiqo0Ms6k+LiNyPv7gazBkr7prpfpTtKwO0NcSj X-Google-Smtp-Source: AGHT+IFJS4lW85SLhnQnQMs7HaQrLm0rdbMgmy+ikWw57Wv9zcOJ/wNYE8QMxTm+AH29UcEps6jC X-Received: by 2002:a05:6358:560f:b0:17c:11b4:9cff with SMTP id b15-20020a056358560f00b0017c11b49cffmr3225965rwf.16.1710012676781; Sat, 09 Mar 2024 11:31:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012676; cv=none; d=google.com; s=arc-20160816; b=Cc88cfPsG75CmBHkhhY0yoy+UMyt/tLIMiKUUDyv+TjNrBVFfSirDAJJHqaCZT1k+V YgP0Nm1bqNA4WXpt5yMiuni8ANHRA1nC9InTdZ0nSDMF5DTP+ADDaNLGpnk1UP72M5MX OjE30TVAC8AKYCVDcK5sUsOTusUj6SgsOSCdw3W2VwBZiVqnCi6Uds7V8XGvQgdqcves jbSD7I7l1Ki0gPp4gKKSxlx3ReaJFpInmQdTR7x0hvt+uLo47w2kYzv+Uz6eCSFiz6y3 cqRKMBKDJnzfpb0Te1AtKYm5fibETErcCtgvThuGbNzEshcC2yfCIPSDl7u6BIkb4ffI dfgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=tvU56TlvWLPvO+A3q9kkdbysgtf1x6xX0zRrOdKGxe8=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=0cKoAb9SB1IE4XyW58/LdQCSaq4clt5lnumm8v6v0ZlYjbsv+PbZ9LLTAoUiAMu+wW XaD23E6BPehXB0Ue+JSdw7lbOFQcA6SMi6eLy8d9Uq+Qsfh7Vj1nsANlaEmviQYo6ojR dT9Nb7gIdn8S0A0bdJgNRty0Z9qeSBusZYQUykjzDGe3FQA22gzve9SUcgNxrtXjb7Yv cXWpX4g4TctB73VeqVwjJCg8nMPWhv+YzySsli4aKqXBWxloSYZ59KHUqBJAmJeTnw/y EnVQNYQHe9nvuBQHcn5zShM7jClF44QbrkHkFKX9qT5Ty7XOhz2RxrfY5aPL3mI7vyte MjEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dUAXyuSa; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id mu2-20020a056214328200b0068cb7c10125si2059514qvb.141.2024.03.09.11.31.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:16 -0800 (PST) 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=dUAXyuSa; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lh-00015V-TF; Sat, 09 Mar 2024 14:27:13 -0500 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 1rj2Kp-0007nW-90 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:25 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Kb-0003TQ-7e for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:07 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5684ea117a3so97730a12.0 for ; Sat, 09 Mar 2024 11:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012363; x=1710617163; 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=tvU56TlvWLPvO+A3q9kkdbysgtf1x6xX0zRrOdKGxe8=; b=dUAXyuSaH80hBiFEDuHX/ug9wrvyJbsAkRoLQgaLUJM8oR1PicFyBFvTbwU4mhbAHc hp3aiQ9ZuTV0Yz7WaYZ1lmn/P6kcC1sDO96zgd3nsr3Dy7PVWvOhbT6xTguWf0P2zpQa uQDS0/M6+N1kXD8QmYbQP0wMuS4Tmyd7VzNdKEDiQABH1DJtXvjF/1zX6YVkByFBMOnF rQPVW721B0kX7brrFfOS8J9KIr4EihOyfbcVlKSWrOpCa1j9UmQQDnR/RxAP8szw5Pdf 5emPGM5f4GAV6JW4yHr7wllFiyvzX6M28s79hIu+xjNWrejtezY8YYr0e0351v+ShJy/ TNWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012363; x=1710617163; 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=tvU56TlvWLPvO+A3q9kkdbysgtf1x6xX0zRrOdKGxe8=; b=dsUAxQe87/8q5W9BSWmX23v1VU/m11wCc34b4jyHjDNPWZlAhPyyFSm3TMofRyz7bv w5wcynjx7hJTMIi8nHxIUAqidNOhEa6X07sOWECuiivIv+962udu4pBPJiecttuaYxcC fSFTWK/fAwI59ORMKETg8Pgk0eNBVaKl7KYDY5ZHphz06PjU2xTYg6ZWj+N1X19Zs6Hl t63wvA1p0jwDdSuSKbsUXX+j5i2NDs1eq7oHLXUq0mAZEymwcabRE7Lyzx2iKg4XuMvh vtGWGqd7YU1H3YzXYhxh46xQasskVM9SOQtGxYbvthdtqd+UUpFUdpvAb3kCubGR21AM P32Q== X-Gm-Message-State: AOJu0YwjrWxg/uP5nLbTcQqPTH/e8ziiZkyFiRVNUv+bJsyTcNwxTezf JYzzUHlbg8t2IhnhJK6my1dg7j2rgNHyiLouW115AmMyyfLcRTRVDtrk72C4AtWJvMcUCJpMLwG / X-Received: by 2002:a17:907:c783:b0:a3f:29c:c8fa with SMTP id tz3-20020a170907c78300b00a3f029cc8famr1757717ejc.66.1710012363488; Sat, 09 Mar 2024 11:26:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id d25-20020a170906371900b00a4410598eebsm1177473ejc.67.2024.03.09.11.26.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 38/43] tests/unit/test-smp-parse: Test "drawers" parameter in -smp Date: Sat, 9 Mar 2024 20:22:05 +0100 Message-ID: <20240309192213.23420-39-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Although drawer was introduced to -smp along with book by s390 machine, as a general topology level in QEMU that may be reused by other arches in the future, it is desirable to cover this parameter's parsing in a separate case. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-10-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 89 +++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 090238ab23..aea1b2e73a 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -329,6 +329,11 @@ static const struct SMPTestData data_generic_invalid[] = { .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0, F, 0), .expect_error = "books not supported by this machine's CPU topology", + }, { + /* config: -smp 2,drawers=2 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 2, T, 2, F, 0, F, + 0, F, 0, F, 0, F, 0), + .expect_error = "drawers not supported by this machine's CPU topology", }, { /* config: -smp 8,sockets=2,cores=4,threads=2,maxcpus=8 */ .config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8), @@ -420,6 +425,26 @@ static const struct SMPTestData data_with_books_invalid[] = { }, }; +static const struct SMPTestData data_with_drawers_invalid[] = { + { + /* config: -smp 16,drawers=2,sockets=2,cores=4,threads=2,maxcpus=16 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 16, T, 2, F, 1, T, + 2, T, 4, T, 2, T, 16), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (2) * sockets (2) * cores (4) * threads (2) " + "!= maxcpus (16)", + }, { + /* config: -smp 34,drawers=2,sockets=2,cores=4,threads=2,maxcpus=32 */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 34, T, 2, F, 1, T, + 2, T, 4, T, 2, T, 32), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (2) * sockets (2) * cores (4) * threads (2) " + "== maxcpus (32) < smp_cpus (34)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -666,6 +691,13 @@ static void machine_with_books_class_init(ObjectClass *oc, void *data) mc->smp_props.books_supported = true; } +static void machine_with_drawers_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -854,6 +886,56 @@ static void test_with_books(const void *opaque) object_unref(obj); } +static void test_with_drawers(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_drawers = 2; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when drawers parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_cores.drawers = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers parameter is specified */ + data.config.has_drawers = true; + data.config.drawers = num_drawers; + if (data.config.has_cpus) { + data.config.cpus *= num_drawers; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_drawers; + } + + data.expect_prefer_sockets.drawers = num_drawers; + data.expect_prefer_sockets.cpus *= num_drawers; + data.expect_prefer_sockets.max_cpus *= num_drawers; + data.expect_prefer_cores.drawers = num_drawers; + data.expect_prefer_cores.cpus *= num_drawers; + data.expect_prefer_cores.max_cpus *= num_drawers; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_drawers_invalid); i++) { + data = data_with_drawers_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -882,6 +964,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-books"), .parent = TYPE_MACHINE, .class_init = machine_with_books_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-drawers"), + .parent = TYPE_MACHINE, + .class_init = machine_with_drawers_class_init, } }; @@ -908,6 +994,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_books", MACHINE_TYPE_NAME("smp-with-books"), test_with_books); + g_test_add_data_func("/test-smp-parse/with_drawers", + MACHINE_TYPE_NAME("smp-with-drawers"), + test_with_drawers); g_test_run(); From patchwork Sat Mar 9 19:22:06 2024 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: 779184 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853417wrt; Sat, 9 Mar 2024 11:31:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWdJiq/9szl8DmBgqkWukPErrdL5JI/6/T/2Jg7b9BSIBKBild5/rFZhbfJ6TeI0mKd58DCyewwjiT17wb9/bGj X-Google-Smtp-Source: AGHT+IFScNJweE6eJkLwi2u9d/yqeWfcqGjjpNryU0az50EtrPgNjcN7GgoPROaFQb33INOccOsp X-Received: by 2002:a05:620a:9:b0:788:23f1:6d56 with SMTP id j9-20020a05620a000900b0078823f16d56mr2753024qki.13.1710012681704; Sat, 09 Mar 2024 11:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012681; cv=none; d=google.com; s=arc-20160816; b=gexi8pjb4R5wdPbab7JXcADKlF/pzMyCVlTdfQ93Ny6lLvEw9hPsE/sCWIt0M9MsP3 slQBVZFsnQVIxJKtpHYaBdmOvOzcU2GQi3qA6gK5OcCrIhrjW+vw0Spjzgd/aG7vQ7Pa /N0sPvf83MUuPM7pwVBGKzLwupwkKlrQM8hg4C0yQ5293uTurNPlPHxrjqejj0/C2CT+ JLWtHmeV+ytjui0+L+2GXw/9dKQV93raSXrodliKz8vVg+qWQjH3wH2+TdAZJF5cEAos QiUtjbDctA2sgv1pkaAfwFZxoTOTO8ZeYyTAr2TYMWr6N9MyBizNJzHmlQ0N0qCkammq Fu3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=iUC4gt3lxXhDXO4ThAk9t583cQlzaBs4BIxFd2rtuRE=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=vE+o6PI6IBAvJSkzyEaJMP71xtpE9iFvEqMwX6727DYmRalJM4hM2sX7tkxe8MtDCd THTgih89FKV65yUVO4ywO0yyYTTDc8Makd4nddH//hnxK0Y+bQGzkx6ZXIi5RY48ulei /xxZW72HEbTmfveHqhLH5CGihdLfk9BsUKdYG77OvVvoXPxa9KAD6z2TlyJKk97SJB2U uzuDxFIBO0hNtm+UUVxay440e3KIImuI5jV1R2Ql0O647bePAvBsKliopvRkoU1ecw47 VccnYWtOkP1NQDf+gYxZanQVmNP7aaOeFTz3T6Yif1rnrpuuzpFKoGwjB4eWXg/VeCkX lmEQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mvcjzE2l; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id po17-20020a05620a385100b007882195787csi2046943qkn.182.2024.03.09.11.31.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:21 -0800 (PST) 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=mvcjzE2l; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lj-00018f-1O; Sat, 09 Mar 2024 14:27:15 -0500 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 1rj2Kv-0007t6-Sc for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:31 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Kt-0003X9-HW for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:25 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5682e8f21a7so2340316a12.3 for ; Sat, 09 Mar 2024 11:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012369; x=1710617169; 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=iUC4gt3lxXhDXO4ThAk9t583cQlzaBs4BIxFd2rtuRE=; b=mvcjzE2liCot4Hk+YGLy9r6yBJyx6dnBEujXMJiDxRuS/prYkYKnDcYUOuma6duE7s p9eyBgsXrnA/fe709cVx2vqW1ggexQd4ZkwTeKPWEzBciJiFjBTu30pYMxaWHDNrUq3W jlh4+9DforgvW5jg6O2X/STqOL44OSPDZiaRGni1lTWUwUVT6/UeW7i6CjzXHfANI4PH baktCYE+f1rn+2YD6zOy62AMPYhK7QKyF3yjrlG4Qvt3/t7rQcYOa8olExFGKcQG6+3T OFwFBgILiDfIg6x2zxPsnXrh5rFdIAORZEuL1u17Png4apBTI7m3kQNaNaIZLHnNj6Go qZCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012369; x=1710617169; 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=iUC4gt3lxXhDXO4ThAk9t583cQlzaBs4BIxFd2rtuRE=; b=B3HG3I8N6C2RDAuJvbZID7kx9lpNyCduRv5R8/RPUYYtdIDOT8xlMpx2GplNcsCjsz 0JabG/bUBshURFgFETcu2GQ8lCxCgxNGL2eAQ6MhC2BHjDiy+iWmz1HVckjGsNoI9TVv +X5RJABtLuUuJ9bWArOm4wBHiaJBeL4M5OIK3lA0nyanEQzKZdi21ip0aMtf7Pu3tOh0 wVKgWLkbAZ51o4ZbKuAXTZ9qw4uL2cbEClSM3mr83m5O8heXcCL9gDe8K60T9K4Hx+yk qpdfWkSdrOtIxK8sSdz7PlCL4mLcZND8H56asw2OJnMdVS0lICoiW2wj/fMWXEjajowq xD1Q== X-Gm-Message-State: AOJu0YxqZPTS5ZqpkpjOZ66SMTmLmthCgnz6mVBfS7Du1bThUgjiaJud YuXLQ/8RR6JcvToNBhfJWxajqTJdjDVYAdfByQpju3C5TbqDaeoIMU4t4gVb0VzgjNJuXnAiIHS d X-Received: by 2002:a17:906:f150:b0:a45:b761:2c2 with SMTP id gw16-20020a170906f15000b00a45b76102c2mr1165498ejb.60.1710012369579; Sat, 09 Mar 2024 11:26:09 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id ce18-20020a170906b25200b00a44f3fb4f07sm1172207ejb.191.2024.03.09.11.26.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 39/43] tests/unit/test-smp-parse: Test "drawers" and "books" combination case Date: Sat, 9 Mar 2024 20:22:06 +0100 Message-ID: <20240309192213.23420-40-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Since s390 machine supports both "drawers" and "books" in -smp, add the "drawers" and "books" combination test case to match the actual topology usage scenario. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-11-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 103 ++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index aea1b2e73a..0cf6115198 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -445,6 +445,33 @@ static const struct SMPTestData data_with_drawers_invalid[] = { }, }; +static const struct SMPTestData data_with_drawers_books_invalid[] = { + { + /* + * config: -smp 200,drawers=2,books=2,sockets=2,cores=4,\ + * threads=2,maxcpus=200 + */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 200, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 200), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (3) * books (5) * sockets (2) * " + "cores (4) * threads (2) != maxcpus (200)", + }, { + /* + * config: -smp 242,drawers=2,books=2,sockets=2,cores=4,\ + * threads=2,maxcpus=240 + */ + .config = SMP_CONFIG_WITH_BOOKS_DRAWERS(T, 242, T, 3, T, 5, T, + 2, T, 4, T, 2, T, 240), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (3) * books (5) * sockets (2) * " + "cores (4) * threads (2) " + "== maxcpus (240) < smp_cpus (242)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -698,6 +725,14 @@ static void machine_with_drawers_class_init(ObjectClass *oc, void *data) mc->smp_props.drawers_supported = true; } +static void machine_with_drawers_books_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; + mc->smp_props.books_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -936,6 +971,67 @@ static void test_with_drawers(const void *opaque) object_unref(obj); } +static void test_with_drawers_books(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int num_drawers = 5, num_books = 3; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* + * when drawers and books parameters are omitted, they will + * be both set as 1. + */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_sockets.books = 1; + data.expect_prefer_cores.drawers = 1; + data.expect_prefer_cores.books = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers and books parameters are both specified */ + data.config.has_drawers = true; + data.config.drawers = num_drawers; + data.config.has_books = true; + data.config.books = num_books; + + if (data.config.has_cpus) { + data.config.cpus *= num_drawers * num_books; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_drawers * num_books; + } + + data.expect_prefer_sockets.drawers = num_drawers; + data.expect_prefer_sockets.books = num_books; + data.expect_prefer_sockets.cpus *= num_drawers * num_books; + data.expect_prefer_sockets.max_cpus *= num_drawers * num_books; + + data.expect_prefer_cores.drawers = num_drawers; + data.expect_prefer_cores.books = num_books; + data.expect_prefer_cores.cpus *= num_drawers * num_books; + data.expect_prefer_cores.max_cpus *= num_drawers * num_books; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_drawers_books_invalid); i++) { + data = data_with_drawers_books_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -968,6 +1064,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-drawers"), .parent = TYPE_MACHINE, .class_init = machine_with_drawers_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-drawers-books"), + .parent = TYPE_MACHINE, + .class_init = machine_with_drawers_books_class_init, } }; @@ -997,6 +1097,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_drawers", MACHINE_TYPE_NAME("smp-with-drawers"), test_with_drawers); + g_test_add_data_func("/test-smp-parse/with_drawers_books", + MACHINE_TYPE_NAME("smp-with-drawers-books"), + test_with_drawers_books); g_test_run(); From patchwork Sat Mar 9 19:22:07 2024 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: 779178 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853349wrt; Sat, 9 Mar 2024 11:31:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVffSPsHGQdxm7eALOmd5R5yXO6tiAxSwgwnRcZ4orgjTahNn4XfxRi8eexkBKmD/enSYsSo0dldXFFamHFn1M2 X-Google-Smtp-Source: AGHT+IEstagJE5Hcs3NbCbzCJd4Y7fyB2iwCvY/eQFsgvORdyMij/UyrFIB9JcP/C95UGHq8xyPZ X-Received: by 2002:a05:6358:4812:b0:17b:ee29:40c with SMTP id k18-20020a056358481200b0017bee29040cmr3558652rwn.19.1710012667755; Sat, 09 Mar 2024 11:31:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012667; cv=none; d=google.com; s=arc-20160816; b=oI8kSiDvsMa7y6wh09j5qoimQPoHsTLCp1S+NRNbUV2IJY8TUgCND4rzVSeGVdjmnp uTv3g7I684aXmta4N+GGMR7Z5d0Ild7acglUch8CNBNN/jsaNF2BNQgqJ1lAIV/PWS6B G/Et2+FDaQazwxgw8ptEH51XMN64z0sMKFMqoaARRZtojrX+sl5pSfK0leWWwF6IsvM3 Oi/zx/d3iwN14qsjQFHiAWiRVldrmqvM0hYYnzWt61vDNy/LJdrMe6FBkGcKn2SN0xOc m8h02ykGre4q9Vuz6rcCI0JFZMnj6CWD9lRCDDEJeklr8/eq4bIy0iJ0NGc5Uc6RJsSh n20g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=ipIrH8V6fqbpfd1iET2bFWtuJpnYjFZjo9qFhl65CP8=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=uarvdniEBz75CiXBE8XO+LUTt1RWqJ9cEx2kmn9ByYfZ40WMQ+bvUCKjpQudtUzRgC Gq2Rmn9jqIXfR2pS036AI3lEQkLiD+vXqhxA+pnNiqSSNFY3lo3aCODLRRYa8kONLgd2 HzL4QhZZJMdL1UO+vW8IgIPfNhkGRhF6iZzaPiXK6mPp3/Mhnxw97EEz3o0Faxu77rT+ Qb/6Shnz5GnD41bLTlZdg8h/LU4/peHWlGq/iw0ETW3cqvMdyyqgMY0wCa1aLr1qBfSI i1Ss40n5yLUNL3YaOQplPTvvk9MZRhqrPKKWyF/erd8wjbxADsvlcZV8CKp/Id79ijqG V5Tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GjhEr7fN; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g1-20020ac85d41000000b0042ed60061c4si2288375qtx.163.2024.03.09.11.31.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:07 -0800 (PST) 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=GjhEr7fN; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lj-00019B-4P; Sat, 09 Mar 2024 14:27:15 -0500 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 1rj2Kw-0007t9-23 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:30 -0500 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Ks-0003Xb-Mc for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:25 -0500 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2d09cf00214so26152331fa.0 for ; Sat, 09 Mar 2024 11:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012375; x=1710617175; 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=ipIrH8V6fqbpfd1iET2bFWtuJpnYjFZjo9qFhl65CP8=; b=GjhEr7fNWmXoOTRlmKiVY2V+oTPMg8eEC1Ogo7zYxZuQER1irqaFXDdIHVCOQpu5dB ROv/MBJ4Wquqqt+y6zgR+mW9sB0urhNCaTS0/UxGKdwsfCLNanXJpz2m/QVuMtZZ43pK Vxmy+jnJqTMSSiRdoGbJa6snV3U1QXpg0Sub1CcStRMWuGk5MYlGlB7pcbNaO0zLxoaP WjhfOa0BTFKWbUZtHTeYgEQn9wXbCOoH7ETmI2ioZCSakjVfKOzgtR3QWyOoOUSVBG7A NocOMxpDmeKXXS+H2etCZVfHurySsJj9Ps8kpZNx3344Gu8jqTZ2WiX2x7J4DjT8msFD pmdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012375; x=1710617175; 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=ipIrH8V6fqbpfd1iET2bFWtuJpnYjFZjo9qFhl65CP8=; b=qwFfWOUA+36pXSBGRa3sJQIxIzWRBqUUTp6U71Whtqs63HR6fP07xyUVwsOzaHFDt/ zKVLsMU7eAw2bf/xm0zziw8+eT0BTY51kMYB94cMUuyGOLcRorIHod3tE5qUynWldQdh Fvaw+4Fb5af9OkC2cjZj1vzuyvxJ7txpySzSkPm6UojTjfE9A2QMXGkWrj8AXSJrstRL 091XmoBGN7to8bWYjAt1QEaro7yAEaNVnUq0dCySeLqziOydkPDLrjciVo2JI1uH7L6V IgfHOyZIcSdUgv2HMA9LE0OJlXKCKeaejxWz9woniyc7x9FlG2+uszQeq/TRv3HdOMIk s0FA== X-Gm-Message-State: AOJu0YytlyetFbElNuqpTv39o7oB0pT0KDn2lfQl5v6tuCOLy3ThQWW+ YnD0XrFV+F2SY/UkcsuS9paslfOKUQ0eaSPxguaZhroDTIvJqCeQ1jUhGmJjLxPsoYcOAJK7sbo v X-Received: by 2002:a2e:bea2:0:b0:2d3:2242:990 with SMTP id a34-20020a2ebea2000000b002d322420990mr1810214ljr.42.1710012375478; Sat, 09 Mar 2024 11:26:15 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id a3-20020a50e703000000b005661badcccesm1151185edn.87.2024.03.09.11.26.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 40/43] tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy Date: Sat, 9 Mar 2024 20:22:07 +0100 Message-ID: <20240309192213.23420-41-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu Currently, -smp supports up to 7-levels topology hierarchy: -drawers/books/sockets/dies/clusters/cores/threads. Though no machine supports all these 7 levels yet, these 7 levels have the strict containment relationship and together form the generic CPU topology representation of QEMU. Also, note that the maxcpus is calculated by multiplying all 7 levels: maxcpus = drawers * books * sockets * dies * clusters * cores * threads. To cover this code path, it is necessary to test the full topology case (with all 7 levels). This also helps to avoid introducing new issues by further expanding the CPU topology in the future. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Acked-by: Thomas Huth Message-ID: <20240308160148.3130837-12-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 143 ++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 0cf6115198..7558169171 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -91,6 +91,24 @@ .has_maxcpus = hg, .maxcpus = g, \ } +/* + * Currently QEMU supports up to a 7-level topology hierarchy, which is the + * QEMU's unified abstract representation of CPU topology. + * -drawers/books/sockets/dies/clusters/cores/threads + */ +#define SMP_CONFIG_WITH_FULL_TOPO(a, b, c, d, e, f, g, h, i) \ + { \ + .has_cpus = true, .cpus = a, \ + .has_drawers = true, .drawers = b, \ + .has_books = true, .books = c, \ + .has_sockets = true, .sockets = d, \ + .has_dies = true, .dies = e, \ + .has_clusters = true, .clusters = f, \ + .has_cores = true, .cores = g, \ + .has_threads = true, .threads = h, \ + .has_maxcpus = true, .maxcpus = i, \ + } + /** * @config - the given SMP configuration * @expect_prefer_sockets - the expected parsing result for the @@ -472,6 +490,40 @@ static const struct SMPTestData data_with_drawers_books_invalid[] = { }, }; +static const struct SMPTestData data_full_topo_invalid[] = { + { + /* + * config: -smp 200,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=2,maxcpus=200 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(200, 3, 5, 2, 4, 2, 7, 2, 200), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "drawers (3) * books (5) * sockets (2) * dies (4) * " + "clusters (2) * cores (7) * threads (2) " + "!= maxcpus (200)", + }, { + /* + * config: -smp 3361,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=2,maxcpus=3360 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 2, 3360), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "drawers (3) * books (5) * sockets (2) * dies (4) * " + "clusters (2) * cores (7) * threads (2) " + "== maxcpus (3360) < smp_cpus (3361)", + }, { + /* + * config: -smp 1,drawers=3,books=5,sockets=2,dies=4,\ + * clusters=2,cores=7,threads=3,maxcpus=5040 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(3361, 3, 5, 2, 4, 2, 7, 3, 5040), + .expect_error = "Invalid SMP CPUs 5040. The max CPUs supported " + "by machine '" SMP_MACHINE_NAME "' is 4096", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -733,6 +785,16 @@ static void machine_with_drawers_books_class_init(ObjectClass *oc, void *data) mc->smp_props.books_supported = true; } +static void machine_full_topo_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->smp_props.drawers_supported = true; + mc->smp_props.books_supported = true; + mc->smp_props.dies_supported = true; + mc->smp_props.clusters_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -1032,6 +1094,80 @@ static void test_with_drawers_books(const void *opaque) object_unref(obj); } +static void test_full_topo(const void *opaque) +{ + const char *machine_type = opaque; + Object *obj = object_new(machine_type); + MachineState *ms = MACHINE(obj); + MachineClass *mc = MACHINE_GET_CLASS(obj); + SMPTestData data = {}; + unsigned int drawers = 5, books = 3, dies = 2, clusters = 7, multiplier; + int i; + + multiplier = drawers * books * dies * clusters; + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* + * when drawers, books, dies and clusters parameters are omitted, + * they will be set as 1. + */ + data.expect_prefer_sockets.drawers = 1; + data.expect_prefer_sockets.books = 1; + data.expect_prefer_sockets.dies = 1; + data.expect_prefer_sockets.clusters = 1; + data.expect_prefer_cores.drawers = 1; + data.expect_prefer_cores.books = 1; + data.expect_prefer_cores.dies = 1; + data.expect_prefer_cores.clusters = 1; + + smp_parse_test(ms, &data, true); + + /* when drawers, books, dies and clusters parameters are specified. */ + data.config.has_drawers = true; + data.config.drawers = drawers; + data.config.has_books = true; + data.config.books = books; + data.config.has_dies = true; + data.config.dies = dies; + data.config.has_clusters = true; + data.config.clusters = clusters; + + if (data.config.has_cpus) { + data.config.cpus *= multiplier; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= multiplier; + } + + data.expect_prefer_sockets.drawers = drawers; + data.expect_prefer_sockets.books = books; + data.expect_prefer_sockets.dies = dies; + data.expect_prefer_sockets.clusters = clusters; + data.expect_prefer_sockets.cpus *= multiplier; + data.expect_prefer_sockets.max_cpus *= multiplier; + + data.expect_prefer_cores.drawers = drawers; + data.expect_prefer_cores.books = books; + data.expect_prefer_cores.dies = dies; + data.expect_prefer_cores.clusters = clusters; + data.expect_prefer_cores.cpus *= multiplier; + data.expect_prefer_cores.max_cpus *= multiplier; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_full_topo_invalid); i++) { + data = data_full_topo_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + + object_unref(obj); +} + /* Type info of the tested machine */ static const TypeInfo smp_machine_types[] = { { @@ -1068,6 +1204,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-drawers-books"), .parent = TYPE_MACHINE, .class_init = machine_with_drawers_books_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-full-topo"), + .parent = TYPE_MACHINE, + .class_init = machine_full_topo_class_init, } }; @@ -1100,6 +1240,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_drawers_books", MACHINE_TYPE_NAME("smp-with-drawers-books"), test_with_drawers_books); + g_test_add_data_func("/test-smp-parse/full", + MACHINE_TYPE_NAME("smp-full-topo"), + test_full_topo); g_test_run(); From patchwork Sat Mar 9 19:22:08 2024 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: 779169 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852701wrt; Sat, 9 Mar 2024 11:28:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWM/zSj38JyKVXpxFepKNYgzrDftpn9CeawGjMwwMey7mKHNf4slsLILzuPTfbJtoEaE5h2AsxpDL+sqb54XUjj X-Google-Smtp-Source: AGHT+IE5FO21e7cWEv8aV27KiMFt36uagyJ7PNyK+4zqLFXxtMTI+9i3wIxcnCmxf37D+18aZjU4 X-Received: by 2002:a05:620a:222f:b0:788:542c:a21b with SMTP id n15-20020a05620a222f00b00788542ca21bmr3111207qkh.66.1710012500256; Sat, 09 Mar 2024 11:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012500; cv=none; d=google.com; s=arc-20160816; b=dNESxHz6MMX5vYwzS2mz30tQR9QL0CwN2UR01IS3XPlH6Xky2nMdOUsFDv5XBe1LRA UljMShiaBaiWEiyg6N4toQ4fl0Mo4Yfws5tNs6Qkbf9evj3QbLbQjkVMoO3R6NV9zHCv xW0rQfpJDiDOGE1a1SRB2q5ZRUazMG+lrHpiwdqM2skpMZqOA1yCUax+WwbKPw/nfiSY G3zIk6rVuz/zUIzfS9k5/EcqeJkNwLttiQoPdUpkNjyx92xLQHR6uj4TXY5FevbnmTGE 1MNDj8Krm3gG6ozYc1svXW2YvskrrnqtJgIpUuGRmzRj2ml2XUL4U4vy/ykrW3R+IA3e ZDVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=oXXCTTKtOqKGIkFeLbdf6BFuAhbM9FIUumQwfVgSOrQ=; fh=MRpuvAMiIDngljO/1ktWIu7Kho7sXmLGHrYdpgFbLRA=; b=qTgp8Qn7ywh3WucZS/SbTfSgspQBiHbP9fyBiHpZ5pKZuuP3fBX8TFDv8bLu43ZWuJ IRxMG1VZ5VnappkQ3UkT0FU3+kgR2DaoJJlZDQPkoWnwg8z628hqlIiAXQlCOTTcPTw2 rg1vdibJoaYxj4ru7mSzyksGtJbHowbpYMk7/u94IIbTMJa5A6YFdQoaLlQam/hfyR0y 4IOBPjGJ7CbiZwe7Qi0ahOq/MEhqUuwzCJ7yMIAW0mQIWlODVmnOFBwU+3/xtp/NjvtN Tbprhe6ihRfQa4oCZtzohe08yY2sGwEAuBs0J9CYgdJdds8gLxcxXia8IV1ZGTLH7uEf FJtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NnxAPgg+; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q11-20020a05620a0c8b00b00788411a7240si2081273qki.211.2024.03.09.11.28.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:28:20 -0800 (PST) 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=NnxAPgg+; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lk-0001Gy-G4; Sat, 09 Mar 2024 14:27:16 -0500 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 1rj2Kx-0007tI-B1 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:30 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2Kt-0003YB-KE for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:27 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-563bb51c36eso3383658a12.2 for ; Sat, 09 Mar 2024 11:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012381; x=1710617181; 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=oXXCTTKtOqKGIkFeLbdf6BFuAhbM9FIUumQwfVgSOrQ=; b=NnxAPgg+MaI2MhPlQKj+BaKniQJ0Rv0no4GvooxGVwQXEn3V+wl60vioL77E+V7Bxe cSijFcXFXnfovMX5T7leg2Ne1pN0bxDBj5gcvIKn6VHJ3XqPtx/D8hRfkCM9s1xQref1 gepzhwyLHcpTBkgoZ1pj3Q1lLN+EY1cXQ4OyJJIjxHbJNuAQjpX+QJm1aeL4F6j5rGpx DR/ULNhxeKnJC4asKq7B+megyxkmHviFFIiUJguf0cdpuI/puVOxSnMgG9djEKXeAWL3 b2wjEnNoMRO/jlFaW3PEBSXTTtamzjuLr21pa25BTfEJUpsQRgoPn+9w6HZsXI+p4IUm qx5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012381; x=1710617181; 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=oXXCTTKtOqKGIkFeLbdf6BFuAhbM9FIUumQwfVgSOrQ=; b=vXp0uZaYiegavFY0eQz+mj6rSFyQWgWJkVZC7cxmwUCF7Bfzd/pnmulsy2wwQKuGhE MHGFmVCVsHyWDd5uZsD6UviK+l81cvMtYqoCuwxTb9gYpxc6LbR3p8FbwRBuI8IaIXxZ t3Dy1nVyvotpsL1OchFgVLgbzSvZm1VrfkJU6hL62FF/MWE2ccHeaINsX11hAom31W3M vzkqRDOCaA2ckXny0x1fZEe9QZc8DkVmrPzfBOIDi5MftGobEJMLohrNd/8dFxc3scrd SYIbKMVNDB68lL7ROdHAHn8woAGdiYmm80wvzmK7j52O4SCqwP+BNB3AwJKadIJEVjEG akrw== X-Gm-Message-State: AOJu0YwDo/Wp7AFh9SWmkZVTyk4S0OjDeCExjV52Qaxxh79tdLLj48ga 1UD4W/iYXNfMTBPkK1tlfzS2ln3ud5FuKUkkvKw4ySfK+7tbXgRQOvHkToAmCi21rdnF71+qrTV I X-Received: by 2002:a50:aad2:0:b0:567:f643:fc5c with SMTP id r18-20020a50aad2000000b00567f643fc5cmr1867041edc.20.1710012381554; Sat, 09 Mar 2024 11:26:21 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id et8-20020a056402378800b00566a4dec01fsm1156535edb.11.2024.03.09.11.26.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Xiaoling Song , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 41/43] tests/unit/test-smp-parse: Test smp_props.has_clusters Date: Sat, 9 Mar 2024 20:22:08 +0100 Message-ID: <20240309192213.23420-42-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=philmd@linaro.org; helo=mail-ed1-x52e.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu The smp_props.has_clusters in MachineClass is not a user configured field, and it indicates if user specifies "clusters" in -smp. After -smp parsing, other module could aware if the cluster level is configured by user. This is used when the machine has only 1 cluster since there's only 1 cluster by default. Add the check to cover this field. Signed-off-by: Zhao Liu Tested-by: Xiaoling Song Acked-by: Thomas Huth Message-ID: <20240308160148.3130837-13-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 7558169171..d39cfdc19b 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -573,7 +573,8 @@ static unsigned int cpu_topology_get_cores_per_socket(const CpuTopology *topo) static char *cpu_topology_to_string(const CpuTopology *topo, unsigned int threads_per_socket, - unsigned int cores_per_socket) + unsigned int cores_per_socket, + bool has_clusters) { return g_strdup_printf( "(CpuTopology) {\n" @@ -588,17 +589,20 @@ static char *cpu_topology_to_string(const CpuTopology *topo, " .max_cpus = %u,\n" " .threads_per_socket = %u,\n" " .cores_per_socket = %u,\n" + " .has_clusters = %s,\n" "}", topo->cpus, topo->drawers, topo->books, topo->sockets, topo->dies, topo->clusters, topo->cores, topo->threads, topo->max_cpus, - threads_per_socket, cores_per_socket); + threads_per_socket, cores_per_socket, + has_clusters ? "true" : "false"); } static void check_parse(MachineState *ms, const SMPConfiguration *config, const CpuTopology *expect_topo, const char *expect_err, bool is_valid) { + MachineClass *mc = MACHINE_GET_CLASS(ms); g_autofree char *config_str = smp_config_to_string(config); g_autofree char *expect_topo_str = NULL, *output_topo_str = NULL; unsigned int expect_threads_per_socket, expect_cores_per_socket; @@ -611,15 +615,18 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, cpu_topology_get_cores_per_socket(expect_topo); expect_topo_str = cpu_topology_to_string(expect_topo, expect_threads_per_socket, - expect_cores_per_socket); + expect_cores_per_socket, + config->has_clusters); /* call the generic parser */ machine_parse_smp_config(ms, config, &err); ms_threads_per_socket = machine_topo_get_threads_per_socket(ms); ms_cores_per_socket = machine_topo_get_cores_per_socket(ms); - output_topo_str = cpu_topology_to_string(&ms->smp, ms_threads_per_socket, - ms_cores_per_socket); + output_topo_str = cpu_topology_to_string(&ms->smp, + ms_threads_per_socket, + ms_cores_per_socket, + mc->smp_props.has_clusters); /* when the configuration is supposed to be valid */ if (is_valid) { @@ -634,7 +641,8 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, (ms->smp.threads == expect_topo->threads) && (ms->smp.max_cpus == expect_topo->max_cpus) && (ms_threads_per_socket == expect_threads_per_socket) && - (ms_cores_per_socket == expect_cores_per_socket)) { + (ms_cores_per_socket == expect_cores_per_socket) && + (mc->smp_props.has_clusters == config->has_clusters)) { return; } From patchwork Sat Mar 9 19:22:09 2024 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: 779172 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp852803wrt; Sat, 9 Mar 2024 11:28:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVYoVrT35X4bayeLWn4YWUq3kPHPMUaSuSqf183TML+jk071PwEhErrPcYG8x1nzfB8bMZpvfP6l47gkf3v30os X-Google-Smtp-Source: AGHT+IEsGzv1ZpkGkQgGpW4khLqCDMMRsNabnGySoK0SOHDsHgB38axY+6du3xK2Y+8AC+v8kqGF X-Received: by 2002:a05:6358:2a2:b0:17e:69cf:3ec0 with SMTP id w34-20020a05635802a200b0017e69cf3ec0mr758907rwj.0.1710012534881; Sat, 09 Mar 2024 11:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012534; cv=none; d=google.com; s=arc-20160816; b=0nkjNz/7nU/pyqpAaynjkEmI4wGQ5kd7uzLaI2Ffgmh75QEU2y/M0qHwDcgdVqeWOp FwElih5/RRb09Zw3QnrkSyL12h3eZ5Qx+qeuV5HdrC1bFfmBC4MN+HzyGD/IOn5t3lVa WLJg2XlJTVnXtpklCpza4n4fAR5XXaR5KTqJ1Kh9Tsn7paeoTQPAv4X9CSr5Ng858gJ2 ka0XzXG/AQgPbSdOV6k7UVznex7ZWjebndBGfn1PEZ5uIKdI18hre8Q4P33+0fWxCZq6 DfJxdZFUM83s2sOPxccnm8cMcWDhOWH43KoV06/Zn6hiEjnAVzsMty2LSh5eGFaJQwdQ ERsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=3KwrSf6l5lMKRNbxBtTiB9ULE3uG/bpbp4V2erGNe1I=; fh=S9WQPGLWsBWknqalzlH4o2qrER0/PTbhZltwTmPAzps=; b=xtn+P60QkrFRwk/gkD4NhV4gjQXNXbI970qvSg8hXgv0jk8z89FeQNHb84uUCdPExm 7ak3oauxjjs9AQY3DbIqtrF43u275r3cuYUGgtoYPolHzl5Xjk8vP+eYW5bW3HROJhmm urnYF48Uk//pQVKCmRVE8nCcBNx3rwzx2+eZ3oGVwcTaNLnntWP1F6sQNFjvFHRvPDHr yTt90zSFlQgZR+9V2TiHHOmvf+S56Y2TfVZwm6iM7/nlSjMFpmILVKAKCkx+aJvDlwig SDi9ZCyDAHwRD4e4XMJONs+/1XTDM40+4UyddrPoC8TwWLDO1J4glI4bMVU69jLE/E7i yKzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xek2MJML; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g10-20020ac87f4a000000b0042f15564e6asi2161096qtk.557.2024.03.09.11.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:28:54 -0800 (PST) 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=xek2MJML; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lo-0001ih-PC; Sat, 09 Mar 2024 14:27:20 -0500 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 1rj2L6-0007w8-EZ for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:38 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2L0-0003ZW-Qf for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:34 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a449c5411e1so409136966b.1 for ; Sat, 09 Mar 2024 11:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012387; x=1710617187; 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=3KwrSf6l5lMKRNbxBtTiB9ULE3uG/bpbp4V2erGNe1I=; b=xek2MJMLHOBU6xUmmvY9xtDHjOjCIFggKBT7Tpatqn7ltm/hn7/gMJTzWocPOhJwZI aDEgn7BIX1LE6+SREZXfUaIGAFgK91pmlcgXXTrRBMcXUGJeRsyJpcm0h4igL5UxFEAr Ca3UAD1CSA1mpcrKOum5BVxB7x1ZoE2NiPXQfnpZxlPMk9hhFc0vtKt+/mrPiGjz2L0M S9nLKVQk9l/JXlXc1oyt4G7AsvQzHJPcGzKTjgPYE1Pb1/vfmfPTdvquSE+4ZxXhWWd6 FGJbJ7cz5GSvWnpmBzETcdvDB0Wj5AVUVkmQsymjBL3zA5RqFrWl2vJ99Q1uYDx91PBd psWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012387; x=1710617187; 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=3KwrSf6l5lMKRNbxBtTiB9ULE3uG/bpbp4V2erGNe1I=; b=Xja8apOyv/gj1rMpD7uiV8PDUvw1Nx+h59hu6HFCtvYcWKNLP2eQnsCNrhQefQB8jW F46GVJAG8CYY8bTEm0gmKM1EI09CJsu+ad7xt9mtYWvSMhCbbSNS3702VD0hJ8dXUEaF BGwx3jpvw4ypilHOsFFZGeXLP63mruy65bWV30naYNo+MPo66MuiufTRgodqptqt4Sms q/X3Aj8fAqOBA8cJKGHQfuQgW5onN1I7JjNFKLONT7eFbeUo3KSQRV0NxTSjBnTR7Xon OG1Fmxc6rVskQYAERnY2Py3JM6ICoxLCz2VER6c69y0KQ1dtYcywnlzyEr0KCa0qyIYn pcNQ== X-Gm-Message-State: AOJu0Yx3U5kZZ9lqZ6qmUlyUeJHdd9FYtMhhO6ESiwzdsSr2lbxmL9gr VrR/u6ET0rCtyLGwheqleL45zuzq43di0Pwlvi4lVYyCFTw9r9TPP3D0fsJHNAF5V6MSyf42swf h X-Received: by 2002:a17:906:b082:b0:a45:c99d:3625 with SMTP id x2-20020a170906b08200b00a45c99d3625mr1214493ejy.23.1710012387502; Sat, 09 Mar 2024 11:26:27 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id k16-20020a1709067ad000b00a4537466591sm1178153ejo.32.2024.03.09.11.26.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Zhao Liu , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang Subject: [PULL 42/43] tests/unit/test-smp-parse: Test "parameter=0" SMP configurations Date: Sat, 9 Mar 2024 20:22:09 +0100 Message-ID: <20240309192213.23420-43-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Zhao Liu The support for "parameter=0" SMP configurations is removed, and QEMU returns error for those cases. So add the related test cases to ensure parameters can't accept 0. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Message-ID: <20240308160148.3130837-14-zhao1.liu@linux.intel.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 92 +++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index d39cfdc19b..8994337e12 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -524,6 +524,91 @@ static const struct SMPTestData data_full_topo_invalid[] = { }, }; +static const struct SMPTestData data_zero_topo_invalid[] = { + { + /* + * Test "cpus=0". + * config: -smp 0,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(0, 1, 1, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "drawers=0". + * config: -smp 1,drawers=0,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 0, 1, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "books=0". + * config: -smp 1,drawers=1,books=0,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 0, 1, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "sockets=0". + * config: -smp 1,drawers=1,books=1,sockets=0,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 0, 1, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "dies=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=0,\ + * clusters=1,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 0, 1, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "clusters=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=0,cores=1,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 0, 1, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "cores=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=0,threads=1,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 0, 1, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "threads=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=0,maxcpus=1 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 0, 1), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, { + /* + * Test "maxcpus=0". + * config: -smp 1,drawers=1,books=1,sockets=1,dies=1,\ + * clusters=1,cores=1,threads=1,maxcpus=0 + */ + .config = SMP_CONFIG_WITH_FULL_TOPO(1, 1, 1, 1, 1, 1, 1, 1, 0), + .expect_error = "Invalid CPU topology: CPU topology parameters must " + "be greater than zero", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( @@ -1173,6 +1258,13 @@ static void test_full_topo(const void *opaque) smp_parse_test(ms, &data, false); } + for (i = 0; i < ARRAY_SIZE(data_zero_topo_invalid); i++) { + data = data_zero_topo_invalid[i]; + unsupported_params_init(mc, &data); + + smp_parse_test(ms, &data, false); + } + object_unref(obj); } From patchwork Sat Mar 9 19:22:10 2024 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: 779183 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp853412wrt; Sat, 9 Mar 2024 11:31:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXeYED2I4Z02MRQJS/aTrSbDVOUuIo+P2IyeMGdW0TK3fPnrdn2fAV2UFjK1WwPHOT5MY6irFVOK6cdF10aV7ci X-Google-Smtp-Source: AGHT+IGN97wFBw0mW0jcerdcvqDBKwBWgeRF5WNJ5xru4MtuTqc3F2eFP3WfDjtz9vjIAZiVxRdN X-Received: by 2002:ac8:5c02:0:b0:42e:db6d:8969 with SMTP id i2-20020ac85c02000000b0042edb6d8969mr3870130qti.24.1710012681439; Sat, 09 Mar 2024 11:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1710012681; cv=none; d=google.com; s=arc-20160816; b=QvTjCrGf9vAfKo45K312KDXVjEGVyfNg3TPs0mX0Xmir4V/zfEnytjjPGglXM7yhkL 0/pk1fbxOHzjGvNhAV+cfERrg2ah8qg2zFotCPAYUEGlAhoCI1NNe7ysNogu5WU6j3D3 5Mo0es2Gq1GmCnKWnWK/G6dKuG4ED3zYpQF/UortLz2zcP5BMhcAe9yHy/STevrPTmQq 38R4CzUchpG1HtRte3aUJrOVV5xQKwvqToVKyMKuiM9EesqZeSmuvckBraaPEWHfeEOg /TUaBgq6ffdhB/Lp1r7KoLyXIHdrFg4EDjnqAfhX3QD2hOt0Nhb727k2wIch4ScVMvWj jLEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=+XiYruIl/Mk62y3f+ezGiMfqf4PWIQGmn/ntaltbgg8=; fh=LDTnWDH3qI1Y46ZTtpYsJFILUalbbLSjH3TLEjdZIMw=; b=PwVLnAPYCom8FO6eZZD1+OkL6zwBphNGG3xESkIk0PMtPmHTIBTwaMLWo+NiVYzO0k MAxMZRkFe54qq1PfeaqLALwCoSsJxPueNW+og9Qkqmefi74eRHHEKIovHNxcLUFxMkYW FXIEB2OiumPLI9mdvr5+kQf7aBZ5JZGfcWpf3MR8SiiXS3AtlpHjaj4A5VboNSboG+Mk 1/347LPw8rCnFD8vI51z8yqI6U815J75XkFcP+YwWj7CcJwurB2q1+iZcHn+MnjkjcQ9 MwxncBn1SRNL/uBB+tbxYA0KvylGtpO1zCKv9cae+rH86CeoFYlr5aIOYkS2zeIzje6K 3CBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Cr32ogUM; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v17-20020ac85791000000b0042ef59a9568si2191008qta.309.2024.03.09.11.31.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Mar 2024 11:31:21 -0800 (PST) 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=Cr32ogUM; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rj2Lq-0001qr-3u; Sat, 09 Mar 2024 14:27:22 -0500 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 1rj2L8-0007xO-OE for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:40 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rj2L6-0003a5-72 for qemu-devel@nongnu.org; Sat, 09 Mar 2024 14:26:38 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a460185d1a7so75796566b.0 for ; Sat, 09 Mar 2024 11:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710012393; x=1710617193; 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=+XiYruIl/Mk62y3f+ezGiMfqf4PWIQGmn/ntaltbgg8=; b=Cr32ogUMNB0hteF1iaaW05vW7XjpElPE8zvNhxVnw81+J0EDe9HxEIKbCrDfPKKuEQ TL/HuoIP2NcEvsf0SFxvmpXf17aOtmX2IXYTdg0J24JjW/UTtrHYvJoOKliK5FBjZveF fY6vlQ/w2qb/z8BazEx0tpMDJkgpijIlhYUHhRQUaCQN8H2ZuzXX9c2hqbE01OGJwFLm lTqxcFGm7VFNJIDFPZHQoAAZjnm8IZhnp+Mwb59idf6Y3aF29VzHpKlJl6z6jKVbx85P 4Kim4sn4A1++dOJjyi5JYpk1P2NKz4jRu3eAPRihh5DXouWGcUMBKm8gsRgHn5CtG60S 4K5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710012393; x=1710617193; 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=+XiYruIl/Mk62y3f+ezGiMfqf4PWIQGmn/ntaltbgg8=; b=o1sMGGoZepxOlo53lvjwKgZUNLHUzvuj1mk/sKEkvGywPULyEnQGs+Tb/Y8BhppG9+ suzs5EJryvRRyc107kyQlFaxIELz+mQDrxso32Wd0C/KB/7MqLcOn408RtkkyGrwpVSe W0efw4/oa43a4UuiaEfFuE311MhzC7t6ti2PhqzIUF9d51lzrex6a9iBDkQYUnG38AFE xg4EhKwRXYiDHPLHo2kA6wzGc/XosGCTXzw2Alk5zeD0qD+dZNOVa07+OwFldcRp7zLq qmMX4UGGXfIQ9CFDcXG1EIQhFXDXbI8WCldG2w6Ym3DLA3YtS1E2GGjXzeZPHNb/FERM zXgA== X-Gm-Message-State: AOJu0YzDgDp8Oc/c3kIW3E/YHkY2zU5WbxA51niUwNyx98hM5gQJcs6y ahbCcRXmcj8iBx07EXVezYTWxKUmJYTquf9vWKeFaeWG9B27B+zr9iSVhof7oM7o9r4cgORp27f a X-Received: by 2002:a17:906:a1c8:b0:a44:1cb4:f496 with SMTP id bx8-20020a170906a1c800b00a441cb4f496mr1343853ejb.75.1710012393290; Sat, 09 Mar 2024 11:26:33 -0800 (PST) Received: from m1x-phil.lan ([176.176.181.237]) by smtp.gmail.com with ESMTPSA id pw2-20020a17090720a200b00a456573f9c5sm1187380ejb.0.2024.03.09.11.26.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 09 Mar 2024 11:26:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Angelo Dureghello , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 43/43] hw/m68k/mcf5208: add support for reset Date: Sat, 9 Mar 2024 20:22:10 +0100 Message-ID: <20240309192213.23420-44-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240309192213.23420-1-philmd@linaro.org> References: <20240309192213.23420-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=philmd@linaro.org; helo=mail-ej1-x62c.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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 From: Angelo Dureghello Add reset support for mcf5208. Signed-off-by: Angelo Dureghello Reviewed-by: Thomas Huth Message-ID: <20240309093459.984565-1-angelo@kernel-space.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/m68k/mcf5208.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index 0cfb806c20..ec14096aa4 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -40,6 +40,8 @@ #define PCSR_PRE_SHIFT 8 #define PCSR_PRE_MASK 0x0f00 +#define RCR_SOFTRST 0x80 + typedef struct { MemoryRegion iomem; qemu_irq irq; @@ -185,12 +187,50 @@ static const MemoryRegionOps m5208_sys_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic) +static uint64_t m5208_rcm_read(void *opaque, hwaddr addr, + unsigned size) +{ + return 0; +} + +static void m5208_rcm_write(void *opaque, hwaddr addr, + uint64_t value, unsigned size) +{ + M68kCPU *cpu = opaque; + CPUState *cs = CPU(cpu); + switch (addr) { + case 0x0: /* RCR */ + if (value & RCR_SOFTRST) { + cpu_reset(cs); + cpu->env.aregs[7] = ldl_phys(cs->as, 0); + cpu->env.pc = ldl_phys(cs->as, 4); + } + break; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset 0x%" HWADDR_PRIX "\n", + __func__, addr); + break; + } +} + +static const MemoryRegionOps m5208_rcm_ops = { + .read = m5208_rcm_read, + .write = m5208_rcm_write, + .endianness = DEVICE_NATIVE_ENDIAN, +}; + +static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic, + M68kCPU *cpu) { MemoryRegion *iomem = g_new(MemoryRegion, 1); + MemoryRegion *iomem_rcm = g_new(MemoryRegion, 1); m5208_timer_state *s; int i; + /* RCM */ + memory_region_init_io(iomem_rcm, NULL, &m5208_rcm_ops, cpu, + "m5208-rcm", 0x00000080); + memory_region_add_subregion(address_space, 0xfc0a0000, iomem_rcm); /* SDRAMC. */ memory_region_init_io(iomem, NULL, &m5208_sys_ops, NULL, "m5208-sys", 0x00004000); memory_region_add_subregion(address_space, 0xfc0a8000, iomem); @@ -265,7 +305,7 @@ static void mcf5208evb_init(MachineState *machine) mcf_uart_create_mmap(0xfc064000, pic[27], serial_hd(1)); mcf_uart_create_mmap(0xfc068000, pic[28], serial_hd(2)); - mcf5208_sys_init(address_space_mem, pic); + mcf5208_sys_init(address_space_mem, pic, cpu); mcf_fec_init(address_space_mem, 0xfc030000, pic + 36);