From patchwork Fri Dec 31 12:47:35 2021 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: 12701939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C24DC433F5 for ; Fri, 31 Dec 2021 12:52:01 +0000 (UTC) Received: from localhost ([::1]:46480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HO4-0000JP-Eu for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:52:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKK-0005ot-MR for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKH-0000h7-V9 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6NcCg5xKWT+cJ/GsSaNTEefS39uXSXMUdwSN24u99dU=; b=MGnkjNGOJtEeFL5CbBtUa8htMQQ+NnLZPcj6Q0A8tJcJ2j87uYfCEwSoFixYzkYm3L8jRl 8qdcE4RmnKjLITy5+ipZFEcgeE4K2ggK+swu+XAS3+t8aSDWjj9KvsFhIhauajPKKwl5r6 o9+u1Q3ON0PiSGdLSsLVSgFES2+dqbA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-386-0gUfkaZPOwKxZ4c_YOOosw-1; Fri, 31 Dec 2021 07:48:02 -0500 X-MC-Unique: 0gUfkaZPOwKxZ4c_YOOosw-1 Received: by mail-wr1-f69.google.com with SMTP id d13-20020adf9b8d000000b001a2aa837f8dso7537156wrc.3 for ; Fri, 31 Dec 2021 04:48:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6NcCg5xKWT+cJ/GsSaNTEefS39uXSXMUdwSN24u99dU=; b=PFjdBFowGe1Vyc5grsnNMBIwH6rTriv04bcPMfbV1GJk+Ds+ItyJ9O9IqeR27XgU3o BbEUR6joHqOwQiCwlvTGQ6peaepbsPTI2GGUHGizZ8WZbay6cHENyeLmtDy0h6vOm//W mbmVHrlt1Q/tbeG+HQXIDF8ztkGy6OeLn//WBlL1kumb1IvCZzH1K7ib+XN65TVszF6i m+wFSom6sEho09xqm+Ui6QKOnewB53aJMYzM9enHKX2qIvhXWXiE04fe8FP/0TZ3cotm etSdKTD/4kaJlZLaZR1uYD17VAuXTnsmK/2/lJCXUjApDyhZa2ro/R3ClU7+dJMLGNzU b9Eg== X-Gm-Message-State: AOAM5317ekfGpEbejY/BjRtYnUkVMrBCSwjtlfknhJzY4aTW+XexIk8I dqnDlEWaoSzeke90ixnJZXGPOUFqz0fOJhzJWfSHl1reyE5o1wNEcmSUIMxdxG3akQiHztLbqOx sowV4hmtCAqHty29724AuDme6sZLXcnerlSPM6sDv4S6jVe/NDBUWn0G9r6lNLWiz X-Received: by 2002:a5d:64aa:: with SMTP id m10mr30161360wrp.500.1640954880492; Fri, 31 Dec 2021 04:48:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpE7zljcX2Zs1AtVs6KxXh79ZF4AojGyjRG+XuQUYtpzNrdxvva9O53mzoMdkLXVEVNKIALA== X-Received: by 2002:a5d:64aa:: with SMTP id m10mr30161345wrp.500.1640954880292; Fri, 31 Dec 2021 04:48:00 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id z22sm27087048wmp.40.2021.12.31.04.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:47:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/20] hw/qdev: Cosmetic around documentation Date: Fri, 31 Dec 2021 13:47:35 +0100 Message-Id: <20211231124754.1005747-2-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Add empty lines to have a clearer distinction between different functions declarations. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211218130437.1516929-2-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 20d3066595e..59a822ffceb 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -321,6 +321,7 @@ compat_props_add(GPtrArray *arr, * The returned object has a reference count of 1. */ DeviceState *qdev_new(const char *name); + /** * qdev_try_new: Try to create a device on the heap * @name: device type to create @@ -329,6 +330,7 @@ DeviceState *qdev_new(const char *name); * does not exist, rather than asserting. */ DeviceState *qdev_try_new(const char *name); + /** * qdev_realize: Realize @dev. * @dev: device to realize @@ -347,6 +349,7 @@ DeviceState *qdev_try_new(const char *name); * qdev_realize_and_unref() instead. */ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp); + /** * qdev_realize_and_unref: Realize @dev and drop a reference * @dev: device to realize @@ -372,6 +375,7 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Error **errp); * would be incorrect. For that use case you want qdev_realize(). */ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp); + /** * qdev_unrealize: Unrealize a device * @dev: device to unrealize @@ -450,6 +454,7 @@ typedef enum { * For named input GPIO lines, use qdev_get_gpio_in_named(). */ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n); + /** * qdev_get_gpio_in_named: Get one of a device's named input GPIO lines * @dev: Device whose GPIO we want @@ -497,6 +502,7 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); * For named output GPIO lines, use qdev_connect_gpio_out_named(). */ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); + /** * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines * @dev: Device whose GPIO to connect @@ -524,6 +530,7 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); */ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, qemu_irq pin); + /** * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GPIO * @dev: Device whose output GPIO we are interested in @@ -541,6 +548,7 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, * by the platform-bus subsystem. */ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n); + /** * qdev_intercept_gpio_out: Intercept an existing GPIO connection * @dev: Device to intercept the outbound GPIO line from @@ -582,6 +590,7 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name); * hold of an input GPIO line to manipulate it. */ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); + /** * qdev_init_gpio_out: create an array of anonymous output GPIO lines * @dev: Device to create output GPIOs for @@ -610,6 +619,7 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); * handler. */ void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); + /** * qdev_init_gpio_out: create an array of named output GPIO lines * @dev: Device to create output GPIOs for @@ -623,6 +633,7 @@ void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); */ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins, const char *name, int n); + /** * qdev_init_gpio_in_named_with_opaque: create an array of input GPIO lines * for the specified device From patchwork Fri Dec 31 12:47:36 2021 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: 12701938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9810AC433EF for ; Fri, 31 Dec 2021 12:51:59 +0000 (UTC) Received: from localhost ([::1]:46508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HO2-0000KR-Lw for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:51:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKL-0005pg-I1 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35739) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKJ-0000hD-S3 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+4sOFVvGeEBA7BnPdfDCmGmrSKk6Q3SFRcpoINpXLs=; b=WjT3nnVcpn996B/KLPepHl0FNciZIifax+7FLZwoKdqnnefLx6y4JgHxHXRnTmLtB8WS4+ PLEm7cMjQsg6LsnV0/I5omnBaUXXEBZSQsN8VOowXZFFPPqKf2soXjVhyEh9jS3PfJsn/w jZB4ic3AE/5JnSlp7gbH8XkmO3U2S00= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-ctXIyOY6OYWUzzQSfYaDwA-1; Fri, 31 Dec 2021 07:48:06 -0500 X-MC-Unique: ctXIyOY6OYWUzzQSfYaDwA-1 Received: by mail-wm1-f70.google.com with SMTP id b20-20020a05600c4e1400b003457da1c91eso7459758wmq.4 for ; Fri, 31 Dec 2021 04:48:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w+4sOFVvGeEBA7BnPdfDCmGmrSKk6Q3SFRcpoINpXLs=; b=HX82ryBHU88b+XNI1UVPpKv2sWHkxTWsVvQHLX6Ve5GYqfmisoXvVdNJPoF2Btisya LqpjnvOXcz+3GpuGcb0TUodHDfCdPb1s94eaSO4di4GiCJSWRQWp8wq8/yFyvA/ACRYC 6ikDQ7kCr4OQcfYMKXbqxvzf3nALCl9bSjLM3L6ZhIShlrH92y2tD6i0yRQX25M5i4qq n/kgthS/EF7fq+sziQYnfRQVA5FbOSFEb9XY2E0t7jLOOSvj8qJFJOb/H2CR3uJvZnPt uyZqc43STx/JjDvYwl6iN5xtyuSaLOFQDuTFBLtblGmECfvmyVhbKXRCRKObV90TEKS7 bd5g== X-Gm-Message-State: AOAM532U1Vu+kUBMdM5hKkoY4T6z5NSJyW0ikMci+ZUne18NMa2B3VPF XCm7RPhhpeDOm2OrROTiHJLfKuv1axDNMRU1aoRC1T+r2YRayae1ErWNOqrguRkox2mEe4IeFil +JCnBzIkQdH5BULInmu8VtL4lRxEyVP9QKiTqr/PSN7OUKhi9dSs/9L45s/1tRH2V X-Received: by 2002:a5d:5552:: with SMTP id g18mr29566589wrw.488.1640954884905; Fri, 31 Dec 2021 04:48:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLVTENjJV+R2FLSYKqDJYJt9nlJEAyU3i2Iu97NnYhrmRKk/KTo07di/XWcmiH/9jMF9bLIg== X-Received: by 2002:a5d:5552:: with SMTP id g18mr29566569wrw.488.1640954884653; Fri, 31 Dec 2021 04:48:04 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id r7sm25915338wrt.77.2021.12.31.04.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/20] hw/qdev: Correct qdev_init_gpio_out_named() documentation Date: Fri, 31 Dec 2021 13:47:36 +0100 Message-Id: <20211231124754.1005747-3-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé qdev_init_gpio_out_named() is described as qdev_init_gpio_out(), and referring to itself in an endless loop, which is confusing. Fix. Reported-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211218130437.1516929-3-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 59a822ffceb..dcf20c69b89 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -621,7 +621,7 @@ void qdev_init_gpio_in(DeviceState *dev, qemu_irq_handler handler, int n); void qdev_init_gpio_out(DeviceState *dev, qemu_irq *pins, int n); /** - * qdev_init_gpio_out: create an array of named output GPIO lines + * qdev_init_gpio_out_named: create an array of named output GPIO lines * @dev: Device to create output GPIOs for * @pins: Pointer to qemu_irq or qemu_irq array for the GPIO lines * @name: Name to give this array of GPIO lines From patchwork Fri Dec 31 12:47:37 2021 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: 12701940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 391D7C433EF for ; Fri, 31 Dec 2021 12:52:02 +0000 (UTC) Received: from localhost ([::1]:46560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HO5-0000Ma-40 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:52:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKP-0005sB-SV for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKO-0000hW-59 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JTqiL35hH/fnhlD9CAtxeQRLllRocCsMZlpBqswrwZk=; b=ECoZA3aVdYDNAbEVAnHxFuqa1wG7lG+yfJ7d/4v6cQoWLYbMe252qjx+SQjoRXOtuGIFfA bF/qnVnxFnYXehkOSoKstrv/WaryJ4rorj+O8auI5Qu4Gx82FUmCCKYKfR1wX/1lSRMBpL 8FUne6kLuVQEshrQREk20GaXu/k30No= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-433-xMX-Ce7yOkiQMU9zSKDy5A-1; Fri, 31 Dec 2021 07:48:10 -0500 X-MC-Unique: xMX-Ce7yOkiQMU9zSKDy5A-1 Received: by mail-wr1-f72.google.com with SMTP id q21-20020adfab15000000b001a24b36e47eso7486604wrc.2 for ; Fri, 31 Dec 2021 04:48:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JTqiL35hH/fnhlD9CAtxeQRLllRocCsMZlpBqswrwZk=; b=4pOB0ZnfRgrK4DQvmR1Q61l8gnAapYtunMjxMqLseO4MZdKma1SVGkMUMOQ9++POeT bkbV0optEkQN0u4/WUhjSRweLk1TS2vaB4d3CBEs7ETmcQzwFh0f418uAzHDYK+3EQRY AVPyLmt0DOo86vFOUwXD/PrKjQdqNqOwaIKRUyguPZyaMrMiC9NaWWzlSI/VhpSOnfHC oLEdht46Gmxx4qlrtZAbqdNiy4Af6ilAsXDodIFBXs3HcR1V7UC1U8KavD7dln1wPLWC dlaTjmffmOSd6O/rNYltprVFcjKMbIVl7mDCEnO5fhfoZqjGZDY2Ah8xb8VNskn2zFUx pMqQ== X-Gm-Message-State: AOAM531cPRC0C99AdJK7KsSwN+OYx/WtM6VT3s9sqJ6s3RY/NrAHDs8a wLggxAHBwWS6LgLZ7ug3oSxNxSH0CJhF81uF8q+Z/4G26P/NmAdgpHBjd+v+JC/rNSLbcdRK9dg 7MeuOHLMSxHw2aJBDTiAItW/CycHGxOLU5OMLFSRSyyzzFI/RWgv5XJ3yQSRGHeZO X-Received: by 2002:a5d:6d8a:: with SMTP id l10mr29419136wrs.527.1640954889241; Fri, 31 Dec 2021 04:48:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr/EmqueGAyqLvgcx4UNeUxXdD+Kd40nXpHzxituCIozj2AWoPC+VvUnNH9ocWmeRXHzswhg== X-Received: by 2002:a5d:6d8a:: with SMTP id l10mr29419120wrs.527.1640954889066; Fri, 31 Dec 2021 04:48:09 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id y11sm31550168wry.70.2021.12.31.04.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/20] hw/qdev: Correct qdev_connect_gpio_out_named() documentation Date: Fri, 31 Dec 2021 13:47:37 +0100 Message-Id: <20211231124754.1005747-4-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé qdev_connect_gpio_out_named() is described as qdev_connect_gpio_out(), and referring to itself in an endless loop, which is confusing. Fix. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211218130437.1516929-4-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index dcf20c69b89..424c48daf6e 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -504,7 +504,8 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); /** - * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines + * qdev_connect_gpio_out_named: Connect one of a device's named output + * GPIO lines * @dev: Device whose GPIO to connect * @name: Name of the output GPIO array * @n: Number of the anonymous output GPIO line (which must be in range) @@ -526,7 +527,7 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); * qemu_irqs at once, or to connect multiple outbound GPIOs to the * same qemu_irq; see qdev_connect_gpio_out() for details. * - * For named output GPIO lines, use qdev_connect_gpio_out_named(). + * For anonymous output GPIO lines, use qdev_connect_gpio_out(). */ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, qemu_irq pin); From patchwork Fri Dec 31 12:47:38 2021 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: 12701942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0CF87C433F5 for ; Fri, 31 Dec 2021 12:55:20 +0000 (UTC) Received: from localhost ([::1]:55060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HRH-00064v-6Y for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:55:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKU-0005wa-Fv for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49127) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKS-0000jn-On for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uQrjre6Db1sZNkT4sskEN8IBgNsCcPmlEpkvvQNs6e4=; b=JZO+Wzo5fvgLhBsdymW1W8HZjZoqw/hfiC9x46R3w50k1nYqBpNAzW0Key9dTNM+lcTdQG oSyy1g9drjCr4IwrZLY9EkC6QFITOwvvWDL1BQKUc3pkFlVaD+l+er8zq1Ps2aqvjoe9aB wQZRSX9xk84DexgcVKOGgU0aj1tu2u4= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-59-r5P0qJ9-Oi-xUO6VbEsSTg-1; Fri, 31 Dec 2021 07:48:15 -0500 X-MC-Unique: r5P0qJ9-Oi-xUO6VbEsSTg-1 Received: by mail-wr1-f71.google.com with SMTP id w25-20020adf8bd9000000b001a255212b7cso7494131wra.18 for ; Fri, 31 Dec 2021 04:48:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uQrjre6Db1sZNkT4sskEN8IBgNsCcPmlEpkvvQNs6e4=; b=Ms3uEPBG3n598M5nJ/uhc43c1KfY6sXnSUIn4uYk3zrZthiyYK5IDRatH/modAMMfA C6Kx6iR0a6pdWrZoB68onNDVtlHp7Gi/EpBvb+rmQpGP3f5mVGDs5EVytqehaKGay5t8 zGN17cl7mBL+GGHuweYKPYfuqeIpxYr+Mm4WgkXaMsLfqxl67j1mpgaLbt991a0mqbSq QNv1SRRTIzdijaEt0mOK9MlEFQcsHctt3wGYl4PEIXrryoMWWrY/1doq2j+DfBaY4T0/ To4KVwx1igYhz1EURocePvIQx9T1ChpefV87OSzk/TMk8YBea83jp+VTcY8p4YExSUle J+bQ== X-Gm-Message-State: AOAM5329MLmesEXjH6b/Ynmm9oIYzhn/nTKhlmyoF3iCifHhOUCndXru 3kW11WUg+I5Ntn6QfqEPCQw6sa2KY9GGH77FQOxFDk13caxrKbuEL1dXAGo4oz3g7D6SRZwzKKk WvHAsV+QV/8aqWSxrVBa6FWH4HHrTWnh7RoL4rhMigOSQdhM7cMyP1K3libcCV/62 X-Received: by 2002:a5d:488a:: with SMTP id g10mr15576231wrq.653.1640954893603; Fri, 31 Dec 2021 04:48:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj64MCdxk3k9Hhr8hj4/AtZ9Fw4XMI0Tl40rrw40U5RcpByN32mz7ctTQDt60mIgKX5OMRdg== X-Received: by 2002:a5d:488a:: with SMTP id g10mr15576206wrq.653.1640954893349; Fri, 31 Dec 2021 04:48:13 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id g6sm27436067wri.67.2021.12.31.04.48.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/20] hw/qdev: Rename qdev_connect_gpio_out*() 'input_pin' parameter Date: Fri, 31 Dec 2021 13:47:38 +0100 Message-Id: <20211231124754.1005747-5-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé @pin is an input where we connect a device output. Rename it @input_pin to simplify the documentation. Reviewed-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211218130437.1516929-5-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/qdev-core.h | 6 +++--- hw/core/gpio.c | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 424c48daf6e..d19c9417520 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -476,7 +476,7 @@ qemu_irq qdev_get_gpio_in_named(DeviceState *dev, const char *name, int n); * qdev_connect_gpio_out: Connect one of a device's anonymous output GPIO lines * @dev: Device whose GPIO to connect * @n: Number of the anonymous output GPIO line (which must be in range) - * @pin: qemu_irq to connect the output line to + * @input_pin: qemu_irq to connect the output line to * * This function connects an anonymous output GPIO line on a device * up to an arbitrary qemu_irq, so that when the device asserts that @@ -509,7 +509,7 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); * @dev: Device whose GPIO to connect * @name: Name of the output GPIO array * @n: Number of the anonymous output GPIO line (which must be in range) - * @pin: qemu_irq to connect the output line to + * @input_pin: qemu_irq to connect the output line to * * This function connects an anonymous output GPIO line on a device * up to an arbitrary qemu_irq, so that when the device asserts that @@ -530,7 +530,7 @@ void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin); * For anonymous output GPIO lines, use qdev_connect_gpio_out(). */ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, - qemu_irq pin); + qemu_irq input_pin); /** * qdev_get_gpio_out_connector: Get the qemu_irq connected to an output GPIO diff --git a/hw/core/gpio.c b/hw/core/gpio.c index 8e6b4f5edf3..80d07a6ec99 100644 --- a/hw/core/gpio.c +++ b/hw/core/gpio.c @@ -115,17 +115,18 @@ qemu_irq qdev_get_gpio_in(DeviceState *dev, int n) } void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, - qemu_irq pin) + qemu_irq input_pin) { char *propname = g_strdup_printf("%s[%d]", name ? name : "unnamed-gpio-out", n); - if (pin && !OBJECT(pin)->parent) { + if (input_pin && !OBJECT(input_pin)->parent) { /* We need a name for object_property_set_link to work */ object_property_add_child(container_get(qdev_get_machine(), "/unattached"), - "non-qdev-gpio[*]", OBJECT(pin)); + "non-qdev-gpio[*]", OBJECT(input_pin)); } - object_property_set_link(OBJECT(dev), propname, OBJECT(pin), &error_abort); + object_property_set_link(OBJECT(dev), propname, + OBJECT(input_pin), &error_abort); g_free(propname); } @@ -165,9 +166,9 @@ qemu_irq qdev_intercept_gpio_out(DeviceState *dev, qemu_irq icpt, return disconnected; } -void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq pin) +void qdev_connect_gpio_out(DeviceState *dev, int n, qemu_irq input_pin) { - qdev_connect_gpio_out_named(dev, NULL, n, pin); + qdev_connect_gpio_out_named(dev, NULL, n, input_pin); } void qdev_pass_gpios(DeviceState *dev, DeviceState *container, From patchwork Fri Dec 31 12:47:39 2021 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: 12701943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1DE9C433EF for ; Fri, 31 Dec 2021 12:55:20 +0000 (UTC) Received: from localhost ([::1]:55128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HRH-00068F-Nn for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:55:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKY-0005zo-MO for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:23 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38073) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKW-0000k8-T0 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xmB2pjpPBRixvCwzPKhtMpmRFUaHeigjOeRVD50Cfio=; b=S2eJcC8nLqFyPr0p002FeUR7pI/RFZJ+G6WGE/9dMRghQu39BecATaljpg2aULW3AmZMbz GXjGjoEh/cBWBIfgWqD8mJHAEtxI57E16rNW8ta99YPLLmJK9ahvKD5YelJfUWglnGSqpB ruY1iYYPChrGvRmLgNEVHqIdl0r/bQ8= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-257-u-HVej0pPkm6T_6FaJVLVw-1; Fri, 31 Dec 2021 07:48:19 -0500 X-MC-Unique: u-HVej0pPkm6T_6FaJVLVw-1 Received: by mail-wr1-f71.google.com with SMTP id f13-20020adfe90d000000b001a15c110077so7494943wrm.8 for ; Fri, 31 Dec 2021 04:48:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xmB2pjpPBRixvCwzPKhtMpmRFUaHeigjOeRVD50Cfio=; b=urzqsozuJzhmnxK9szi9HTpA/BCXktIxJYHhCuBYy3T0IhdPg/tBbkNiZQieFBYyi/ sdkoEmpjeGIzWLs07m0lcweuJUQB7u6zIm4uISvjuElioMUHJRQSEi7URkTGgGsJ7ujn Q043XsUs0zxG+1CmGdBlUAXaQO41IWs2x7L4iJMMv09IQHhy5IApaL5SOBGiN4pIzJDS nL5ga0o27M7aC113tpuEt7tMgGDhCPZWzelvhEnWrpjj7Rm6LEfHY6+COWaoYIMfKoba adsPWsJmFTKy6j5XdPhqGdHYz3xZKEqf4FhUVHUpYG7zFS9AiHiceGaU1Yfte4bqdE3f F+0Q== X-Gm-Message-State: AOAM533RXLQ2Bq5PbB9QnbrJHlw1X8rkbpoyF3/rRSnH8Q95W7o31nUT Mlb74IswsqJxbNd1XIFR+hv7k/jJVW867rGTgBfo/hqkDQeE18krlGJlarGHtUAJknIBB2I37Cn gAPE5BwS8LXqZwpLNMkiqo05KadTwmnLz1EHDOFiuwluRXGCxwhSfBHIlS+6KY8lX X-Received: by 2002:a05:6000:108a:: with SMTP id y10mr28770154wrw.335.1640954897872; Fri, 31 Dec 2021 04:48:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGpX+LsFprT8hw+VLP7mQuNE1tHjfABBtig5YpWxcStgP8CjRRA5QN/vTAZNPggMwuurC+fQ== X-Received: by 2002:a05:6000:108a:: with SMTP id y10mr28770140wrw.335.1640954897698; Fri, 31 Dec 2021 04:48:17 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id n12sm29245382wrf.29.2021.12.31.04.48.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/20] tests/unit/test-smp-parse: Pass machine type as argument to tests Date: Fri, 31 Dec 2021 13:47:39 +0100 Message-Id: <20211231124754.1005747-6-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Use g_test_add_data_func() instead of g_test_add_func() so we can pass the machine type to the tests (we will soon have different machine types). Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-2-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index b02450e25a3..37c6b4981db 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -487,9 +487,10 @@ static void machine_base_class_init(ObjectClass *oc, void *data) mc->name = g_strdup(SMP_MACHINE_NAME); } -static void test_generic(void) +static void test_generic(const void *opaque) { - Object *obj = object_new(TYPE_MACHINE); + const char *machine_type = opaque; + Object *obj = object_new(machine_type); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); SMPTestData *data = &(SMPTestData){{ }}; @@ -525,9 +526,10 @@ static void test_generic(void) object_unref(obj); } -static void test_with_dies(void) +static void test_with_dies(const void *opaque) { - Object *obj = object_new(TYPE_MACHINE); + const char *machine_type = opaque; + Object *obj = object_new(machine_type); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); SMPTestData *data = &(SMPTestData){{ }}; @@ -599,8 +601,12 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); - g_test_add_func("/test-smp-parse/generic", test_generic); - g_test_add_func("/test-smp-parse/with_dies", test_with_dies); + g_test_add_data_func("/test-smp-parse/generic", + TYPE_MACHINE, + test_generic); + g_test_add_data_func("/test-smp-parse/with_dies", + TYPE_MACHINE, + test_with_dies); g_test_run(); From patchwork Fri Dec 31 12:47:40 2021 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: 12701945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B187C433F5 for ; Fri, 31 Dec 2021 12:57:49 +0000 (UTC) Received: from localhost ([::1]:35392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HTg-0003P4-66 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:57:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKc-00065m-I1 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27737) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKa-0000kL-WF for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xnirtv3DDKZob6GdBwHAAuf1H+WbvfHFWSgEQSJCoyk=; b=bzmJiQAPeqCFvskXUt+qNHuatjMEwd4a4hlOvXxYhVD6CnOVo+w5711OMfUQ3DVChA+kEZ +01w/L2XyFlg+ZZi803A3n7GyPOAjkGPuf2rQ4Knk4+RtjGElWPO8HH4wsdoIilADUoQfS ZPmRg92M/Iv2fpgCiKrgRDkye7/zbAE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-102-w3lukQ0COLaNOaC4sR3kPg-1; Fri, 31 Dec 2021 07:48:23 -0500 X-MC-Unique: w3lukQ0COLaNOaC4sR3kPg-1 Received: by mail-wr1-f71.google.com with SMTP id k4-20020adfc704000000b001a32d86a772so4036044wrg.5 for ; Fri, 31 Dec 2021 04:48:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xnirtv3DDKZob6GdBwHAAuf1H+WbvfHFWSgEQSJCoyk=; b=pxEoWTeI3U5sl9XieWbYt+sgxnNXZQHvXHYJyJSbOvSw+fNtvITIXwJ5Bz0xCnQFTi IcUKEGE77o1gzj1cP6avXZZnvxnpWE+dv0whydDk1oWyAVgBpWxF1Eh8ALCOJiFHNAAk 94IwmUYGx0z1+ptOq77aw8QBA5/zIMoUYf9PDJGfdeD5zuzkm2eQVyHi715icJcMaxIX jZ4ReON5e95tcqaMkupZ1sL9aSoT9YPYcYChUTak6ug2WMGJWEgd3z/QneW7R8EEWXCA j5QeHrnilnHLNyqelHROVzrS9gSXWxJRUNYGUI5Z6t3z1FJ4SZwUCfInAO3Kpw2YHf7B uIUw== X-Gm-Message-State: AOAM531x8bqcnfBDXBWE5MpB8Stdj381tw/fMWFVMnKKywvIbQYLMv+B 3dvcc/ahbSMNgsO9MrTJ57JDg2QzNy+L6lZs3qx/4wtgmKmNEZfntKv63YHdnuT9OKGP5zd1Nzv H1h1PJ9RmUQ6F8St9QEwc3h72nxe/Na7EZyOUv2RamoiClFyMKfn+FsCZfLaAFw+u X-Received: by 2002:a5d:608a:: with SMTP id w10mr27929592wrt.596.1640954902048; Fri, 31 Dec 2021 04:48:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGpjjk4tzWjiPHjEdm1o8BkJteGLRBGEKRaLEhLNX1O1ySxoGayuX1MD+2dg7MQyDSpgtMDQ== X-Received: by 2002:a5d:608a:: with SMTP id w10mr27929581wrt.596.1640954901873; Fri, 31 Dec 2021 04:48:21 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id i8sm27098781wmq.4.2021.12.31.04.48.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/20] tests/unit/test-smp-parse: Split the 'generic' test in valid / invalid Date: Fri, 31 Dec 2021 13:47:40 +0100 Message-Id: <20211231124754.1005747-7-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Split the 'generic' test in two tests: 'valid' and 'invalid'. This will allow us to remove the hack which modifies the MachineClass internal state. Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-3-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 37c6b4981db..425ed6b6b92 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -487,7 +487,7 @@ static void machine_base_class_init(ObjectClass *oc, void *data) mc->name = g_strdup(SMP_MACHINE_NAME); } -static void test_generic(const void *opaque) +static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; Object *obj = object_new(machine_type); @@ -508,6 +508,18 @@ static void test_generic(const void *opaque) smp_parse_test(ms, data, true); } + object_unref(obj); +} + +static void test_generic_invalid(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 = &(SMPTestData){}; + int i; + /* Force invalid min CPUs and max CPUs */ mc->min_cpus = 2; mc->max_cpus = 511; @@ -601,9 +613,12 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); - g_test_add_data_func("/test-smp-parse/generic", + g_test_add_data_func("/test-smp-parse/generic/valid", TYPE_MACHINE, - test_generic); + test_generic_valid); + g_test_add_data_func("/test-smp-parse/generic/invalid", + TYPE_MACHINE, + test_generic_invalid); g_test_add_data_func("/test-smp-parse/with_dies", TYPE_MACHINE, test_with_dies); From patchwork Fri Dec 31 12:47:41 2021 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: 12701949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70DD5C433EF for ; Fri, 31 Dec 2021 13:03:29 +0000 (UTC) Received: from localhost ([::1]:43648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HZA-0000ww-Fe for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:03:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKj-0006G3-TW for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKi-0000l1-94 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LZnXNA41P8rnHQZzG3aZIcc3lAwNKADYkmB/wiXRFOM=; b=KBtkP2HNnyDIWwcUW4YQ3CUl0B7aJjSi06LX6CtnhUvuy20OVDxJJf8zcpIjiKmoCCB5ci nrM7J1ItAoh1sFg7lzbU9/D3esxXNCQZCPeCytBOo7ru7M0AEoLbinXreFqw4rN1N0j6jY 5w0jP5OcUanKIjMdwFErYuseMtfLa6M= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-274-7zwrb-K-P-21yXO-YS4Ybg-1; Fri, 31 Dec 2021 07:48:27 -0500 X-MC-Unique: 7zwrb-K-P-21yXO-YS4Ybg-1 Received: by mail-wr1-f70.google.com with SMTP id d6-20020adfa346000000b001a262748c6fso7497666wrb.12 for ; Fri, 31 Dec 2021 04:48:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LZnXNA41P8rnHQZzG3aZIcc3lAwNKADYkmB/wiXRFOM=; b=WSLSvlqvcUr9jXIhmYlxzL6dFNZgxqTvSLcMDo/X98qnaYS9sx1Kk6+WYKKlK2PoGH u63qfhIIHB3fEwnECYRKL56j9N3qvkfv77GceeGPLD8N13xADcaRLB+28tG+EdkZoIRs 19ef+89ww4N6GZWVtM6Wc4Ec/Ons1Q8XpYNy5VRmhrhn2jlKv/k463Q/1YncqXdIaPIF JLcfn/cgo+fJsWs3hMCzd4hjJprUmZe+ie2TBpj3OnqEU9ZqKzL9n80TLocYpyypT3+G dGyoHx7TuGZ72YkrX5WmPEDTvgew2CENQFgTFGqe6FVpPqNS/b6di6GpsVR5x3SAt5Wz iZ1A== X-Gm-Message-State: AOAM532ngmYmR8GItk7aNUUyUTrMUWXt2fEIa6bPiL3giQm10G44YLWU NMnqzLvVCMJTBdgmOnPgylGAjHAkCKhKule1j3/PLAyR8fUTsZpkbe9a5qEvYgjx299RkVUbYGq 4c68dIpvrWS4OokX5gl9/Ra+CPsRXqQ3ia2ycPy3pI1TK88a7YmpVdydXyNUHor7w X-Received: by 2002:a05:600c:1c26:: with SMTP id j38mr29484090wms.101.1640954906414; Fri, 31 Dec 2021 04:48:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyKs2Fn/4Ysvytqby1xZZsHJbDEmw2T9jWMcZMHMLmEooeT9Tc58gFht5kTWivmv8ogzCxsw== X-Received: by 2002:a05:600c:1c26:: with SMTP id j38mr29484075wms.101.1640954906190; Fri, 31 Dec 2021 04:48:26 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id o12sm26897129wrv.76.2021.12.31.04.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/20] tests/unit/test-smp-parse: Add 'smp-with-dies' machine type Date: Fri, 31 Dec 2021 13:47:41 +0100 Message-Id: <20211231124754.1005747-8-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Avoid modifying the MachineClass internals by adding the 'smp-with-dies' machine, which inherits from TYPE_MACHINE. Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-4-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 425ed6b6b92..f66cf7bb598 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -487,6 +487,16 @@ static void machine_base_class_init(ObjectClass *oc, void *data) mc->name = g_strdup(SMP_MACHINE_NAME); } +static void machine_with_dies_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->min_cpus = MIN_CPUS; + mc->max_cpus = MAX_CPUS; + + mc->smp_props.dies_supported = true; +} + static void test_generic_valid(const void *opaque) { const char *machine_type = opaque; @@ -548,9 +558,6 @@ static void test_with_dies(const void *opaque) unsigned int num_dies = 2; int i; - /* Force the SMP compat properties */ - mc->smp_props.dies_supported = true; - for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { *data = data_generic_valid[i]; unsupported_params_init(mc, data); @@ -588,9 +595,6 @@ static void test_with_dies(const void *opaque) smp_parse_test(ms, data, false); } - /* Restore the SMP compat properties */ - mc->smp_props.dies_supported = false; - object_unref(obj); } @@ -602,6 +606,10 @@ static const TypeInfo smp_machine_types[] = { .class_init = machine_base_class_init, .class_size = sizeof(MachineClass), .instance_size = sizeof(MachineState), + }, { + .name = MACHINE_TYPE_NAME("smp-with-dies"), + .parent = TYPE_MACHINE, + .class_init = machine_with_dies_class_init, } }; @@ -620,7 +628,7 @@ int main(int argc, char *argv[]) TYPE_MACHINE, test_generic_invalid); g_test_add_data_func("/test-smp-parse/with_dies", - TYPE_MACHINE, + MACHINE_TYPE_NAME("smp-with-dies"), test_with_dies); g_test_run(); From patchwork Fri Dec 31 12:47:42 2021 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: 12701948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5741C433EF for ; Fri, 31 Dec 2021 12:57:51 +0000 (UTC) Received: from localhost ([::1]:35562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HTj-0003VV-38 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:57:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKl-0006JY-KC for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKj-0000l6-Si for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pjJ0UEI6mxoPBPhQ4qwChpI2WWsxbhsBTViV87e9vj8=; b=fX0TN9c0OZsCx732xvpoaSC4GFGDP6CCugIHkYri8Dt4mxqQyfsUMhP/yDDsrZ/P7Y8zYI ULBKsjvRCg9RrTCFukPdWq8aYqrYuGKiywMD8kxnqIks+Sh5hdeqOoHyYLyXlJJ+n+uDRN IEWbtltUzjmD/Bl/x9IFAmDkulxXT3U= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-43-KpeGu_FrNQekkKK9gwMKuw-1; Fri, 31 Dec 2021 07:48:32 -0500 X-MC-Unique: KpeGu_FrNQekkKK9gwMKuw-1 Received: by mail-wr1-f72.google.com with SMTP id h7-20020adfaa87000000b001885269a937so7574091wrc.17 for ; Fri, 31 Dec 2021 04:48:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pjJ0UEI6mxoPBPhQ4qwChpI2WWsxbhsBTViV87e9vj8=; b=Mrk8puF67rNM3oQtFeQ1qaxfQFMUQIAy9UGFmU6IGivnbXwzSf6cTieSYZJ3621nmV U8rPmPfaL7u9eJGmnqqsYO54XhUkLRKndae0+m9npdnkmRK51csMTufeIIyfJ5lAnDkl H5uDPJ8FR9uAvJNQHCNuFHDOVLMzw400HaV3q136+XdugejDyg4x8FOs3IKet3JXtrs5 gnvO8kC6Q0Bbst9LUBAo5aCHgEbQRvR7j+no2DU5l1ldBFGRHwOmLhvsKbflVCitYkMt kxrMWFgHuCr3cd+Z14tz6XKs+ivTeSK0PeM4V8mrETkXw0YA1xFFpOTovgsYYIIImBiq R4AQ== X-Gm-Message-State: AOAM530HNdEEOPC7OL+L3JrupEnSLsmvrKgTTdRBm1PV0ra4Dryf/6CV sXH1+U1uFLTK+MR4bjh9c3n4xRe+wSIt4q7+wIPUxaEF6B5ngOZWPZDFDg1lJrTBriKI+Hh7ctE f4jDmtORBWAPHJI2Nfse4NV4yUMqBvw4JiJEa3uEqO4AFXbsNxNC/xSCguP6R6zM+ X-Received: by 2002:a5d:5847:: with SMTP id i7mr14528738wrf.450.1640954910747; Fri, 31 Dec 2021 04:48:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwytI4jANY9FirMbwDS536/kl1pGIL8C8dk6hG/uhRuLHAFY7TSpsl/85aQQT/F8wlj1+Sw0Q== X-Received: by 2002:a5d:5847:: with SMTP id i7mr14528723wrf.450.1640954910588; Fri, 31 Dec 2021 04:48:30 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id i4sm28833365wmd.34.2021.12.31.04.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/20] tests/unit/test-smp-parse: Add 'smp-generic-invalid' machine type Date: Fri, 31 Dec 2021 13:47:42 +0100 Message-Id: <20211231124754.1005747-9-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Avoid modifying the MachineClass internals by adding the 'smp-generic-invalid' machine, which inherits from TYPE_MACHINE. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211216132015.815493-5-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index f66cf7bb598..47e11089e22 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -487,6 +487,17 @@ static void machine_base_class_init(ObjectClass *oc, void *data) mc->name = g_strdup(SMP_MACHINE_NAME); } +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->smp_props.dies_supported = false; +} + static void machine_with_dies_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); @@ -530,10 +541,6 @@ static void test_generic_invalid(const void *opaque) SMPTestData *data = &(SMPTestData){}; int i; - /* Force invalid min CPUs and max CPUs */ - mc->min_cpus = 2; - mc->max_cpus = 511; - for (i = 0; i < ARRAY_SIZE(data_generic_invalid); i++) { *data = data_generic_invalid[i]; unsupported_params_init(mc, data); @@ -541,10 +548,6 @@ static void test_generic_invalid(const void *opaque) smp_parse_test(ms, data, false); } - /* Reset the supported min CPUs and max CPUs */ - mc->min_cpus = MIN_CPUS; - mc->max_cpus = MAX_CPUS; - object_unref(obj); } @@ -606,6 +609,10 @@ static const TypeInfo smp_machine_types[] = { .class_init = machine_base_class_init, .class_size = sizeof(MachineClass), .instance_size = sizeof(MachineState), + }, { + .name = MACHINE_TYPE_NAME("smp-generic-invalid"), + .parent = TYPE_MACHINE, + .class_init = machine_generic_invalid_class_init, }, { .name = MACHINE_TYPE_NAME("smp-with-dies"), .parent = TYPE_MACHINE, @@ -625,7 +632,7 @@ int main(int argc, char *argv[]) TYPE_MACHINE, test_generic_valid); g_test_add_data_func("/test-smp-parse/generic/invalid", - TYPE_MACHINE, + MACHINE_TYPE_NAME("smp-generic-invalid"), test_generic_invalid); g_test_add_data_func("/test-smp-parse/with_dies", MACHINE_TYPE_NAME("smp-with-dies"), From patchwork Fri Dec 31 12:47:43 2021 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: 12701952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80837C433EF for ; Fri, 31 Dec 2021 13:11:47 +0000 (UTC) Received: from localhost ([::1]:51928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HhC-0006sz-9d for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:11:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKp-0006Q9-V0 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKo-0000lP-3T for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nbR8NxQZs7YkrQ3yuCz8vFimELBnb1M3sZi54BOV0WM=; b=QPhyGC+E9gq0U4P9wWe78ESIaOr1NcJHaVN3s/Wytb2970bwK64u0WojfzX3mvCr1Snfwn MWnCSb1coktiVighL0hKmP3Qi40M2UQjD7V+R+w/gGlk1dKSAr5ztJj+pHX2sNh7pxcCf5 gUAEHHMvyUOGS1yJ0DIflOnde71ZTDU= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-237-dwRSv64hON-79luu0s5ATw-1; Fri, 31 Dec 2021 07:48:36 -0500 X-MC-Unique: dwRSv64hON-79luu0s5ATw-1 Received: by mail-wr1-f71.google.com with SMTP id v18-20020a5d5912000000b001815910d2c0so7547137wrd.1 for ; Fri, 31 Dec 2021 04:48:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nbR8NxQZs7YkrQ3yuCz8vFimELBnb1M3sZi54BOV0WM=; b=HVZgzWGrmL8j4Rj8e0ILowxlp6nuOr1CewszuHFYrm+LXWMedn9KXlwFeKstx8yuPp b7o6fW4B4uAwD4qgh5Am7UjJOA/bXaPN6ZoNjzlx2q1/7jZAZEiXbEjsSy5WtqgSsRqT JZTFsqFw58InT8+mTfrkbZ0HMX78JSnsuQaA5i7b0Ec921BA7qReGXNtVrkI5V2JLYze v7UXU4KOcbNoNVMw3JQClzEPLxuaKNQLD1xvfZElwpRy2kpklU19q3QhBCm3BX8C4T4R ypCU6n1UPM6LQPzBi/FPTv+WxgFy3KFWoytJMT9TeXtHn8C//PaGV35wcebqoA+qJB1K eIKw== X-Gm-Message-State: AOAM532LGSPe56N7SsmgSTGUrygqn5+QZgx6kln7q0X0sKgVlC1zslop WW6pFtar0DotI9o2oSny/rIZFl3oc0d2Eu+IQbjaroBNfNY+xJUDZKZ5FvEsKn+BZS3iw5MxmuN 0BgU5jkUfO6dFkxhtuoHXmrOMG9I5FmdfkbfnYBQpNo0trg8wEwfP/bmr+/RVDP0M X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr28538590wri.265.1640954915138; Fri, 31 Dec 2021 04:48:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9YE/5NIGr9Y/NjiZIWtunOEs/HjJFI7BIHdtYrVBFQPtZuaY6MJYxcWN73YRQLGbS81iaYQ== X-Received: by 2002:a05:6000:184e:: with SMTP id c14mr28538574wri.265.1640954914805; Fri, 31 Dec 2021 04:48:34 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id s1sm28612788wmh.35.2021.12.31.04.48.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/20] tests/unit/test-smp-parse: Add 'smp-generic-valid' machine type Date: Fri, 31 Dec 2021 13:47:43 +0100 Message-Id: <20211231124754.1005747-10-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Keep the common TYPE_MACHINE class initialization in machine_base_class_init(), make it abstract, and move the non-common code to a new class: "smp-generic-valid". Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yanan Wang Message-Id: <20211216132015.815493-6-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 47e11089e22..b20bf2c2359 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -478,13 +478,19 @@ static void machine_base_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); + mc->smp_props.prefer_sockets = true; + + mc->name = g_strdup(SMP_MACHINE_NAME); +} + +static void machine_generic_valid_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + mc->min_cpus = MIN_CPUS; mc->max_cpus = MAX_CPUS; - mc->smp_props.prefer_sockets = true; mc->smp_props.dies_supported = false; - - mc->name = g_strdup(SMP_MACHINE_NAME); } static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) @@ -606,9 +612,14 @@ static const TypeInfo smp_machine_types[] = { { .name = TYPE_MACHINE, .parent = TYPE_OBJECT, + .abstract = true, .class_init = machine_base_class_init, .class_size = sizeof(MachineClass), .instance_size = sizeof(MachineState), + }, { + .name = MACHINE_TYPE_NAME("smp-generic-valid"), + .parent = TYPE_MACHINE, + .class_init = machine_generic_valid_class_init, }, { .name = MACHINE_TYPE_NAME("smp-generic-invalid"), .parent = TYPE_MACHINE, @@ -629,7 +640,7 @@ int main(int argc, char *argv[]) g_test_init(&argc, &argv, NULL); g_test_add_data_func("/test-smp-parse/generic/valid", - TYPE_MACHINE, + MACHINE_TYPE_NAME("smp-generic-valid"), test_generic_valid); g_test_add_data_func("/test-smp-parse/generic/invalid", MACHINE_TYPE_NAME("smp-generic-invalid"), From patchwork Fri Dec 31 12:47:44 2021 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: 12701944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 404D6C433FE for ; Fri, 31 Dec 2021 12:55:21 +0000 (UTC) Received: from localhost ([::1]:55178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HRI-00069v-6r for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:55:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53524) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKv-0006VN-8H for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:45 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKt-0000lo-3w for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cHb0d47BqaQovUrZGLdCQsKap1jR8qeraBMow5jr+io=; b=UHG/oNExRHSAt39MTNr1surjs+x+RbaxDm8mIB27G9VCbunSCCRftUTJas5nrTNmfOKFpJ XuDylgNd75zqIzeTZqAHXev5xpgOZIukqI6YTsFkvU5SKpLvNjWunxaIUtFMXNJ9q/SUBq 5rDyeHETwuBBFkyLDc++fcNbKe2oPcs= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-ORoj_-2aOzyASskahBxKlg-1; Fri, 31 Dec 2021 07:48:41 -0500 X-MC-Unique: ORoj_-2aOzyASskahBxKlg-1 Received: by mail-wr1-f70.google.com with SMTP id q21-20020adfab15000000b001a24b36e47eso7487099wrc.2 for ; Fri, 31 Dec 2021 04:48:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cHb0d47BqaQovUrZGLdCQsKap1jR8qeraBMow5jr+io=; b=tYWreeROPkh3U0bAFCIY6rev/T3DoZVohRAB8YZbvIwCbpSnUdjXoxcLDGRr+bVSvh Ve+whIJqcX3EBXGfbVE92G87X0MkA8jSBuJRYVUd1EUcGVKU/oqXFIZ1ezENwm6dlb0n xOS2AVB7IqdZMwSQQKv7NOcn4VKzNxMT85DXtyFaXq/CUmARkdWq6B/3QMDIQDsSzpeo jBZGFPnQX7EOJIRM46yG2Dkae2PZaptN2ZJlF8ZUhhcAe43V05vmhvbjbGNa/GrWQZjs YeOyE7/vsKLGGMTCHKleIX0k+qLKYUohDrcCRS3fmZW5til22pFC/w1MR0uIklJKCEwF cUgw== X-Gm-Message-State: AOAM533hUwlwZitMAntlHTeDUySkOV4zW3oIXfpdVLRSPH/Th9tUR6+L RG3B+PJZS8tR3Kr6rncRLIBtO/vyD9c27wpRpp66WuEIpgg9UMH1GxXa99L6V/D6JyfSaLnUSHZ luUHJTeiqTs+8L/6yXXqnlk7XqszNy/P1PY5HsX9QALfgdaFG0+et2/z+CWgwV4+e X-Received: by 2002:a5d:624f:: with SMTP id m15mr28453959wrv.13.1640954919494; Fri, 31 Dec 2021 04:48:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8tV+HTVMllwUuNbaYaFtmIe6xnL7PYjuMrZsxJOvKNowv2IA3MlKADyRUi5fakEyReup9Wg== X-Received: by 2002:a5d:624f:: with SMTP id m15mr28453947wrv.13.1640954919255; Fri, 31 Dec 2021 04:48:39 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id m3sm26830443wrv.95.2021.12.31.04.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:38 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/20] tests/unit/test-smp-parse: Simplify pointer to compound literal use Date: Fri, 31 Dec 2021 13:47:44 +0100 Message-Id: <20211231124754.1005747-11-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Andrew Jones , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We can simply use a local variable (and pass its pointer) instead of a pointer to a compound literal. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-7-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index b20bf2c2359..395929b66cf 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -520,19 +520,19 @@ static void test_generic_valid(const void *opaque) Object *obj = object_new(machine_type); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); - SMPTestData *data = &(SMPTestData){{ }}; + SMPTestData data = {}; int i; for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { - *data = data_generic_valid[i]; - unsupported_params_init(mc, data); + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); - smp_parse_test(ms, data, true); + 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); + data.config.has_dies = true; + data.config.dies = 1; + smp_parse_test(ms, &data, true); } object_unref(obj); @@ -544,14 +544,14 @@ static void test_generic_invalid(const void *opaque) Object *obj = object_new(machine_type); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); - SMPTestData *data = &(SMPTestData){}; + SMPTestData data = {}; int i; for (i = 0; i < ARRAY_SIZE(data_generic_invalid); i++) { - *data = data_generic_invalid[i]; - unsupported_params_init(mc, data); + data = data_generic_invalid[i]; + unsupported_params_init(mc, &data); - smp_parse_test(ms, data, false); + smp_parse_test(ms, &data, false); } object_unref(obj); @@ -563,45 +563,45 @@ static void test_with_dies(const void *opaque) Object *obj = object_new(machine_type); MachineState *ms = MACHINE(obj); MachineClass *mc = MACHINE_GET_CLASS(obj); - SMPTestData *data = &(SMPTestData){{ }}; + SMPTestData data = {}; unsigned int num_dies = 2; int i; for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { - *data = data_generic_valid[i]; - unsupported_params_init(mc, data); + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); /* when dies parameter is omitted, it will be set as 1 */ - data->expect_prefer_sockets.dies = 1; - data->expect_prefer_cores.dies = 1; + data.expect_prefer_sockets.dies = 1; + data.expect_prefer_cores.dies = 1; - smp_parse_test(ms, data, true); + smp_parse_test(ms, &data, true); /* when dies parameter is specified */ - data->config.has_dies = true; - data->config.dies = num_dies; - if (data->config.has_cpus) { - data->config.cpus *= num_dies; + data.config.has_dies = true; + data.config.dies = num_dies; + if (data.config.has_cpus) { + data.config.cpus *= num_dies; } - if (data->config.has_maxcpus) { - data->config.maxcpus *= num_dies; + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_dies; } - data->expect_prefer_sockets.dies = num_dies; - data->expect_prefer_sockets.cpus *= num_dies; - data->expect_prefer_sockets.max_cpus *= num_dies; - data->expect_prefer_cores.dies = num_dies; - data->expect_prefer_cores.cpus *= num_dies; - data->expect_prefer_cores.max_cpus *= num_dies; + data.expect_prefer_sockets.dies = num_dies; + data.expect_prefer_sockets.cpus *= num_dies; + data.expect_prefer_sockets.max_cpus *= num_dies; + data.expect_prefer_cores.dies = num_dies; + data.expect_prefer_cores.cpus *= num_dies; + data.expect_prefer_cores.max_cpus *= num_dies; - smp_parse_test(ms, data, true); + smp_parse_test(ms, &data, true); } for (i = 0; i < ARRAY_SIZE(data_with_dies_invalid); i++) { - *data = data_with_dies_invalid[i]; - unsupported_params_init(mc, data); + data = data_with_dies_invalid[i]; + unsupported_params_init(mc, &data); - smp_parse_test(ms, data, false); + smp_parse_test(ms, &data, false); } object_unref(obj); From patchwork Fri Dec 31 12:47:45 2021 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: 12701951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4089C433EF for ; Fri, 31 Dec 2021 13:03:42 +0000 (UTC) Received: from localhost ([::1]:43964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HZO-00019g-1a for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:03:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKz-0006Zx-GM for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HKx-0000mB-Rr for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Brj1G/fUhqiziIlPAK7440LnFkqvsAAYMyPJBvFCKgI=; b=gZtErJpTOvBmSSG7x/l7xSPX+lT4EVVC7wRXtmAsJ8vK/gJfohC+fulXoG8IlOAcUbYF7p 8W5WgxY1D3JscAS3amBLhwziICj9YE0sk1GapB5Bg0rTqGjcRCD0kSZPml4BDjqL/MPg69 u6JT7jVg4hsloyyTVZ85uyvIsmPFJOI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-591-A4O3B-krNw-KQmP2rlnqTw-1; Fri, 31 Dec 2021 07:48:45 -0500 X-MC-Unique: A4O3B-krNw-KQmP2rlnqTw-1 Received: by mail-wr1-f72.google.com with SMTP id s30-20020adfa29e000000b001a25caee635so7526607wra.19 for ; Fri, 31 Dec 2021 04:48:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Brj1G/fUhqiziIlPAK7440LnFkqvsAAYMyPJBvFCKgI=; b=AtnuxC89CadzOMu/sKD4/E7jL2kPeaw5dNMSkeHtOybMvQUBfLXK5UEwYhd446NTzK 24s44gOvAowB9UIsL2i7qrvluhRMxuI1XVv934Lh3D2dctDlt/JEcVELN191eLmZgO42 2no+sDwUwhdCcmio3stsgdT3p+qAWFlOxFyf/MnWhU3KlB3dGBODbvMJ6JJ4Y5O/Ve/4 o7rc3L8Ipu5pQE5a8oHIj0NBgNpaPs76QLq2jB4v85Kxtp4ogaq4w8no8Ooh9gH0fyK/ CVTJUDGmZWTF+K+jO+w+FOo6h78zqiDCfg2LrxalWJyCLKfgmZU4bBRWCJo42YKxseCO 0WTg== X-Gm-Message-State: AOAM533NMwKInRuP7naHF6j5aeaIabYvd/fNol6mjWH5lUvvIckt9zwI St5Ml6xSzXGCC7+rxbT7Sp5WFkZSNjHVjuK99uXqYsCbAyBitGRCRqwPO6gc7/yDRF6vR+8SO96 G/mOAF4ZGCXfVhTwZW1unKuguaUTzWk5v8flyFjfIpONMC3G5PrEUrdWXlzsxDdWp X-Received: by 2002:a1c:e909:: with SMTP id q9mr29066568wmc.184.1640954924077; Fri, 31 Dec 2021 04:48:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJy90nhSNQRqRCtDsglq5R4j8vlK7YYBdk+5cfY1o18jPVz+ZSFniMUeYEu5f0EA3d07dHlgYw== X-Received: by 2002:a1c:e909:: with SMTP id q9mr29066551wmc.184.1640954923785; Fri, 31 Dec 2021 04:48:43 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id y13sm30613911wrd.89.2021.12.31.04.48.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/20] tests/unit/test-smp-parse: Constify some pointer/struct Date: Fri, 31 Dec 2021 13:47:45 +0100 Message-Id: <20211231124754.1005747-12-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Andrew Jones , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Declare structures const when we don't need to modify them at runtime. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-8-philmd@redhat.com> --- tests/unit/test-smp-parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 395929b66cf..0f98c9509ee 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -83,7 +83,7 @@ typedef struct SMPTestData { * then test the automatic calculation algorithm of the missing * values in the parser. */ -static struct SMPTestData data_generic_valid[] = { +static const struct SMPTestData data_generic_valid[] = { { /* config: no configuration provided * expect: cpus=1,sockets=1,cores=1,threads=1,maxcpus=1 */ @@ -285,7 +285,7 @@ static struct SMPTestData data_generic_valid[] = { }, }; -static struct SMPTestData data_generic_invalid[] = { +static const struct SMPTestData data_generic_invalid[] = { { /* config: -smp 2,dies=2 */ .config = SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0), @@ -319,7 +319,7 @@ static struct SMPTestData data_generic_invalid[] = { }, }; -static struct SMPTestData data_with_dies_invalid[] = { +static const struct SMPTestData data_with_dies_invalid[] = { { /* config: -smp 16,sockets=2,dies=2,cores=4,threads=2,maxcpus=16 */ .config = SMP_CONFIG_WITH_DIES(T, 16, T, 2, T, 2, T, 4, T, 2, T, 16), @@ -356,7 +356,7 @@ static char *smp_config_to_string(SMPConfiguration *config) config->has_maxcpus ? "true" : "false", config->maxcpus); } -static char *cpu_topology_to_string(CpuTopology *topo) +static char *cpu_topology_to_string(const CpuTopology *topo) { return g_strdup_printf( "(CpuTopology) {\n" @@ -372,7 +372,7 @@ static char *cpu_topology_to_string(CpuTopology *topo) } static void check_parse(MachineState *ms, SMPConfiguration *config, - CpuTopology *expect_topo, const char *expect_err, + const CpuTopology *expect_topo, const char *expect_err, bool is_valid) { g_autofree char *config_str = smp_config_to_string(config); @@ -466,7 +466,7 @@ static void smp_parse_test(MachineState *ms, SMPTestData *data, bool is_valid) } /* The parsed results of the unsupported parameters should be 1 */ -static void unsupported_params_init(MachineClass *mc, SMPTestData *data) +static void unsupported_params_init(const MachineClass *mc, SMPTestData *data) { if (!mc->smp_props.dies_supported) { data->expect_prefer_sockets.dies = 1; From patchwork Fri Dec 31 12:47:46 2021 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: 12701953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE495C433EF for ; Fri, 31 Dec 2021 13:12:11 +0000 (UTC) Received: from localhost ([::1]:52496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3Hha-0007Jm-S1 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:12:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HL5-0006dv-A8 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44475) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HL3-0000mQ-K2 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:48:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hsVRkZQQlYo23KD5v3C/Ge6K5dTEdtnnVoVPT34mCE4=; b=XRg5555KL3mJN8P7EXKHxqqqPfwXEB6El61resA6pIdMhoRyg4Nvp9nNGTfyhdW9oo/55c GF23gSDUsHrtVU+l/tOLwvABL+kg8Pd2T/L2ctX6AEJ7SYn4ERXNr1k6A68WxVKhKzFmTT hrrfsGXMACeYlPdU0A130tlRI/MaqKw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-672-72V_Ud6KPriyDUZ-vRfgTQ-1; Fri, 31 Dec 2021 07:48:49 -0500 X-MC-Unique: 72V_Ud6KPriyDUZ-vRfgTQ-1 Received: by mail-wr1-f71.google.com with SMTP id f13-20020adfe90d000000b001a15c110077so7495399wrm.8 for ; Fri, 31 Dec 2021 04:48:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hsVRkZQQlYo23KD5v3C/Ge6K5dTEdtnnVoVPT34mCE4=; b=c0AVyJ09s81CRfignbEmZnvKvyABrIOTsAhZfr/zZfefHWpA66JIdm+7rNrm/4ldbO kSu3AJlmNxJPnzsS9ZLqsUeEE9myOxRg73qQCcnrOrMo8FW6tW1C2ibuxUK6lWSu7iy7 FxnJQHub+6XB52WDpXXMwjToZ10N3rE2fczHtuDU7hdDaVD4D/invLzEcbwJ7IO+GU5j FHYfiLxg9V0v8KpoQuUD43Ygi5DwD+CcARZB3N0ABmWFC4PfQHEalWgpksYbTT2s5GzU IJ9Z3brBpk56noZMMDrOZVbYsWfY6GK0vgKFC9MJoYJ3TYVOESOJIfMD9GyWnv3eILb9 zTUg== X-Gm-Message-State: AOAM533lBj3pHbd8/2ogx6ZRxIauVAymNU078SZdfBwLe6AiGs/oeHid wEbSuJP+9uiV0v/G1LSYMKxOiRgLjJdoM7PddPr1SWKPqwFwRG5VROYLoYInZHQiPk0gg4b0jsx x//Q4PMiwnx4YTaF4gjHpiUTRSslN4+JKKSqAUexviHITxkMQ8sU32XQkBBz21Kn4 X-Received: by 2002:a5d:5610:: with SMTP id l16mr6398378wrv.418.1640954928346; Fri, 31 Dec 2021 04:48:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyieMidFLfH0xBtqYWhHJ0rm5v6YpWRS1mJ4KxW21ZPG/WM6HPzrQIEfgaoZwPKPzPnbCpaUQ== X-Received: by 2002:a5d:5610:: with SMTP id l16mr6398363wrv.418.1640954928129; Fri, 31 Dec 2021 04:48:48 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id y8sm29630532wrd.10.2021.12.31.04.48.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/20] hw/core: Rename smp_parse() -> machine_parse_smp_config() Date: Fri, 31 Dec 2021 13:47:46 +0100 Message-Id: <20211231124754.1005747-13-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Andrew Jones , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" All methods related to MachineState are prefixed with "machine_". smp_parse() does not need to be an exception. Rename it and const'ify the SMPConfiguration argument, since it doesn't need to be modified. Reviewed-by: Andrew Jones Reviewed-by: Richard Henderson Reviewed-by: Yanan Wang Tested-by: Yanan Wang Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211216132015.815493-9-philmd@redhat.com> --- include/hw/boards.h | 3 ++- hw/core/machine-smp.c | 6 ++++-- hw/core/machine.c | 2 +- tests/unit/test-smp-parse.c | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 9c1c1901046..7597cec4400 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -34,7 +34,8 @@ HotpluggableCPUList *machine_query_hotpluggable_cpus(MachineState *machine); void machine_set_cpu_numa_node(MachineState *machine, const CpuInstanceProperties *props, Error **errp); -void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp); +void machine_parse_smp_config(MachineState *ms, + const SMPConfiguration *config, Error **errp); /** * machine_class_allow_dynamic_sysbus_dev: Add type to list of valid devices diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 116a0cbbfab..2cbfd574293 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -44,7 +44,8 @@ static char *cpu_hierarchy_to_string(MachineState *ms) } /* - * smp_parse - Generic function used to parse the given SMP configuration + * machine_parse_smp_config: Generic function used to parse the given + * SMP configuration * * Any missing parameter in "cpus/maxcpus/sockets/cores/threads" will be * automatically computed based on the provided ones. @@ -63,7 +64,8 @@ static char *cpu_hierarchy_to_string(MachineState *ms) * introduced topology members which are likely to be target specific should * be directly set as 1 if they are omitted (e.g. dies for PC since 4.1). */ -void smp_parse(MachineState *ms, SMPConfiguration *config, Error **errp) +void machine_parse_smp_config(MachineState *ms, + const SMPConfiguration *config, Error **errp) { MachineClass *mc = MACHINE_GET_CLASS(ms); unsigned cpus = config->has_cpus ? config->cpus : 0; diff --git a/hw/core/machine.c b/hw/core/machine.c index 53a99abc560..3993c534b90 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -761,7 +761,7 @@ static void machine_set_smp(Object *obj, Visitor *v, const char *name, return; } - smp_parse(ms, config, errp); + machine_parse_smp_config(ms, config, errp); } static void machine_class_init(ObjectClass *oc, void *data) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 0f98c9509ee..b6df8137fcc 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -337,7 +337,7 @@ static const struct SMPTestData data_with_dies_invalid[] = { }, }; -static char *smp_config_to_string(SMPConfiguration *config) +static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( "(SMPConfiguration) {\n" @@ -371,7 +371,7 @@ static char *cpu_topology_to_string(const CpuTopology *topo) topo->cores, topo->threads, topo->max_cpus); } -static void check_parse(MachineState *ms, SMPConfiguration *config, +static void check_parse(MachineState *ms, const SMPConfiguration *config, const CpuTopology *expect_topo, const char *expect_err, bool is_valid) { @@ -380,8 +380,8 @@ static void check_parse(MachineState *ms, SMPConfiguration *config, g_autofree char *output_topo_str = NULL; Error *err = NULL; - /* call the generic parser smp_parse() */ - smp_parse(ms, config, &err); + /* call the generic parser */ + machine_parse_smp_config(ms, config, &err); output_topo_str = cpu_topology_to_string(&ms->smp); From patchwork Fri Dec 31 12:47:47 2021 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: 12701956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4AA8CC433EF for ; Fri, 31 Dec 2021 13:22:52 +0000 (UTC) Received: from localhost ([::1]:33846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3Hrv-0005lD-7u for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:22:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLI-0006jB-8n for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLE-0000nj-77 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954942; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9JX8D87/LEKsaXl8Ex10SP502prmszBQakHSaMn3/tI=; b=jJSyozcwTiZuKRR89To5AVKGGpRbkjPRgUQbiKujvh5jYtjUm4zkFhyiTIrSsxKkU9hxNW Tv/DjxlfIYdKWTBIgtMd+maHUWdiwaaaYTlNRAEPlUOP0ReoNBzjvuIfzLvy/kKQ3AgI3Q jmTlLjWizuruYY/ht58hLxoPNiafAlg= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-154-j91n6NZONjCHTzJEBZvfLA-1; Fri, 31 Dec 2021 07:48:54 -0500 X-MC-Unique: j91n6NZONjCHTzJEBZvfLA-1 Received: by mail-wr1-f70.google.com with SMTP id c16-20020adfa310000000b001a2349890e1so7494546wrb.0 for ; Fri, 31 Dec 2021 04:48:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9JX8D87/LEKsaXl8Ex10SP502prmszBQakHSaMn3/tI=; b=6RPpBEJRwxS4fecQ7M98VKkxVtscQiy2xBb6qa2xAX733q3gTxnR59aa8tCWwNS5hp pTzGdtpJP+6Evon3njH5S7DcO1lyK9WAfOG+SlZHUQQpSTCZBufoQMZrdjfKF2E3h+bS u1bAz7ENQ5cAODJW1dGrDhtRY1PJIQct/ntGiyX9RE+xKoixDxIP18p9qQVUuC/wsvkv GcmPyPRTVJEzmXs5SgE2TMM01WrY+t+1kksNLO8gJhPkW48StxcWiIHrKeLVVFJgpBVx 4DQaacS86/ajJxMS3m9KEpIYMvRKQY64O+VBTZXY9PHM/H8ceTWrj9IAlNPUAKKSbBsN fqyA== X-Gm-Message-State: AOAM532n/3tFm+j+sqTB38PGTpBoZw27nyhC+6NU+JRL0+MoPnOtuEl2 /ZtV+UWZ8hry+BYUhCq4MwIdRC/aBezGRpktVgb3teYpkoa2+Flb8RCL0Ayzr0vYLAJN9CvDIU+ AURSrUZjcfd5wwmociJFtF59O79JxXpxfbH78McBPelQCIQm9aOUG5wsM03x3IePo X-Received: by 2002:a5d:6dac:: with SMTP id u12mr28656591wrs.233.1640954932715; Fri, 31 Dec 2021 04:48:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzo8OWlah1bRgYua66cksuSvwH/bV8Mog7xAMHg3MPIkkDberGOMj4p6rumOE4S8s5Y+DfLEQ== X-Received: by 2002:a5d:6dac:: with SMTP id u12mr28656571wrs.233.1640954932340; Fri, 31 Dec 2021 04:48:52 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id m17sm26763398wrw.11.2021.12.31.04.48.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/20] qemu-options: Improve readability of SMP related Docs Date: Fri, 31 Dec 2021 13:47:47 +0100 Message-Id: <20211231124754.1005747-14-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang We have a description in qemu-options.hx for each CPU topology parameter to explain what it exactly means, and also an extra declaration for the target-specific one, e.g. "for PC only" when describing "dies", and "for PC, it's on one die" when describing "cores". Now we are going to introduce one more non-generic parameter "clusters", it will make the Doc less readable and if we still continue to use the legacy way to describe it. So let's at first make two tweaks of the Docs to improve the readability and also scalability: 1) In the -help text: Delete the extra specific declaration and describe each topology parameter level by level. Then add a note to declare that different machines may support different subsets and the actual meaning of the supported parameters will vary accordingly. 2) In the rST text: List all the sub-hierarchies currently supported in QEMU, and correspondingly give an example of -smp configuration for each of them. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-2-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- qemu-options.hx | 74 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 16 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 7d475109478..b39377de3fc 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -207,14 +207,26 @@ ERST DEF("smp", HAS_ARG, QEMU_OPTION_smp, "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n" - " set the number of CPUs to 'n' [default=1]\n" + " set the number of initial CPUs to 'n' [default=1]\n" " maxcpus= maximum number of total CPUs, including\n" " offline CPUs for hotplug, etc\n" - " sockets= number of discrete sockets in the system\n" - " dies= number of CPU dies on one socket (for PC only)\n" - " cores= number of CPU cores on one socket (for PC, it's on one die)\n" - " threads= number of threads on one CPU core\n", - QEMU_ARCH_ALL) + " sockets= number of sockets on the machine board\n" + " dies= number of dies in one socket\n" + " cores= number of cores in one die\n" + " threads= number of threads in one core\n" + "Note: Different machines may have different subsets of the CPU topology\n" + " parameters supported, so the actual meaning of the supported parameters\n" + " will vary accordingly. For example, for a machine type that supports a\n" + " three-level CPU hierarchy of sockets/cores/threads, the parameters will\n" + " sequentially mean as below:\n" + " sockets means the number of sockets on the machine board\n" + " cores means the number of cores in one socket\n" + " threads means the number of threads in one core\n" + " For a particular machine type board, an expected CPU topology hierarchy\n" + " can be defined through the supported sub-option. Unsupported parameters\n" + " can also be provided in addition to the sub-option, but their values\n" + " must be set as 1 in the purpose of correct parsing.\n", + QEMU_ARCH_ALL) SRST ``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]`` Simulate a SMP system with '\ ``n``\ ' CPUs initially present on @@ -225,27 +237,57 @@ SRST initial CPU count will match the maximum number. When only one of them is given then the omitted one will be set to its counterpart's value. Both parameters may be specified, but the maximum number of CPUs must - be equal to or greater than the initial CPU count. Both parameters are - subject to an upper limit that is determined by the specific machine - type chosen. + be equal to or greater than the initial CPU count. Product of the + CPU topology hierarchy must be equal to the maximum number of CPUs. + Both parameters are subject to an upper limit that is determined by + the specific machine type chosen. - To control reporting of CPU topology information, the number of sockets, - dies per socket, cores per die, and threads per core can be specified. - The sum `` sockets * cores * dies * threads `` must be equal to the - maximum CPU count. CPU targets may only support a subset of the topology - parameters. Where a CPU target does not support use of a particular - topology parameter, its value should be assumed to be 1 for the purpose - of computing the CPU maximum count. + To control reporting of CPU topology information, values of the topology + parameters can be specified. Machines may only support a subset of the + parameters and different machines may have different subsets supported + which vary depending on capacity of the corresponding CPU targets. So + for a particular machine type board, an expected topology hierarchy can + be defined through the supported sub-option. Unsupported parameters can + also be provided in addition to the sub-option, but their values must be + set as 1 in the purpose of correct parsing. Either the initial CPU count, or at least one of the topology parameters must be specified. The specified parameters must be greater than zero, explicit configuration like "cpus=0" is not allowed. Values for any omitted parameters will be computed from those which are given. + + For example, the following sub-option defines a CPU topology hierarchy + (2 sockets totally on the machine, 2 cores per socket, 2 threads per + core) for a machine that only supports sockets/cores/threads. + Some members of the option can be omitted but their values will be + automatically computed: + + :: + + -smp 8,sockets=2,cores=2,threads=2,maxcpus=8 + + The following sub-option defines a CPU topology hierarchy (2 sockets + totally on the machine, 2 dies per socket, 2 cores per die, 2 threads + per core) for PC machines which support sockets/dies/cores/threads. + Some members of the option can be omitted but their values will be + automatically computed: + + :: + + -smp 16,sockets=2,dies=2,cores=2,threads=2,maxcpus=16 + Historically preference was given to the coarsest topology parameters when computing missing values (ie sockets preferred over cores, which were preferred over threads), however, this behaviour is considered liable to change. Prior to 6.2 the preference was sockets over cores over threads. Since 6.2 the preference is cores over sockets over threads. + + For example, the following option defines a machine board with 2 sockets + of 1 core before 6.2 and 1 socket of 2 cores after 6.2: + + :: + + -smp 2 ERST DEF("numa", HAS_ARG, QEMU_OPTION_numa, From patchwork Fri Dec 31 12:47:48 2021 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: 12701954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5055CC433EF for ; Fri, 31 Dec 2021 13:16:59 +0000 (UTC) Received: from localhost ([::1]:57302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HmE-0002PY-4y for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:16:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLC-0006iG-Ot for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28874) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLA-0000nR-GZ for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wRGnTZ/XLILKmWFtYsMNltRv2S3GsR7Kd42iwaxNPRc=; b=c3TQtHBXu6D0QCs+Zu+cNknhg1E8kDeO71BS5pm5tI1gdNYlwCMA10Vht37wpN/v9734aI OgHb5YyAvv7ps5J4+nkfUoPOj1KcNRDSKm6OlOHmuzrRZQh/MyvNoLaprvD+4nIrgdMsMO sVjQQLHa2YTg0LPjeDjuS0IIkRI2qcs= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-39-Q6AsUd0JOHOkf_Y6eaSnPw-1; Fri, 31 Dec 2021 07:48:58 -0500 X-MC-Unique: Q6AsUd0JOHOkf_Y6eaSnPw-1 Received: by mail-wr1-f69.google.com with SMTP id v18-20020a5d5912000000b001815910d2c0so7547481wrd.1 for ; Fri, 31 Dec 2021 04:48:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wRGnTZ/XLILKmWFtYsMNltRv2S3GsR7Kd42iwaxNPRc=; b=wYeoyHRzlnB4n2OxAmiwr53AFJaieW5DPqPQawmpT2Vzjp5xTcrijAlYEqEIl9u2aH SMBnCU32MLurJa5aWNtN3sTXOL+MyK8Og1j5joSxYohElaSYNK3dirOMdt18fI1SKarK FCJ5yjGDVliF9Hgo9/lMMs0RBs+6RBvQLRqCPrGqOyhRJknf349NLfhn+lTTWWUjDmVa d2UmaYL0yUNE9Cg1kN7JhlCx0BiRf13Bo1dj2H6dXTB5JzvBFlQ9a4lByOWdnUm/3V0n tvDRTGPn+tTHmtgp0t5DeI5XYzwKQUsH6Rw8E00GpARB8TVQNrmxxt7WM5jYqN1QLq8W E2qA== X-Gm-Message-State: AOAM532XRNwbPoiGUCT9d/vVNhPvn0GJggeIsLnyxz6e7uFqTbjE7u6n KZN/64/KNtNZ+52XAjrkWVX1ZsgNHcaG+3KUkoEO82NSquAsc+syc53pNES2Kz1TQZwAR1xCcsu Bjs4yp0sIQtXhvlEzgOZRjxlWMtdXBiazCfheVSO12OPY13bwtbtwhDXwL85WLnlA X-Received: by 2002:a05:6000:2c9:: with SMTP id o9mr29313047wry.377.1640954936968; Fri, 31 Dec 2021 04:48:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOX7ujFYtjAJ/WubxHtWh4q+rNs2hLoB/xDUv76yYDBP3mJiM8jtRG3xb7jDx5xYvvh1ziHg== X-Received: by 2002:a05:6000:2c9:: with SMTP id o9mr29313027wry.377.1640954936582; Fri, 31 Dec 2021 04:48:56 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id ay29sm28438051wmb.13.2021.12.31.04.48.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:48:56 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/20] hw/core/machine: Introduce CPU cluster topology support Date: Fri, 31 Dec 2021 13:47:48 +0100 Message-Id: <20211231124754.1005747-15-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang The new Cluster-Aware Scheduling support has landed in Linux 5.16, which has been proved to benefit the scheduling performance (e.g. load balance and wake_affine strategy) on both x86_64 and AArch64. So now in Linux 5.16 we have four-level arch-neutral CPU topology definition like below and a new scheduler level for clusters. struct cpu_topology { int thread_id; int core_id; int cluster_id; int package_id; int llc_id; cpumask_t thread_sibling; cpumask_t core_sibling; cpumask_t cluster_sibling; cpumask_t llc_sibling; } A cluster generally means a group of CPU cores which share L2 cache or other mid-level resources, and it is the shared resources that is used to improve scheduler's behavior. From the point of view of the size range, it's between CPU die and CPU core. For example, on some ARM64 Kunpeng servers, we have 6 clusters in each NUMA node, and 4 CPU cores in each cluster. The 4 CPU cores share a separate L2 cache and a L3 cache tag, which brings cache affinity advantage. In virtualization, on the Hosts which have pClusters (physical clusters), if we can design a vCPU topology with cluster level for guest kernel and have a dedicated vCPU pinning. A Cluster-Aware Guest kernel can also make use of the cache affinity of CPU clusters to gain similar scheduling performance. This patch adds infrastructure for CPU cluster level topology configuration and parsing, so that the user can specify cluster parameter if their machines support it. Signed-off-by: Yanan Wang Message-Id: <20211228092221.21068-3-wangyanan55@huawei.com> Reviewed-by: Philippe Mathieu-Daudé [PMD: Added '(since 7.0)' to @clusters in qapi/machine.json] Signed-off-by: Philippe Mathieu-Daudé --- qapi/machine.json | 5 ++++- include/hw/boards.h | 6 +++++- hw/core/machine-smp.c | 26 +++++++++++++++++++------- hw/core/machine.c | 3 +++ softmmu/vl.c | 3 +++ qemu-options.hx | 7 ++++--- 6 files changed, 38 insertions(+), 12 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index edeab6084b7..372535b3482 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1404,7 +1404,9 @@ # # @dies: number of dies per socket in the CPU topology # -# @cores: number of cores per die in the CPU topology +# @clusters: number of clusters per die in the CPU topology (since 7.0) +# +# @cores: number of cores per cluster in the CPU topology # # @threads: number of threads per core in the CPU topology # @@ -1416,6 +1418,7 @@ '*cpus': 'int', '*sockets': 'int', '*dies': 'int', + '*clusters': 'int', '*cores': 'int', '*threads': 'int', '*maxcpus': 'int' } } diff --git a/include/hw/boards.h b/include/hw/boards.h index 7597cec4400..f49a2578ead 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -129,10 +129,12 @@ typedef struct { * SMPCompatProps: * @prefer_sockets - whether sockets are preferred over cores in smp parsing * @dies_supported - whether dies are supported by the machine + * @clusters_supported - whether clusters are supported by the machine */ typedef struct { bool prefer_sockets; bool dies_supported; + bool clusters_supported; } SMPCompatProps; /** @@ -299,7 +301,8 @@ typedef struct DeviceMemoryState { * @cpus: the number of present logical processors on the machine * @sockets: the number of sockets on the machine * @dies: the number of dies in one socket - * @cores: the number of cores in one die + * @clusters: the number of clusters in one die + * @cores: the number of cores in one cluster * @threads: the number of threads in one core * @max_cpus: the maximum number of logical processors on the machine */ @@ -307,6 +310,7 @@ typedef struct CpuTopology { unsigned int cpus; unsigned int sockets; unsigned int dies; + unsigned int clusters; unsigned int cores; unsigned int threads; unsigned int max_cpus; diff --git a/hw/core/machine-smp.c b/hw/core/machine-smp.c index 2cbfd574293..b39ed21e654 100644 --- a/hw/core/machine-smp.c +++ b/hw/core/machine-smp.c @@ -37,6 +37,10 @@ static char *cpu_hierarchy_to_string(MachineState *ms) g_string_append_printf(s, " * dies (%u)", ms->smp.dies); } + if (mc->smp_props.clusters_supported) { + g_string_append_printf(s, " * clusters (%u)", ms->smp.clusters); + } + g_string_append_printf(s, " * cores (%u)", ms->smp.cores); g_string_append_printf(s, " * threads (%u)", ms->smp.threads); @@ -71,6 +75,7 @@ void machine_parse_smp_config(MachineState *ms, unsigned cpus = config->has_cpus ? config->cpus : 0; unsigned sockets = config->has_sockets ? config->sockets : 0; unsigned dies = config->has_dies ? config->dies : 0; + unsigned clusters = config->has_clusters ? config->clusters : 0; unsigned cores = config->has_cores ? config->cores : 0; unsigned threads = config->has_threads ? config->threads : 0; unsigned maxcpus = config->has_maxcpus ? config->maxcpus : 0; @@ -82,6 +87,7 @@ void machine_parse_smp_config(MachineState *ms, if ((config->has_cpus && config->cpus == 0) || (config->has_sockets && config->sockets == 0) || (config->has_dies && config->dies == 0) || + (config->has_clusters && config->clusters == 0) || (config->has_cores && config->cores == 0) || (config->has_threads && config->threads == 0) || (config->has_maxcpus && config->maxcpus == 0)) { @@ -97,8 +103,13 @@ void machine_parse_smp_config(MachineState *ms, error_setg(errp, "dies not supported by this machine's CPU topology"); return; } + 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; /* compute missing values based on the provided ones */ if (cpus == 0 && maxcpus == 0) { @@ -113,41 +124,42 @@ void machine_parse_smp_config(MachineState *ms, if (sockets == 0) { cores = cores > 0 ? cores : 1; threads = threads > 0 ? threads : 1; - sockets = maxcpus / (dies * cores * threads); + sockets = maxcpus / (dies * clusters * cores * threads); } else if (cores == 0) { threads = threads > 0 ? threads : 1; - cores = maxcpus / (sockets * dies * threads); + cores = maxcpus / (sockets * dies * clusters * threads); } } else { /* prefer cores over sockets since 6.2 */ if (cores == 0) { sockets = sockets > 0 ? sockets : 1; threads = threads > 0 ? threads : 1; - cores = maxcpus / (sockets * dies * threads); + cores = maxcpus / (sockets * dies * clusters * threads); } else if (sockets == 0) { threads = threads > 0 ? threads : 1; - sockets = maxcpus / (dies * cores * threads); + sockets = maxcpus / (dies * clusters * cores * threads); } } /* try to calculate omitted threads at last */ if (threads == 0) { - threads = maxcpus / (sockets * dies * cores); + threads = maxcpus / (sockets * dies * clusters * cores); } } - maxcpus = maxcpus > 0 ? maxcpus : sockets * dies * cores * threads; + maxcpus = maxcpus > 0 ? maxcpus : sockets * dies * clusters * cores * threads; cpus = cpus > 0 ? cpus : maxcpus; ms->smp.cpus = cpus; ms->smp.sockets = sockets; ms->smp.dies = dies; + ms->smp.clusters = clusters; ms->smp.cores = cores; ms->smp.threads = threads; ms->smp.max_cpus = maxcpus; /* sanity-check of the computed topology */ - if (sockets * dies * cores * threads != maxcpus) { + if (sockets * dies * clusters * cores * threads != maxcpus) { g_autofree char *topo_msg = cpu_hierarchy_to_string(ms); error_setg(errp, "Invalid CPU topology: " "product of the hierarchy must match maxcpus: " diff --git a/hw/core/machine.c b/hw/core/machine.c index 3993c534b90..a4a2df405f3 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -742,10 +742,12 @@ static void machine_get_smp(Object *obj, Visitor *v, const char *name, .has_cpus = true, .cpus = ms->smp.cpus, .has_sockets = true, .sockets = ms->smp.sockets, .has_dies = true, .dies = ms->smp.dies, + .has_clusters = true, .clusters = ms->smp.clusters, .has_cores = true, .cores = ms->smp.cores, .has_threads = true, .threads = ms->smp.threads, .has_maxcpus = true, .maxcpus = ms->smp.max_cpus, }; + if (!visit_type_SMPConfiguration(v, name, &config, &error_abort)) { return; } @@ -932,6 +934,7 @@ static void machine_initfn(Object *obj) ms->smp.max_cpus = mc->default_cpus; ms->smp.sockets = 1; ms->smp.dies = 1; + ms->smp.clusters = 1; ms->smp.cores = 1; ms->smp.threads = 1; } diff --git a/softmmu/vl.c b/softmmu/vl.c index 620a1f1367e..d9e4c619d3e 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -726,6 +726,9 @@ static QemuOptsList qemu_smp_opts = { }, { .name = "dies", .type = QEMU_OPT_NUMBER, + }, { + .name = "clusters", + .type = QEMU_OPT_NUMBER, }, { .name = "cores", .type = QEMU_OPT_NUMBER, diff --git a/qemu-options.hx b/qemu-options.hx index b39377de3fc..fd1f8135fb5 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -206,13 +206,14 @@ SRST ERST DEF("smp", HAS_ARG, QEMU_OPTION_smp, - "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]\n" + "-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]\n" " set the number of initial CPUs to 'n' [default=1]\n" " maxcpus= maximum number of total CPUs, including\n" " offline CPUs for hotplug, etc\n" " sockets= number of sockets on the machine board\n" " dies= number of dies in one socket\n" - " cores= number of cores in one die\n" + " clusters= number of clusters in one die\n" + " cores= number of cores in one cluster\n" " threads= number of threads in one core\n" "Note: Different machines may have different subsets of the CPU topology\n" " parameters supported, so the actual meaning of the supported parameters\n" @@ -228,7 +229,7 @@ DEF("smp", HAS_ARG, QEMU_OPTION_smp, " must be set as 1 in the purpose of correct parsing.\n", QEMU_ARCH_ALL) SRST -``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,cores=cores][,threads=threads]`` +``-smp [[cpus=]n][,maxcpus=maxcpus][,sockets=sockets][,dies=dies][,clusters=clusters][,cores=cores][,threads=threads]`` Simulate a SMP system with '\ ``n``\ ' CPUs initially present on the machine type board. On boards supporting CPU hotplug, the optional '\ ``maxcpus``\ ' parameter can be set to enable further CPUs to be From patchwork Fri Dec 31 12:47:49 2021 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: 12701941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A3056C433EF for ; Fri, 31 Dec 2021 12:55:17 +0000 (UTC) Received: from localhost ([::1]:54978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HRE-00061u-7s for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:55:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLI-0006jA-8k for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLF-0000nr-GH for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XCjuVcTQ882USvAWxyDE+kQvzyHlN9CrhkHSlEa88PU=; b=d3ffUxkNdjzX4e+c7+oBjq1rc4g78T6BpaVR9IULYegM3quhGEOL082n9O5gU29VI9DRg5 X3mubTv1/snOZ03jSrYpZs7KHB0fDp2UY7lwoE2iluldf0lhBHD5/Zn2GpTUhV3Eqg9Cng lh15+sxcpzkxpL3NiUwa9+ET4uxJzoI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-BVDzD5f8NNOiAPcm1jf85g-1; Fri, 31 Dec 2021 07:49:02 -0500 X-MC-Unique: BVDzD5f8NNOiAPcm1jf85g-1 Received: by mail-wr1-f69.google.com with SMTP id s30-20020adfa29e000000b001a25caee635so7526837wra.19 for ; Fri, 31 Dec 2021 04:49:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XCjuVcTQ882USvAWxyDE+kQvzyHlN9CrhkHSlEa88PU=; b=7g+aTj0hv38bL5Mq2kublYtqYutdfclQGNYRmFOgXKhdrAeFc7X9XUAgEoRn4qGDWy y6a+Sc6nSMaPXzTDE8iedR6ythUcv52Hvs5bdyfjJhJvGJiq6EqmOuBh2BQOX5vq4aF1 bCp5rkjgmX1VjvCN6b6Xwb/4PcXwclUbHZf0dST/nVZ1tZ2P/sVr29Q/JgmCp2Rud3s0 fOAfTzwFilrOFUOP1DT6i85IO00/NYcKY33aOg5ez3HSXlTMO+MI7QeIuMaHc/O7uv8/ Pnp6xqPiA/o3C0tdjf9IPqNLtWXUmjsZFtdBz5A8mdsLgRmOReL5AscOlt9AA9yqIliV Qiqw== X-Gm-Message-State: AOAM530qzzfW1hAz+iaYPcUMveengF0wMJYzyhsxQDu4sts3nsOV1R0i Wqp3L+KlM/sjiAPKiBGhI/xPnJ4q4XEI5YpG0D/Bhr1i+IcctGf63UsdbkJOcmtkIifg4LQGhkG Txb/kyxrESjtG6f0RL1pbEkzfIYagOaMnfWXln/TGG+N4s45E11MwvD3rsOCtlvQn X-Received: by 2002:a5d:65d2:: with SMTP id e18mr6677514wrw.310.1640954941186; Fri, 31 Dec 2021 04:49:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMuznmFowzZ1h+S1ZeWEN3+iVQLWSKwyrbZ8HMnUgP/RVSfhjOhYbrTiwdRISEOt+j2Qn0OQ== X-Received: by 2002:a5d:65d2:: with SMTP id e18mr6677498wrw.310.1640954940877; Fri, 31 Dec 2021 04:49:00 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id m3sm26831117wrv.95.2021.12.31.04.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/20] tests/unit/test-smp-parse: Add testcases for CPU clusters Date: Fri, 31 Dec 2021 13:47:49 +0100 Message-Id: <20211231124754.1005747-16-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Add testcases for parsing of the four-level CPU topology hierarchy, ie sockets/clusters/cores/threads, which will be supported on ARM virt machines. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-5-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 130 ++++++++++++++++++++++++++++++++++-- 1 file changed, 123 insertions(+), 7 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index b6df8137fcc..331719bbc4b 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -61,6 +61,20 @@ .has_maxcpus = hf, .maxcpus = f, \ } +/* + * Currently a 4-level topology hierarchy is supported on ARM virt machines + * -sockets/clusters/cores/threads + */ +#define SMP_CONFIG_WITH_CLUSTERS(ha, a, hb, b, hc, c, hd, d, he, e, hf, f) \ + { \ + .has_cpus = ha, .cpus = a, \ + .has_sockets = hb, .sockets = b, \ + .has_clusters = hc, .clusters = c, \ + .has_cores = hd, .cores = d, \ + .has_threads = he, .threads = e, \ + .has_maxcpus = hf, .maxcpus = f, \ + } + /** * @config - the given SMP configuration * @expect_prefer_sockets - the expected parsing result for the @@ -290,6 +304,10 @@ static const struct SMPTestData data_generic_invalid[] = { /* config: -smp 2,dies=2 */ .config = SMP_CONFIG_WITH_DIES(T, 2, F, 0, T, 2, F, 0, F, 0, F, 0), .expect_error = "dies not supported by this machine's CPU topology", + }, { + /* 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 8,sockets=2,cores=4,threads=2,maxcpus=8 */ .config = SMP_CONFIG_GENERIC(T, 8, T, 2, T, 4, T, 2, T, 8), @@ -337,20 +355,40 @@ static const struct SMPTestData data_with_dies_invalid[] = { }, }; +static const struct SMPTestData data_with_clusters_invalid[] = { + { + /* config: -smp 16,sockets=2,clusters=2,cores=4,threads=2,maxcpus=16 */ + .config = SMP_CONFIG_WITH_CLUSTERS(T, 16, T, 2, T, 2, T, 4, T, 2, T, 16), + .expect_error = "Invalid CPU topology: " + "product of the hierarchy must match maxcpus: " + "sockets (2) * clusters (2) * cores (4) * threads (2) " + "!= maxcpus (16)", + }, { + /* config: -smp 34,sockets=2,clusters=2,cores=4,threads=2,maxcpus=32 */ + .config = SMP_CONFIG_WITH_CLUSTERS(T, 34, T, 2, T, 2, T, 4, T, 2, T, 32), + .expect_error = "Invalid CPU topology: " + "maxcpus must be equal to or greater than smp: " + "sockets (2) * clusters (2) * cores (4) * threads (2) " + "== maxcpus (32) < smp_cpus (34)", + }, +}; + static char *smp_config_to_string(const SMPConfiguration *config) { return g_strdup_printf( "(SMPConfiguration) {\n" - " .has_cpus = %5s, cpus = %" PRId64 ",\n" - " .has_sockets = %5s, sockets = %" PRId64 ",\n" - " .has_dies = %5s, dies = %" PRId64 ",\n" - " .has_cores = %5s, cores = %" PRId64 ",\n" - " .has_threads = %5s, threads = %" PRId64 ",\n" - " .has_maxcpus = %5s, maxcpus = %" PRId64 ",\n" + " .has_cpus = %5s, cpus = %" PRId64 ",\n" + " .has_sockets = %5s, sockets = %" PRId64 ",\n" + " .has_dies = %5s, dies = %" PRId64 ",\n" + " .has_clusters = %5s, clusters = %" PRId64 ",\n" + " .has_cores = %5s, cores = %" PRId64 ",\n" + " .has_threads = %5s, threads = %" PRId64 ",\n" + " .has_maxcpus = %5s, maxcpus = %" PRId64 ",\n" "}", config->has_cpus ? "true" : "false", config->cpus, config->has_sockets ? "true" : "false", config->sockets, config->has_dies ? "true" : "false", config->dies, + config->has_clusters ? "true" : "false", config->clusters, config->has_cores ? "true" : "false", config->cores, config->has_threads ? "true" : "false", config->threads, config->has_maxcpus ? "true" : "false", config->maxcpus); @@ -363,11 +401,12 @@ static char *cpu_topology_to_string(const CpuTopology *topo) " .cpus = %u,\n" " .sockets = %u,\n" " .dies = %u,\n" + " .clusters = %u,\n" " .cores = %u,\n" " .threads = %u,\n" " .max_cpus = %u,\n" "}", - topo->cpus, topo->sockets, topo->dies, + topo->cpus, topo->sockets, topo->dies, topo->clusters, topo->cores, topo->threads, topo->max_cpus); } @@ -391,6 +430,7 @@ static void check_parse(MachineState *ms, const SMPConfiguration *config, (ms->smp.cpus == expect_topo->cpus) && (ms->smp.sockets == expect_topo->sockets) && (ms->smp.dies == expect_topo->dies) && + (ms->smp.clusters == expect_topo->clusters) && (ms->smp.cores == expect_topo->cores) && (ms->smp.threads == expect_topo->threads) && (ms->smp.max_cpus == expect_topo->max_cpus)) { @@ -472,6 +512,11 @@ static void unsupported_params_init(const MachineClass *mc, SMPTestData *data) data->expect_prefer_sockets.dies = 1; data->expect_prefer_cores.dies = 1; } + + if (!mc->smp_props.clusters_supported) { + data->expect_prefer_sockets.clusters = 1; + data->expect_prefer_cores.clusters = 1; + } } static void machine_base_class_init(ObjectClass *oc, void *data) @@ -491,6 +536,7 @@ static void machine_generic_valid_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.dies_supported = false; + mc->smp_props.clusters_supported = false; } static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) @@ -502,6 +548,7 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) mc->max_cpus = 511; mc->smp_props.dies_supported = false; + mc->smp_props.clusters_supported = false; } static void machine_with_dies_class_init(ObjectClass *oc, void *data) @@ -512,6 +559,18 @@ static void machine_with_dies_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.dies_supported = true; + mc->smp_props.clusters_supported = false; +} + +static void machine_with_clusters_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->min_cpus = MIN_CPUS; + mc->max_cpus = MAX_CPUS; + + mc->smp_props.clusters_supported = true; + mc->smp_props.dies_supported = false; } static void test_generic_valid(const void *opaque) @@ -607,6 +666,56 @@ static void test_with_dies(const void *opaque) object_unref(obj); } +static void test_with_clusters(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_clusters = 2; + int i; + + for (i = 0; i < ARRAY_SIZE(data_generic_valid); i++) { + data = data_generic_valid[i]; + unsupported_params_init(mc, &data); + + /* when clusters parameter is omitted, it will be set as 1 */ + data.expect_prefer_sockets.clusters = 1; + data.expect_prefer_cores.clusters = 1; + + smp_parse_test(ms, &data, true); + + /* when clusters parameter is specified */ + data.config.has_clusters = true; + data.config.clusters = num_clusters; + if (data.config.has_cpus) { + data.config.cpus *= num_clusters; + } + if (data.config.has_maxcpus) { + data.config.maxcpus *= num_clusters; + } + + data.expect_prefer_sockets.clusters = num_clusters; + data.expect_prefer_sockets.cpus *= num_clusters; + data.expect_prefer_sockets.max_cpus *= num_clusters; + data.expect_prefer_cores.clusters = num_clusters; + data.expect_prefer_cores.cpus *= num_clusters; + data.expect_prefer_cores.max_cpus *= num_clusters; + + smp_parse_test(ms, &data, true); + } + + for (i = 0; i < ARRAY_SIZE(data_with_clusters_invalid); i++) { + data = data_with_clusters_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[] = { { @@ -628,6 +737,10 @@ static const TypeInfo smp_machine_types[] = { .name = MACHINE_TYPE_NAME("smp-with-dies"), .parent = TYPE_MACHINE, .class_init = machine_with_dies_class_init, + }, { + .name = MACHINE_TYPE_NAME("smp-with-clusters"), + .parent = TYPE_MACHINE, + .class_init = machine_with_clusters_class_init, } }; @@ -648,6 +761,9 @@ int main(int argc, char *argv[]) g_test_add_data_func("/test-smp-parse/with_dies", MACHINE_TYPE_NAME("smp-with-dies"), test_with_dies); + g_test_add_data_func("/test-smp-parse/with_clusters", + MACHINE_TYPE_NAME("smp-with-clusters"), + test_with_clusters); g_test_run(); From patchwork Fri Dec 31 12:47:50 2021 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: 12701958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B59C5C433F5 for ; Fri, 31 Dec 2021 13:27:29 +0000 (UTC) Received: from localhost ([::1]:39926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HwO-0001kW-HQ for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:27:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLJ-0006ln-QO for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:52795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLI-0000o8-6U for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AG4y2rzxLZGbpvB29+PEEBcSZMHPBx+rIwBTw7mt+eU=; b=bbsCgI0S/TnwcZraEvjSz3RlGMNtlJVplTDe8FYAIt+ZyztLC2pceyIvqvRDnXHjGBojfT 8e5FT+mx9OlBrx6b9itR8RMK4prB5VxQMIM/sKso3e/dmIN4lRPkNJe/ZXsI3pQZxcrWFD 4o7PHVjPZuKjUiOqFpgqt8oMpqAgljo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-77-y5OGB7qSODaaGfNBGD3Zbg-1; Fri, 31 Dec 2021 07:49:06 -0500 X-MC-Unique: y5OGB7qSODaaGfNBGD3Zbg-1 Received: by mail-wr1-f71.google.com with SMTP id s23-20020adf9797000000b001a24674f0f7so7533537wrb.9 for ; Fri, 31 Dec 2021 04:49:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AG4y2rzxLZGbpvB29+PEEBcSZMHPBx+rIwBTw7mt+eU=; b=hkZ+nrkLshbJifgbuO3zVvfHkyhjWOxSNRcU9pail4kV6AXN26wQJuOH8XN3GQyiW4 sXqRjRrsc7dO6RXUTZBicFF7vGzvpai4JxEIhdNaCU1/qAPENRm3xUOG6WdGGuDU+hm1 6jarWvlgJntfwP8j2UG5oasyAhI/nwiYKtj3CeomSpHNEP8G1owPZgH9Ej1ZFjQ3r7K/ ITwFzCpJjke9EGMMiKJ4w9b+SN/PWgUhvyEH0vMOq/MRimeblLa+tow1LTA+lOYjr5Lt c2U0z7HDDWcIHIuoV8g5MTZfODZcTsC1I1yJIKrl+/0j4ip2LGHaI177BqavuwnJve+K Apbg== X-Gm-Message-State: AOAM531rQazhezMpjsXHg8FQZ67mTu5N/1TVEbSTEkMxCNTKgG6x3Ut+ JHU1/WJofQwkX4ev+VLEhqOjMBtI+5dYT4BhQyV/E7d1Pog6PoEfJ3uofM8W/3Cc2T4LHo6N85r IVb2RMTGeVeRLqlk8LqvPyXnDLGN/la26UorBwxpCVkoAWAXarSE2YSM0F7M35oB3 X-Received: by 2002:a05:600c:2059:: with SMTP id p25mr29424793wmg.151.1640954945227; Fri, 31 Dec 2021 04:49:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJx05hAnb72YWkxkRepho8vs7YnTo9QVVn0H4PymlCOSsxHLImvD4DGOKDMx1FXhptHL1jOISw== X-Received: by 2002:a05:600c:2059:: with SMTP id p25mr29424781wmg.151.1640954945059; Fri, 31 Dec 2021 04:49:05 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id n12sm19710271wmq.30.2021.12.31.04.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/20] tests/unit/test-smp-parse: No need to explicitly zero MachineClass members Date: Fri, 31 Dec 2021 13:47:50 +0100 Message-Id: <20211231124754.1005747-17-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang The default value of the MachineClass members is 0, which means we don't have to explicitly zero them. Also the value of "mc->smp_props.prefer_sockets" will be taken care of by smp_parse_test(), we don't necessarily need the statement in machine_base_class_init() either. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-6-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 331719bbc4b..72d83d1bbc9 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -523,8 +523,6 @@ static void machine_base_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->smp_props.prefer_sockets = true; - mc->name = g_strdup(SMP_MACHINE_NAME); } @@ -534,9 +532,6 @@ static void machine_generic_valid_class_init(ObjectClass *oc, void *data) mc->min_cpus = MIN_CPUS; mc->max_cpus = MAX_CPUS; - - mc->smp_props.dies_supported = false; - mc->smp_props.clusters_supported = false; } static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) @@ -546,9 +541,6 @@ static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) /* Force invalid min CPUs and max CPUs */ mc->min_cpus = 2; mc->max_cpus = 511; - - mc->smp_props.dies_supported = false; - mc->smp_props.clusters_supported = false; } static void machine_with_dies_class_init(ObjectClass *oc, void *data) @@ -559,7 +551,6 @@ static void machine_with_dies_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.dies_supported = true; - mc->smp_props.clusters_supported = false; } static void machine_with_clusters_class_init(ObjectClass *oc, void *data) @@ -570,7 +561,6 @@ static void machine_with_clusters_class_init(ObjectClass *oc, void *data) mc->max_cpus = MAX_CPUS; mc->smp_props.clusters_supported = true; - mc->smp_props.dies_supported = false; } static void test_generic_valid(const void *opaque) From patchwork Fri Dec 31 12:47:51 2021 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: 12701947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E7090C4332F for ; Fri, 31 Dec 2021 12:57:49 +0000 (UTC) Received: from localhost ([::1]:35416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HTg-0003Pu-W1 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:57:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLO-0006pq-C9 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:57287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLM-0000oi-Bl for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bClaEEXntH4eCLk8QgonvKJOvx/K9+KjgTtycd8N1c0=; b=QpKQ2b2tbbe7hmy9LYcNgoR8krME+IbtMQHFSIFciafg38NVCilW7o9ToCu6h9jhQlOSoP Zh5DcMWGM0nF+RZ28I+mZZi+oxJXmrJdwqffb2oqp0qTZ8PkkKWuR5EEJtyN8qe+SOF3bj HpqGskI3zHl7yEkp7gwYCUaitH9hVPA= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-KQxj2WK8P3Cnx-zSLd858A-1; Fri, 31 Dec 2021 07:49:11 -0500 X-MC-Unique: KQxj2WK8P3Cnx-zSLd858A-1 Received: by mail-wr1-f72.google.com with SMTP id k4-20020adfc704000000b001a32d86a772so4036773wrg.5 for ; Fri, 31 Dec 2021 04:49:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bClaEEXntH4eCLk8QgonvKJOvx/K9+KjgTtycd8N1c0=; b=SIJ1x5A/0aUwUKm5tIpc740szJ9USDX0GTQk8zv+pSRxOgC9bEGiVUk6eSD4hNMCQO PIZQHXPtYbi1J5ScSfCi8y7503PUbWAtraCZGD61j4G0jkYQDxa1jXwkzMJQJIqbFLt/ G8cIvvTkTjKlpzq6SSy5qGlzqqe193nPNWoe4V3mRJtsfe42cf/H2xJJ7nHIB3wUDKW7 QmQwHwcXflX6pgFAjmc6Ar5gTOjJxSXfqThe8njZrIeh9dhhgGEG6x1iN7NVS/QE0A4d zG/eaFhIXv/QB2v2bH/2zGmE+5NPf7rpP0vouLMxpFs98PsdV39RUGo6LM4IVpi+EAbs +6Wg== X-Gm-Message-State: AOAM533GfGR86Q/ruDQmNgzu2jX5Ooi0xdD4ts/nB5hCitf0e8kEPvXp k9RCacAFWM4UsWGUr8VcnTcgZXGBzuzSR6kUrA3BDrcCpT03ExXWE/Ik8ks8Ilnerz4U6kHGqX+ ZKvcQyu8l97DdQaei4SUE6ZPu/ZsTPPR1P4TGbwhOtPIWJjsYEU25otGl0dTa/wJC X-Received: by 2002:a7b:cc90:: with SMTP id p16mr29756341wma.98.1640954949602; Fri, 31 Dec 2021 04:49:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWuCwwlXTyrcrYJKmEn7ys2XzdLsNHWQa3xdMufv+f+nHpUFYJbRjDgnt/SKcBQprZWli78Q== X-Received: by 2002:a7b:cc90:: with SMTP id p16mr29756326wma.98.1640954949315; Fri, 31 Dec 2021 04:49:09 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id b14sm24166561wri.112.2021.12.31.04.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/20] tests/unit/test-smp-parse: Keep default MIN/MAX CPUs in machine_base_class_init Date: Fri, 31 Dec 2021 13:47:51 +0100 Message-Id: <20211231124754.1005747-18-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang Most machine types in test-smp-parse will be OK to have the default MIN/MAX CPUs except "smp-generic-invalid", let's keep the default values in machine_base_class_init which will be inherited. And if we hope a different value for a specific machine, modify it in its own initialization function. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-7-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- tests/unit/test-smp-parse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/unit/test-smp-parse.c b/tests/unit/test-smp-parse.c index 72d83d1bbc9..fdc39a846ca 100644 --- a/tests/unit/test-smp-parse.c +++ b/tests/unit/test-smp-parse.c @@ -523,15 +523,10 @@ static void machine_base_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->name = g_strdup(SMP_MACHINE_NAME); -} - -static void machine_generic_valid_class_init(ObjectClass *oc, void *data) -{ - MachineClass *mc = MACHINE_CLASS(oc); - mc->min_cpus = MIN_CPUS; mc->max_cpus = MAX_CPUS; + + mc->name = g_strdup(SMP_MACHINE_NAME); } static void machine_generic_invalid_class_init(ObjectClass *oc, void *data) @@ -547,9 +542,6 @@ static void machine_with_dies_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->min_cpus = MIN_CPUS; - mc->max_cpus = MAX_CPUS; - mc->smp_props.dies_supported = true; } @@ -557,9 +549,6 @@ static void machine_with_clusters_class_init(ObjectClass *oc, void *data) { MachineClass *mc = MACHINE_CLASS(oc); - mc->min_cpus = MIN_CPUS; - mc->max_cpus = MAX_CPUS; - mc->smp_props.clusters_supported = true; } @@ -718,7 +707,6 @@ static const TypeInfo smp_machine_types[] = { }, { .name = MACHINE_TYPE_NAME("smp-generic-valid"), .parent = TYPE_MACHINE, - .class_init = machine_generic_valid_class_init, }, { .name = MACHINE_TYPE_NAME("smp-generic-invalid"), .parent = TYPE_MACHINE, From patchwork Fri Dec 31 12:47:52 2021 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: 12701950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7AAFC433F5 for ; Fri, 31 Dec 2021 13:03:30 +0000 (UTC) Received: from localhost ([::1]:43730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HZB-000101-L5 for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:03:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLX-0006yj-OH for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLV-0000qa-U7 for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5twDjfVw/oTpCn6cBBCJzXNnnYheekXKgSPRSk/tbyo=; b=aTj+8vIyzbOF1LJL4oX7MK35//UXEqHtjV6FvsO6YvLMP30KiSmsX2GWlJ4jh0CWqDlQws sE+exd/TFOQKQM/WlZoqBRu/jzvjxxmpi+HYf9UIEGG5K7G0dOx7s0orHbCAqZWxjiRz93 +MlxhCmSd5Bqnm3ZVGlaXWvgptRPZz0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-654-ZNJf99JTNpGQNdOH_XQjeA-1; Fri, 31 Dec 2021 07:49:15 -0500 X-MC-Unique: ZNJf99JTNpGQNdOH_XQjeA-1 Received: by mail-wr1-f72.google.com with SMTP id v6-20020adfa1c6000000b001a26d0c3e32so7475454wrv.14 for ; Fri, 31 Dec 2021 04:49:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5twDjfVw/oTpCn6cBBCJzXNnnYheekXKgSPRSk/tbyo=; b=VqlhR7QFW2I0+9NArnTcp22/+cnObCmPcLtT8wDPU+GrTWlOvUs1pq4vTuN34DptGJ sJeqdT+SSqg5aDUcz7oiybXH4JXOJqUT48vq8AaynSfk+PvVSL1JkovO6h8bDb6I4W6h UBV4mUtUXtqew1K3mGNow1+bsckA4uFxZEZqn3QOI3K5eiNDVHfonJQeSnWcCnkRimdM 5ho/BKc1hviTm4OCjoTuSdrZLLUdIaN6knSVhppnGcmpHGcTQ3fUO8XJbgVrFO4Q50Wq /58m5MmDUsauqQdDzLVy4d9JZv3EMn4ZPgCwBbzCwexhMCbsXHNq78VUodzxNaFvnbC/ o3TA== X-Gm-Message-State: AOAM530UKM7Yr35GLZ00EedG+oA7Xt6TR+hfvDO+b6WeSctBblQ23gvv xjdqUIeHahnlmgw7ZGfFeQLCZVbhhvCZy4C6QukXWON7ykaXQuXzzs9CF5YBSPWdazYar9Z7zsD 32hX6R2ZDKrxc8te72WWNEupC7PPzgYPSLEjWy6HGBirzXq7dJF/8Gamh089MzwH7 X-Received: by 2002:adf:f741:: with SMTP id z1mr29545973wrp.54.1640954953875; Fri, 31 Dec 2021 04:49:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDBCnBviOpIeEQUNaD3s4Pg6XjeK+jAvXOg8/JmI2P1j78IsAJsY56lM/US3xdURAST+byUQ== X-Received: by 2002:adf:f741:: with SMTP id z1mr29545957wrp.54.1640954953646; Fri, 31 Dec 2021 04:49:13 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id 1sm19669463wrb.13.2021.12.31.04.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/20] MAINTAINERS: Self-recommended as reviewer of "Machine core" Date: Fri, 31 Dec 2021 13:47:52 +0100 Message-Id: <20211231124754.1005747-19-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Yanan Wang I've built interests in the generic machine subsystem and have also been working on projects related to this part, self-recommand myself as a reviewer so that I can help to review some patches familiar to me, and have a chance to learn more continuously. Signed-off-by: Yanan Wang Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211228092221.21068-8-wangyanan55@huawei.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 54565368054..fe5eea76f67 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1631,6 +1631,7 @@ Machine core M: Eduardo Habkost M: Marcel Apfelbaum R: Philippe Mathieu-Daudé +R: Yanan Wang S: Supported F: cpu.c F: hw/core/cpu.c From patchwork Fri Dec 31 12:47:53 2021 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: 12701946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4637C433FE for ; Fri, 31 Dec 2021 12:57:49 +0000 (UTC) Received: from localhost ([::1]:35410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HTg-0003Pe-PH for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 07:57:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLZ-000703-ES for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28064) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLX-0000qf-Gw for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=93VPh+l1pFg92Ehm7FnMqhc0uWxRDWcIdf0CzMkvjbk=; b=D0nCwUwD9PoQzUzF8DcC9V7RgW2Bzjllf04rRcVesoeS6CpvwftDDbuC5j4YkKz4v3kpb5 QJXsh+Tl5BnlVKYAt4TQpGYiZBP7l5DSe5M2Gfd+8eNIAtc08anHVw0Fivs5vaW9oz9qOh n1NGeyreO2mtUevxjtj8xttUlMkyOVw= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-421-P3b7HEe3MO-UVXKaiCq-wg-1; Fri, 31 Dec 2021 07:49:20 -0500 X-MC-Unique: P3b7HEe3MO-UVXKaiCq-wg-1 Received: by mail-wr1-f71.google.com with SMTP id o20-20020adfa114000000b001a2abc089d8so7479474wro.4 for ; Fri, 31 Dec 2021 04:49:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=93VPh+l1pFg92Ehm7FnMqhc0uWxRDWcIdf0CzMkvjbk=; b=40REgsEl3lDLjnaZaBa5ugIdQkUich7SvvH3Tc9W0xyJbAGiCwl4v1+3gNninVxkHR WaZBEFNwoxLT54VaB9fpOq2glI/VU7fTJAfAEuVwv3QBRc33k2FN59GgQjKRSXf4CqAw xoEhtbXGAaz4dKtG7S1OyzRzKwRcJphB+ZJbgpcSDwskjvm5hvRbXer2+c0HnBoKys5u jbl9VMu6gWQy3vo/v3NRfifPgGs9eIaQ9iql30xj18zbkMGkqQmfQ64KS0G0A1/KEgvK HgROQcdvFkJYQQ8KzEO4j8ADJqp066qvmX2o/c6vgkVwt7viXeX16WIfaPrO+msHQfag 0gLw== X-Gm-Message-State: AOAM530tax3W/b89KbogYocCJC1ySPzYCivLerHe4lUY595xiHb9b8O1 c8DsAUvWJOnvX+4ZuHbaGa6vtN4WXbvHZEkk9qE6I4ftb5G9n5BWEZ+Pm38fXz2fDOagBoYDUvf VuZDlOG6GVu1H0FfiNiO3FB4LLBnWABzWUTAkjwltWGzVWgngvnt3faZUo6aWJHv1 X-Received: by 2002:a5d:56c2:: with SMTP id m2mr29302479wrw.313.1640954958312; Fri, 31 Dec 2021 04:49:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJy7CYZVL3mgRAeJ2vF4LSDCeG8wD0+tbRSix0I/GbFEekILPoeksc7hgOZi3yej2AcoCxK6rg== X-Received: by 2002:a5d:56c2:: with SMTP id m2mr29302458wrw.313.1640954958019; Fri, 31 Dec 2021 04:49:18 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id l26sm26399403wrz.44.2021.12.31.04.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 19/20] MAINTAINERS: Change philmd's email address Date: Fri, 31 Dec 2021 13:47:53 +0100 Message-Id: <20211231124754.1005747-20-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The philmd@redhat.com email address will stop working on 2022-01-01, change it to my personal email address. Update .mailmap in case anyone wants to send me an email because of some past commit I authored. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20211231000759.707519-1-philmd@redhat.com> --- .gitlab-ci.d/edk2/Dockerfile | 2 +- .mailmap | 1 + MAINTAINERS | 18 +++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.d/edk2/Dockerfile b/.gitlab-ci.d/edk2/Dockerfile index b4584d1cf64..13029310f6d 100644 --- a/.gitlab-ci.d/edk2/Dockerfile +++ b/.gitlab-ci.d/edk2/Dockerfile @@ -3,7 +3,7 @@ # FROM ubuntu:16.04 -MAINTAINER Philippe Mathieu-Daudé +MAINTAINER Philippe Mathieu-Daudé # Install packages required to build EDK2 RUN apt update \ diff --git a/.mailmap b/.mailmap index c45d1c53014..5113f55b3a0 100644 --- a/.mailmap +++ b/.mailmap @@ -63,6 +63,7 @@ Paul Burton Paul Burton Paul Burton Paul Burton +Philippe Mathieu-Daudé Stefan Brankovic Yongbok Kim diff --git a/MAINTAINERS b/MAINTAINERS index fe5eea76f67..ae6c74f3ff5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1630,7 +1630,7 @@ F: pc-bios/bios-microvm.bin Machine core M: Eduardo Habkost M: Marcel Apfelbaum -R: Philippe Mathieu-Daudé +R: Philippe Mathieu-Daudé R: Yanan Wang S: Supported F: cpu.c @@ -1811,7 +1811,7 @@ F: docs/virtio-net-failover.rst T: git https://github.com/jasowang/qemu.git net Parallel NOR Flash devices -M: Philippe Mathieu-Daudé +M: Philippe Mathieu-Daudé T: git https://gitlab.com/philmd/qemu.git pflash-next S: Maintained F: hw/block/pflash_cfi*.c @@ -2227,7 +2227,7 @@ F: hw/isa/piix4.c F: include/hw/southbridge/piix.h Firmware configuration (fw_cfg) -M: Philippe Mathieu-Daudé +M: Philippe Mathieu-Daudé R: Gerd Hoffmann S: Supported F: docs/specs/fw_cfg.txt @@ -2525,7 +2525,7 @@ F: scripts/coccinelle/errp-guard.cocci GDB stub M: Alex Bennée -R: Philippe Mathieu-Daudé +R: Philippe Mathieu-Daudé S: Maintained F: gdbstub* F: include/exec/gdbstub.h @@ -2536,7 +2536,7 @@ Memory API M: Paolo Bonzini M: Peter Xu M: David Hildenbrand -R: Philippe Mathieu-Daudé +R: Philippe Mathieu-Daudé S: Supported F: include/exec/ioport.h F: include/exec/memop.h @@ -3030,14 +3030,14 @@ F: include/hw/i2c/smbus_slave.h F: include/hw/i2c/smbus_eeprom.h Firmware schema specifications -M: Philippe Mathieu-Daudé +M: Philippe Mathieu-Daudé R: Daniel P. Berrange R: Kashyap Chamarthy S: Maintained F: docs/interop/firmware.json EDK2 Firmware -M: Philippe Mathieu-Daudé +M: Philippe Mathieu-Daudé R: Gerd Hoffmann S: Supported F: hw/i386/*ovmf* @@ -3275,7 +3275,7 @@ F: block/null.c NVMe Block Driver M: Stefan Hajnoczi R: Fam Zheng -R: Philippe Mathieu-Daudé +R: Philippe Mathieu-Daudé L: qemu-block@nongnu.org S: Supported F: block/nvme* @@ -3518,7 +3518,7 @@ F: tests/tcg/Makefile.include Integration Testing with the Avocado framework W: https://trello.com/b/6Qi1pxVn/avocado-qemu R: Cleber Rosa -R: Philippe Mathieu-Daudé +R: Philippe Mathieu-Daudé R: Wainer dos Santos Moschetta R: Beraldo Leal S: Odd Fixes From patchwork Fri Dec 31 12:47:54 2021 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: 12701955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A322C433EF for ; Fri, 31 Dec 2021 13:19:00 +0000 (UTC) Received: from localhost ([::1]:59080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3HoB-0003gG-PY for qemu-devel@archiver.kernel.org; Fri, 31 Dec 2021 08:18:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLb-00071n-MR for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3HLZ-0000r4-It for qemu-devel@nongnu.org; Fri, 31 Dec 2021 07:49:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640954965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=X3dwL7UtUUj/bBavCjeaTxvYP5y2clkbdynk8B+7VuI=; b=XVSJYGF/CUWr6Wvm/ulEJ2XeG4ocoNmA+uTUdIQ2LmClPYrKY26zPz8CPqZbL3gg5e6z5/ BORzvllgpxkIaFXwELZstZGokhOt+ieNNtIJcJoncbbY4KyNTuYdmYf9KBNig5KYX6ZPqc ABcpAe5O0QTJHNYvFp650+sH8y0Nz0Q= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-507-qkgqxQ4WO42zxbehnIxhdg-1; Fri, 31 Dec 2021 07:49:23 -0500 X-MC-Unique: qkgqxQ4WO42zxbehnIxhdg-1 Received: by mail-wm1-f69.google.com with SMTP id f202-20020a1c1fd3000000b00344f1cae317so4576038wmf.0 for ; Fri, 31 Dec 2021 04:49:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X3dwL7UtUUj/bBavCjeaTxvYP5y2clkbdynk8B+7VuI=; b=NpD/84vONaFstHh2PeFlQNuFYH04xyRaFNuBGIwp0cISGXMzzKRA62ca8+6DBfTXzx W3WC2zjdXJpcNJUQ0DYDclddjb/db06WvQJeuBjGkoL+8qPZfOnDuGnIdB88jz5nIJsf Q7uBgveRf+6vlxMo/8yO73IfRMriKUZJmuL/xe9xuahPxLRNv15WFpyryayj2PFCJG3V EOJvZ5BnYGZTOI6RDFBj5oMVg4ekilyJUmP3csj1C8dCdk7ebGJg0q39S37m0o5asKO8 SVMoa5u8jWdqL+zB6Q+2I2iR+4Sy1c0f1nb2VmFX6dck9lQ8nF82bUvajlXtIeUSrQG7 hCnw== X-Gm-Message-State: AOAM530wGYOfxR0Qj7jr4KZSaYerWx2CR0sUQ3VBpG3a0r7YdYogFbi7 e6gHbjnepr3DtCfgu34q5+L9dJa6mN2SJIlSu5iJUJuwDummDsG6DrYYd1UWty1SxQnYtludGPN cvjm5jHTWtgZyzQA8TcHeBRVe1JapSSRTQbQI3hBY3sjr2hEoI9yugXq/6YjRvNe/ X-Received: by 2002:adf:fbc1:: with SMTP id d1mr29563988wrs.648.1640954962616; Fri, 31 Dec 2021 04:49:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJweyDImbM9rqmy0pSxNjJC0aepMxZCZ6hSBZkraB7FthuRAMPLQU6/PWHYLBHNy2QLBqWnirg== X-Received: by 2002:adf:fbc1:: with SMTP id d1mr29563971wrs.648.1640954962368; Fri, 31 Dec 2021 04:49:22 -0800 (PST) Received: from x1w.redhat.com (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id b2sm29767671wrd.35.2021.12.31.04.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Dec 2021 04:49:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 20/20] MAINTAINERS: email address change Date: Fri, 31 Dec 2021 13:47:54 +0100 Message-Id: <20211231124754.1005747-21-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211231124754.1005747-1-philmd@redhat.com> References: <20211231124754.1005747-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) DKIMWL_WL_HIGH=-0.573, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: , Cc: Yanan Wang , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Li Zhijian , Zhang Chen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Li Zhijian Fujitsu's mail service has migrated to O365 months ago, the lizhijian@cn.fujitsu.com address will stop working on 2022-06-01, change it to my new email address lizhijian@fujitsu.com. Signed-off-by: Li Zhijian Acked-by: Zhang Chen Message-Id: <20211231050901.360-1-lizhijian@cn.fujitsu.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index ae6c74f3ff5..f871d759fdf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2982,7 +2982,7 @@ F: docs/COLO-FT.txt COLO Proxy M: Zhang Chen -M: Li Zhijian +M: Li Zhijian S: Supported F: docs/colo-proxy.txt F: net/colo*