From patchwork Thu Aug 3 22:20:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i3/JK53S; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Hg67Dsz1ybS for ; Fri, 4 Aug 2023 08:22:23 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRggi-0004Ev-0u; Thu, 03 Aug 2023 18:20:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggf-0004Dp-V8 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:20:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggd-0000O9-Oi for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:20:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101251; 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: in-reply-to:in-reply-to:references:references; bh=5BZ5eZ81+5jW0TNORG8mc8ZgUr+TZWKsdfQFMi6wlRY=; b=i3/JK53SUXv9tlhYgv2sMAhB+V2u3IngVKuW0uAi9UMjSlCTbkK+fUeaihaMGmcTwxWYVU h3PCRCTPlKG+llxOCbtS/BL2VAmL7mMfkGXpJ2KDRh5gZBDbPWVgGLQISpPi58ZPsL6FC7 BB7uUe8wmipPF1DWtX8jyYFYojA8Tus= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-364-I1Csau2WMKqwPoR7JMP4bQ-1; Thu, 03 Aug 2023 18:20:49 -0400 X-MC-Unique: I1Csau2WMKqwPoR7JMP4bQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b9ba3d6191so13708221fa.2 for ; Thu, 03 Aug 2023 15:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101248; x=1691706048; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5BZ5eZ81+5jW0TNORG8mc8ZgUr+TZWKsdfQFMi6wlRY=; b=I8An6Gyo1P/RyidgQXkdWCU4tIlL1TcKZXWqrudI3o3QbeD9D49OZ8QcuR7zCQVC3H p9+vXvmFOaA8Go7D0FFHzxEZbvXH0uAlaK0BYW+xKuagux8P76a6rPB/lKwy0WhGRSnE YXaF4djxk//VMXAm8b5Cymri78/YO8ESkxPgwRYwksZsBfMg0pzBEPUFMCNgLk5nr5OZ /E2DT2zwkFrCsIhU3dY8NtPFiwZuWM8hXhyxTVCEVZxDkL/2oj4ur1iie2gUEE/UnDzW jeOxd23nzzWzRP+PwJmBrmlj8H7AGnhpq3YvIMySNF3hxt0KxihCP17rniQXxLGwW6E9 8gaA== X-Gm-Message-State: AOJu0YwOZhdJmoGDQErQtr5aJ95FdbXmmFU2X+rmFb5+Fxl76ki/kdjv NlJ/M0zXDSgaODyb2/RUO5ntAOai/Ixvrcb2Un7ubEm2zNaVd5yVvVDJTylm9LJWEV+bSsOX944 sHzo1NlLBA47TSYZy61Bmq/1gtzP/A3db1gI1OwKk2BwowNsgg0sTl6EFFOlBU4cmV053 X-Received: by 2002:a2e:984f:0:b0:2b9:ac48:d7f5 with SMTP id e15-20020a2e984f000000b002b9ac48d7f5mr79596ljj.39.1691101248026; Thu, 03 Aug 2023 15:20:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHk99xMKZrgQzE3mczdZ/06KdsBKfhhBnfKkt5f39GNqnogOZNDZJOeaRVqOcaAcw5hBS0gWQ== X-Received: by 2002:a2e:984f:0:b0:2b9:ac48:d7f5 with SMTP id e15-20020a2e984f000000b002b9ac48d7f5mr79578ljj.39.1691101247521; Thu, 03 Aug 2023 15:20:47 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id s15-20020a170906284f00b00992e265495csm367642ejc.212.2023.08.03.15.20.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:20:46 -0700 (PDT) Date: Thu, 3 Aug 2023 18:20:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Auger , Mauro Matteo Cascella , qemu-stable@nongnu.org Subject: [PULL 01/22] hw/virtio-iommu: Fix potential OOB access in virtio_iommu_handle_command() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eric Auger In the virtio_iommu_handle_command() when a PROBE request is handled, output_size takes a value greater than the tail size and on a subsequent iteration we can get a stack out-of-band access. Initialize the output_size on each iteration. The issue was found with ASAN. Credits to: Yiming Tao(Zhejiang University) Gaoning Pan(Zhejiang University) Fixes: 1733eebb9e7 ("virtio-iommu: Implement RESV_MEM probe request") Signed-off-by: Eric Auger Reported-by: Mauro Matteo Cascella Cc: qemu-stable@nongnu.org Message-Id: <20230717162126.11693-1-eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 201127c488..4dcf1d5c62 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -728,13 +728,15 @@ static void virtio_iommu_handle_command(VirtIODevice *vdev, VirtQueue *vq) VirtIOIOMMU *s = VIRTIO_IOMMU(vdev); struct virtio_iommu_req_head head; struct virtio_iommu_req_tail tail = {}; - size_t output_size = sizeof(tail), sz; VirtQueueElement *elem; unsigned int iov_cnt; struct iovec *iov; void *buf = NULL; + size_t sz; for (;;) { + size_t output_size = sizeof(tail); + elem = virtqueue_pop(vq, sizeof(VirtQueueElement)); if (!elem) { return; From patchwork Thu Aug 3 22:20:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=etWVgu4F; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HB0hHSz1ybS for ; Fri, 4 Aug 2023 08:21:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRggm-0004Hd-GZ; Thu, 03 Aug 2023 18:21:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggk-0004GH-IJ for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:20:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggj-0000Ox-27 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:20:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101256; 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=4GzWS5FnIrPDtn2Htg+CctKW805+xbLzE7TTNfE7rtM=; b=etWVgu4FvwNQohfgR/SjIToCMx74In6g7spmo14TGye5XOolOz81cRBUBrYH8gyybvDMmM /JoXAJ6ldM8kdFwmY5utgFFl5Z1PahNgPItP6osiO7uQUInwkpoRHjpWI2xVtbd3s5+Hu1 S9m1/99laHQhucN44uHwLOzIOoWEAdU= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-648-hHztSPF9MAqT-PLREt3HQA-1; Thu, 03 Aug 2023 18:20:53 -0400 X-MC-Unique: hHztSPF9MAqT-PLREt3HQA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-99c01c680beso86834766b.2 for ; Thu, 03 Aug 2023 15:20:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101252; x=1691706052; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4GzWS5FnIrPDtn2Htg+CctKW805+xbLzE7TTNfE7rtM=; b=Sb1pbeNeim8UxQbe6ccl7/DjQw4SfPImDOO2+bzBSkskBO2+MSrtk3TKZKX0no8Gvr dKTJUrxt96xI+WZ8MAT25NGS7Aul+Ad74YFM6bpd9DVqdNL2vYfYAObZVD0KK/NdkjlQ peSB22+TDMQAmgRqrDErhGE9ByWK6wpzRLwvWmRDjp+xefrdM1njc16dRMtNtR8KISvJ eCJY73JKQlvnRGZ3EU4ePf2UjXaWfFK294LXbo+kW514jEckQnGTkTq2mZcFQGs/ypYT ehswl2FtYi6AiiWUN6JZosFVAIZ8DXSmFGEf527i4ej8Q8/lfuiRb+yAAyzrHa43M8sU XyzA== X-Gm-Message-State: ABy/qLYXN01yGJD8v/EBczzBzLh5i5RXoE//LW0VT30XvBYoBQjkzeKd jA+IFMKv+jgC6y6sl4UIhFUVHJ7gSvmGXbftKQJqIAn3h6ctkZvlaBjTz01Omrp8Q/PrMcEOl3d +EBUqzeEIo19vf/Iv3OGiGbLgeocs/fuh7xrt0Ao7KiMhxlF0Cdc6s1iot6TPJ3o95MYF X-Received: by 2002:a17:906:ef8f:b0:99b:6c47:1145 with SMTP id ze15-20020a170906ef8f00b0099b6c471145mr8307713ejb.32.1691101252023; Thu, 03 Aug 2023 15:20:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlGC2RbUh9hRPRFq5l7zep3nZyUxHGMUk6SX+DZSt2/JVgixKXWM7+eJABYxA2CGOuveYyGFkg== X-Received: by 2002:a17:906:ef8f:b0:99b:6c47:1145 with SMTP id ze15-20020a170906ef8f00b0099b6c471145mr8307703ejb.32.1691101251772; Thu, 03 Aug 2023 15:20:51 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id a1-20020a1709063a4100b0099275c59bc9sm379916ejf.33.2023.08.03.15.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:20:51 -0700 (PDT) Date: Thu, 3 Aug 2023 18:20:48 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Philippe =?utf-8?q?Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Jonathan Cameron , Marcel Apfelbaum Subject: [PULL 02/22] hw/pci-bridge/cxl_upstream.c: Use g_new0() in build_cdat_table() Message-ID: <503d86dd66625b4bed9484bca71db1678c730dc9.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Maydell In build_cdat_table() we do: *cdat_table = g_malloc0(sizeof(*cdat_table) * CXL_USP_CDAT_NUM_ENTRIES); This is wrong because: - cdat_table has type CDATSubHeader *** - so *cdat_table has type CDATSubHeader ** - so the array we're allocating here should be items of type CDATSubHeader * - but we pass sizeof(*cdat_table), which is sizeof(CDATSubHeader **), implying that we're allocating an array of CDATSubHeader ** It happens that sizeof(CDATSubHeader **) == sizeof(CDATSubHeader *) so nothing blows up, but this should be sizeof(**cdat_table). Avoid this excessively hard-to-understand code by using g_new0() instead, which will do the type checking for us. While we're here, we can drop the useless check against failure, as g_malloc0() and g_new0() never fail. This fixes Coverity issue CID 1508120. Signed-off-by: Peter Maydell Message-Id: <20230718101327.1111374-1-peter.maydell@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Jonathan Cameron --- hw/pci-bridge/cxl_upstream.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/pci-bridge/cxl_upstream.c b/hw/pci-bridge/cxl_upstream.c index ef47e5d625..9159f48a8c 100644 --- a/hw/pci-bridge/cxl_upstream.c +++ b/hw/pci-bridge/cxl_upstream.c @@ -274,10 +274,7 @@ static int build_cdat_table(CDATSubHeader ***cdat_table, void *priv) }; } - *cdat_table = g_malloc0(sizeof(*cdat_table) * CXL_USP_CDAT_NUM_ENTRIES); - if (!*cdat_table) { - return -ENOMEM; - } + *cdat_table = g_new0(CDATSubHeader *, CXL_USP_CDAT_NUM_ENTRIES); /* Header always at start of structure */ (*cdat_table)[CXL_USP_CDAT_SSLBIS_LAT] = g_steal_pointer(&sslbis_latency); From patchwork Thu Aug 3 22:20:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816700 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fUbJKwkI; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3JN5d7Dz1ybS for ; Fri, 4 Aug 2023 08:23:00 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRggp-0004KI-K2; Thu, 03 Aug 2023 18:21:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggn-0004IM-5f for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggl-0000Pc-H4 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101258; 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: in-reply-to:in-reply-to:references:references; bh=1h7+g+N6hbLN5/8qfmJxQmtr/si4n71Og3ybh5W/K5c=; b=fUbJKwkIcKjOCzsaRPfHAhIvPPfOI/A+U0vhX1DboWY0tbwYepNv3blezLtXBTqh2c/LL+ kZbtGN+qvWxAwiB3pQcbCzIYIgwk7wvFjt5fBgdBMl7bfKHzZlGEuDgGM5/U4zlnLvef9a RWyg9G6CLP2WrsQD6x4fn2rdgN5EKv0= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-PDwwZdAgOrKCTatdTa6UFg-1; Thu, 03 Aug 2023 18:20:57 -0400 X-MC-Unique: PDwwZdAgOrKCTatdTa6UFg-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5230e9ef0e6so814880a12.0 for ; Thu, 03 Aug 2023 15:20:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101256; x=1691706056; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1h7+g+N6hbLN5/8qfmJxQmtr/si4n71Og3ybh5W/K5c=; b=hZhB7w0CZ/SMm5HbVrAKdE0Oyvt0nM9BQynzMvkvdQdOxAG5G6IhKeOi136hah5QWx z+2UEI3kRBVxi+W/frlumQEE+aaBgZmvqycG7ahFKWKzgbxxxNFRPa8O1EkO+6QI6bKz BTeMLeChdNxNjKClU672Ay3R5kcbelzp0IOJ7vgGVce7+dfjI4R+1egKDiCkd4yRnLXm Pt+qisyO1J48RHD9uh3nBrDoRSDRvVL/tPOiUz/0HBnjMM4QOVWsp/4pyODPQtOJbdAi g4wU/mVyI5/K4Y4AcnQRtmi5iOkANFzBnT+P3kUQ6WCEc8V8Qb3IHQ3g499a+fOasaZ3 +ttg== X-Gm-Message-State: AOJu0YzHa+AjtIsXUdl4Ty8L9TJrenn0cogFHUTD3kuy3ZSAxFewMm8L +A3GIi4Vbs9O8WJ4tJnveI0Zsyv/iaWKx42B4csal0Qy36bSbHuNdu3kDlb8j5FToVqXGq9ihsR GgpZXp0as43KRitr1tkq3yrL7/LoNamXIZHhWUuCldM2TP1nbn6auBs7xvgzcbMaMnKdn X-Received: by 2002:aa7:db5a:0:b0:522:3ef1:b1d with SMTP id n26-20020aa7db5a000000b005223ef10b1dmr84303edt.6.1691101256061; Thu, 03 Aug 2023 15:20:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGOnkIAj/f8xCwB3pt2aL5a10Fxkf8ZpmWBLD111I1CEC6z7o1h7USZr3UF8tNOYt1frBB2A== X-Received: by 2002:aa7:db5a:0:b0:522:3ef1:b1d with SMTP id n26-20020aa7db5a000000b005223ef10b1dmr84291edt.6.1691101255808; Thu, 03 Aug 2023 15:20:55 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id d14-20020aa7d5ce000000b00522b7c5d53esm358083eds.54.2023.08.03.15.20.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:20:55 -0700 (PDT) Date: Thu, 3 Aug 2023 18:20:52 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Eric Auger , Jean-Philippe Brucker Subject: [PULL 03/22] virtio-iommu: Standardize granule extraction and formatting Message-ID: <1084feddc6a677cdfdde56936bfb97cf32cc4dee.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eric Auger At several locations we compute the granule from the config page_size_mask using ctz() and then format it in traces using BIT(). As the page_size_mask is 64b we should use ctz64 and BIT_ULL() for formatting. We failed to be consistent. Note the page_size_mask is garanteed to be non null. The spec mandates the device to set at least one bit, so ctz64 cannot return 64. This is garanteed by the fact the device initializes the page_size_mask to qemu_target_page_mask() and then the page_size_mask is further constrained by virtio_iommu_set_page_size_mask() callback which can't result in a new mask being null. So if Coverity complains round those ctz64/BIT_ULL with CID 1517772 this is a false positive Signed-off-by: Eric Auger Fixes: 94df5b2180 ("virtio-iommu: Fix 64kB host page size VFIO device assignment") Message-Id: <20230718182136.40096-1-eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Jean-Philippe Brucker --- hw/virtio/virtio-iommu.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 4dcf1d5c62..be51635895 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -854,17 +854,19 @@ static IOMMUTLBEntry virtio_iommu_translate(IOMMUMemoryRegion *mr, hwaddr addr, VirtIOIOMMUEndpoint *ep; uint32_t sid, flags; bool bypass_allowed; + int granule; bool found; int i; interval.low = addr; interval.high = addr + 1; + granule = ctz64(s->config.page_size_mask); IOMMUTLBEntry entry = { .target_as = &address_space_memory, .iova = addr, .translated_addr = addr, - .addr_mask = (1 << ctz32(s->config.page_size_mask)) - 1, + .addr_mask = BIT_ULL(granule) - 1, .perm = IOMMU_NONE, }; @@ -1117,7 +1119,7 @@ static int virtio_iommu_set_page_size_mask(IOMMUMemoryRegion *mr, if (s->granule_frozen) { int cur_granule = ctz64(cur_mask); - if (!(BIT(cur_granule) & new_mask)) { + if (!(BIT_ULL(cur_granule) & new_mask)) { error_setg(errp, "virtio-iommu %s does not support frozen granule 0x%llx", mr->parent_obj.name, BIT_ULL(cur_granule)); return -1; @@ -1163,7 +1165,7 @@ static void virtio_iommu_freeze_granule(Notifier *notifier, void *data) } s->granule_frozen = true; granule = ctz64(s->config.page_size_mask); - trace_virtio_iommu_freeze_granule(BIT(granule)); + trace_virtio_iommu_freeze_granule(BIT_ULL(granule)); } static void virtio_iommu_device_realize(DeviceState *dev, Error **errp) From patchwork Thu Aug 3 22:20:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Qz2mLB02; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Jr0D6jz1ybS for ; Fri, 4 Aug 2023 08:23:24 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRggr-0004L1-Or; Thu, 03 Aug 2023 18:21:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggr-0004Kr-3j for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggp-0000QC-Iz for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101262; 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: in-reply-to:in-reply-to:references:references; bh=rfS68BxaotrRZ6rq9fMIsPSxLCjq1HfC2TQN4nwt15g=; b=Qz2mLB02OiiyHQT7qplrXSVk8PkDDiblVUNFx2OxnmXXaqwOgObKliT6viQB7ZhExTFgz9 SXft6r+VRuG3JQaeX057/CVzjgWUUPch+dTJ0wzbftuxkvybMqnzhSE6kQ3Mc9kH7PLrmJ 5nBgm0YFnD0Bn4flLsi+s6MjJQza4xs= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-l022SgsJOymDqsLYBePAdA-1; Thu, 03 Aug 2023 18:21:01 -0400 X-MC-Unique: l022SgsJOymDqsLYBePAdA-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-993d5006993so97066066b.3 for ; Thu, 03 Aug 2023 15:21:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101260; x=1691706060; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rfS68BxaotrRZ6rq9fMIsPSxLCjq1HfC2TQN4nwt15g=; b=l1T0T6W3hnyJ/NO++V/UkylyAyQ22bg/ahP9o7JT4TDQCvQfIeTqT5R5/UHKbs9vC0 3Uyzac9RRfwy6osLt0xY3dUMJEVCUn6VEHijnLJHatv/EjWkMEjxOiInlSCqsfTPIEUp 83wzJBzFHd6coDZj8TmJCiKacCN8U2cyQ1kaDi2W3KrfOIj5/WwvE/wNbHQ30WjTTcMG eSVX6MaK06kamtIZ9O6HmPZrMSVPjM5HtXtailuIcJeDMTol+G2CgfKQRqo8+cJkbpim FtHItCo4NgBFBBjIbm9AL33lZzuASEWq7PRB6EuKb14ABWXS2DxLSUaxPZckkgLwbdpg Lr8w== X-Gm-Message-State: ABy/qLYLfMQJSo2jQzLU3jUl5vTbBCeUSaxj9akhJJqcj/nY8ANyEsY6 CRH7EghS7WXqDx0BvKrqu6m29CkNAV+G8hRzp0+AMRmLyfwkHJ1dZQmb3DG9mNhCsTsEFFimFat ofpPH0fEyBTRnyDbVYlknlrExk3iWohbP9xT02eeqwKCT+fJ7y5U+Tt56O6KB3ldhR60g X-Received: by 2002:a17:906:8a70:b0:994:577:f9df with SMTP id hy16-20020a1709068a7000b009940577f9dfmr8483818ejc.4.1691101259944; Thu, 03 Aug 2023 15:20:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlFHKJo8+OY6qZOtbj9t2tTRVK/UhmqS/lHjZS1T2Xd2ffRkczTgIezPwHOD3t1FG1eTjPNXDg== X-Received: by 2002:a17:906:8a70:b0:994:577:f9df with SMTP id hy16-20020a1709068a7000b009940577f9dfmr8483805ejc.4.1691101259606; Thu, 03 Aug 2023 15:20:59 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id v1-20020a17090606c100b0099293cdbc98sm375723ejb.145.2023.08.03.15.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:20:59 -0700 (PDT) Date: Thu, 3 Aug 2023 18:20:56 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Milan Zamazal , Thomas Huth , Fabiano Rosas Subject: [PULL 04/22] hw/virtio: Add a protection against duplicate vu_scmi_stop calls Message-ID: <63a3520e29a1a68d8610315b049ccb5840fe22e9.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Milan Zamazal The QEMU CI fails in virtio-scmi test occasionally. As reported by Thomas Huth, this happens most likely when the system is loaded and it fails with the following error: qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659: msix_unset_vector_notifiers: Assertion `dev->msix_vector_use_notifier && dev->msix_vector_release_notifier' failed. ../../devel/qemu/tests/qtest/libqtest.c:200: kill_qemu() detected QEMU death from signal 6 (Aborted) (core dumped) As discovered by Fabiano Rosas, the cause is a duplicate invocation of msix_unset_vector_notifiers via duplicate vu_scmi_stop calls: msix_unset_vector_notifiers virtio_pci_set_guest_notifiers vu_scmi_stop vu_scmi_disconnect ... qemu_chr_write_buffer msix_unset_vector_notifiers virtio_pci_set_guest_notifiers vu_scmi_stop vu_scmi_set_status ... qemu_cleanup While vu_scmi_stop calls are protected by vhost_dev_is_started() check, it's apparently not enough. vhost-user-blk and vhost-user-gpio use an extra protection, see f5b22d06fb (vhost: recheck dev state in the vhost_migration_log routine) for the motivation. Let's use the same in vhost-user-scmi, which fixes the failure above. Fixes: a5dab090e142 ("hw/virtio: Add boilerplate for vhost-user-scmi device") Signed-off-by: Milan Zamazal Message-Id: <20230720101037.2161450-1-mzamazal@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Thomas Huth Reviewed-by: Fabiano Rosas --- include/hw/virtio/vhost-user-scmi.h | 1 + hw/virtio/vhost-user-scmi.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/virtio/vhost-user-scmi.h b/include/hw/virtio/vhost-user-scmi.h index 6175a74ebd..c90db77dd5 100644 --- a/include/hw/virtio/vhost-user-scmi.h +++ b/include/hw/virtio/vhost-user-scmi.h @@ -25,6 +25,7 @@ struct VHostUserSCMI { VirtQueue *cmd_vq; VirtQueue *event_vq; bool connected; + bool started_vu; }; #endif /* _QEMU_VHOST_USER_SCMI_H */ diff --git a/hw/virtio/vhost-user-scmi.c b/hw/virtio/vhost-user-scmi.c index d386fb2df9..918bb7dcf7 100644 --- a/hw/virtio/vhost-user-scmi.c +++ b/hw/virtio/vhost-user-scmi.c @@ -63,6 +63,7 @@ static int vu_scmi_start(VirtIODevice *vdev) error_report("Error starting vhost-user-scmi: %d", ret); goto err_guest_notifiers; } + scmi->started_vu = true; /* * guest_notifier_mask/pending not used yet, so just unmask @@ -90,6 +91,12 @@ static void vu_scmi_stop(VirtIODevice *vdev) struct vhost_dev *vhost_dev = &scmi->vhost_dev; int ret; + /* vhost_dev_is_started() check in the callers is not fully reliable. */ + if (!scmi->started_vu) { + return; + } + scmi->started_vu = false; + if (!k->set_guest_notifiers) { return; } From patchwork Thu Aug 3 22:20:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Vc+OHjok; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3JP1DcSz1yf5 for ; Fri, 4 Aug 2023 08:23:01 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRggv-0004Ld-FV; Thu, 03 Aug 2023 18:21:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggu-0004LT-Oe for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggt-0000Qh-Af for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101266; 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: in-reply-to:in-reply-to:references:references; bh=/oU8V7VIrt8Ft51zkm09tFOBYRYyclp6SwII5cbUjg0=; b=Vc+OHjoknEycNElPg+L59VjVZARhhAP+Gnixfu50lMQKBko9p/Sc5ehH0PcFCBpmZAm6ob zKij32/RTO+5PL1kHCNp4v5GM37ShZPEvBMLUWv22etYXJIBZ5Duru4FKBHiy269yOqcSl dyc0n2vMMiHf2OHWGZdb1+F8xiiGh4k= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-122-JBjHdKr0M7uNn99xvsXCiw-1; Thu, 03 Aug 2023 18:21:05 -0400 X-MC-Unique: JBjHdKr0M7uNn99xvsXCiw-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b710c5677eso16121051fa.0 for ; Thu, 03 Aug 2023 15:21:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101263; x=1691706063; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/oU8V7VIrt8Ft51zkm09tFOBYRYyclp6SwII5cbUjg0=; b=LlzOd1u/OX9zuMB9ECqlYrVMpA00yYKjIEEmmq2uLOdEh4gZY3pc278pxMrYNC8P5u xk3qY4IQd9luSnMnj5hUPHTKb9tXjdDPZ67kZlBVGQMkwUtMET0tfpU7bOm7uvU4hGKT rPwgGcKhY/6AXjrNr2g+EFbSFPAKjXkXPYmTAqYGBxnUh63Ei/79wpCg7Og5aS9uSE7w 3NIuqwDmX+ISijVQNPzCodq902tlywznidGMzXCTN6FK4pM+hnuFoFKzofImMKDGrRyu 7yuLVLvvj5ggYVTsW4VB4OqgTfL8Lqo6EiSuX97rqD2Uq1crzHEzccl+jwNd6gEaRL2B k+Zg== X-Gm-Message-State: AOJu0Yzq4S6Uouv8JuHODjBWo7MEeu9gBP59yFVzczoSvARo8BEo7CSd 6WZinriH44dc/jH/8eWhac2jE1dIIH300NTs0+40VZ4LWTEEf+gYri6dAG9VE3uxpvjyrG5fcSV uP/xjm4y9cXtifGxPyAG3jERyLaA9sOBEQvsCiQjSR1QHbGjjniLWRbfbRM4tD8c9t1Hx X-Received: by 2002:a2e:9bc5:0:b0:2b9:ce86:b4e7 with SMTP id w5-20020a2e9bc5000000b002b9ce86b4e7mr76817ljj.28.1691101263477; Thu, 03 Aug 2023 15:21:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJ0GMrCGj8Ye2UXnfkf6KRL0JZEMtBiz2y1cEvbkwhe+BHeHhZdFObJ2mgkvyT5PdHFHRmbQ== X-Received: by 2002:a2e:9bc5:0:b0:2b9:ce86:b4e7 with SMTP id w5-20020a2e9bc5000000b002b9ce86b4e7mr76801ljj.28.1691101263075; Thu, 03 Aug 2023 15:21:03 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id t6-20020a1709060c4600b0099bcb44493fsm376088ejf.147.2023.08.03.15.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:02 -0700 (PDT) Date: Thu, 3 Aug 2023 18:20:59 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 05/22] tests: acpi: x86: whitelist expected blobs Message-ID: <45d9d318c8d435cbe2d465f61e6975885d2242ca.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-2-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..1983fa596b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,15 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.hpbridge", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.nohpet", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/pc/DSDT.roothp", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.multi-bridge", From patchwork Thu Aug 3 22:21:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816698 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJd61cPz; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3JH1PtWz1ybS for ; Fri, 4 Aug 2023 08:22:55 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRgh1-0004My-4a; Thu, 03 Aug 2023 18:21:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggz-0004MT-8Z for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRggx-0000RE-NN for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101271; 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: in-reply-to:in-reply-to:references:references; bh=Ww5MsFGR04MY9d6+Y59AcMo+14BIO2RjV7th54MiZcQ=; b=VJd61cPzzCtnnEGpakNPVef0jT16kARrEbXHaMea1ZgRaLLxVBPRNPxVDBCw24SEgceSSz 1tu+ZQ9jy4gXX59BMpgYW212JdBFRlDv4f3m9o/B2/FEOrBZQi74ibEx5jsMiqi3JgoQLT +9H1k34ErDYvrj0MnfsaTwZWhU58LLQ= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-_nnCqSVwOZ-CAkdbpgqr2g-1; Thu, 03 Aug 2023 18:21:09 -0400 X-MC-Unique: _nnCqSVwOZ-CAkdbpgqr2g-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a348facbbso93059366b.1 for ; Thu, 03 Aug 2023 15:21:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101267; x=1691706067; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ww5MsFGR04MY9d6+Y59AcMo+14BIO2RjV7th54MiZcQ=; b=FPv/IAzlGvPzSMNC6YxpUnHUNOWcZIDJwCDWnsizJLJM6H0pCJt4IZvCrK/mWQnmdo PzdClLrUN/j31NuA+BNDZM6fEsjPXjLv/YWNU93WScmD0DlPfWpaEKOt6v0r0L+FAoYz CaVpLBBB2HZIHBKG03L1aj2Ec/cfzsivr7K/OE5sSGjU9vZlrrGsQ89S38JJYN1CVoOw iAkJMGZPOOw8u6G4u9eR+V0iD7CVUh5bLtmz3Us/XHD8D5psZHlmgMhq0S6EJ/FCHsNI CmiiVlr3lqeewcr0ohWVLa+wNdNTzjzzE34L2hbXHPhTMNpM2u5o8VzGSGDqYc8tYCY1 l6fQ== X-Gm-Message-State: AOJu0YwgBTcU19YygJscM2rEhq/7Et3j2+wqRV9UWvf7/JRK7ReP0ET0 zLOVYZzqlH4xvvVlNdMPtP/p7+od9nXG/1zcw4YsUJYZTY9bUcOlw+ffrqJnsRjz48yI7BMeDG9 OchG3NvyKjecpU6t9dyRYcamEwsgHU5k/oajdt9grJFHmsqSwr2DcybNTbOYJrblQJfJC X-Received: by 2002:a17:907:7889:b0:993:e691:6dd5 with SMTP id ku9-20020a170907788900b00993e6916dd5mr1886ejc.7.1691101267222; Thu, 03 Aug 2023 15:21:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEk0SJb7z40ypW8op7ojAGCr5dWl52a34nMpKJ+AkAz5iHM9y24lJnVLwh+ae8Ouf5piDSLYQ== X-Received: by 2002:a17:907:7889:b0:993:e691:6dd5 with SMTP id ku9-20020a170907788900b00993e6916dd5mr1871ejc.7.1691101266893; Thu, 03 Aug 2023 15:21:06 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id v8-20020a1709060b4800b009786ae9ed50sm368466ejg.194.2023.08.03.15.21.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:06 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 06/22] x86: acpi: workaround Windows not handling name references in Package properly Message-ID: <44d975ef340e2f21f236f9520c53e1b30d2213a4.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov it seems that Windows is unable to handle variable references making it choke up when accessing ASUN during _DSM call when device is hotplugged (it lists package elements as DataAlias but despite that later on it misbehaves) with following error shown up in AMLI debugger (WS2012r2): Store(ShiftLeft(One,Arg1="ASUN",) AMLI_ERROR(c0140008): Unexpected argument type ValidateArgTypes: expected Arg1 to be type Integer (Type=String) Similar outcome with WS2022. Issue is not fatal but as result acpi-index/"PCI Label ID" property is either not shown in device details page or shows incorrect value. Fix it by doing assignment of BSEL/ASUN values to package elements manually after package declaration. Fix was tested with: WS2012r2, WS2022, RHEL9 Fixes: 467d099a2985 (x86: acpi: _DSM: use Package to pass parameters) Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-3-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 9c74fa17ad..19d268ff59 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -362,9 +362,13 @@ Aml *aml_pci_device_dsm(void) { Aml *params = aml_local(0); Aml *pkg = aml_package(2); - aml_append(pkg, aml_name("BSEL")); - aml_append(pkg, aml_name("ASUN")); + aml_append(pkg, aml_int(0)); + aml_append(pkg, aml_int(0)); aml_append(method, aml_store(pkg, params)); + aml_append(method, + aml_store(aml_name("BSEL"), aml_index(params, aml_int(0)))); + aml_append(method, + aml_store(aml_name("ASUN"), aml_index(params, aml_int(1)))); aml_append(method, aml_return(aml_call5("PDSM", aml_arg(0), aml_arg(1), aml_arg(2), aml_arg(3), params)) From patchwork Thu Aug 3 22:21:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816706 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jO2AFPCB; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3KV54gmz1yf5 for ; Fri, 4 Aug 2023 08:23:58 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRgh6-0004Nv-1k; Thu, 03 Aug 2023 18:21:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh5-0004NV-31 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh1-0000Rr-A9 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101274; 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: in-reply-to:in-reply-to:references:references; bh=pzpIUWiOWaBLHSoPqSTLRQzW4PqVk1T5oa++ywyfLrw=; b=jO2AFPCB0pE5gYLwfWLpqnoKQzzDngjZfyd9TvN7lsSc7T/AkgS0p6lgA2xSC+PJKES+vs dbUpKAPVSVamatGrmyKBvoUW33h+MXc2RxPw3wy6aGkk+IacX8qCJgyRPDEcmjAa8C11fe 57W3IbId+UTD97injZAHlWPAf4xcO+Y= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-215-xIG9s8v2PzScYiOdnoaTAg-1; Thu, 03 Aug 2023 18:21:12 -0400 X-MC-Unique: xIG9s8v2PzScYiOdnoaTAg-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-518676b6d09so958993a12.1 for ; Thu, 03 Aug 2023 15:21:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101270; x=1691706070; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pzpIUWiOWaBLHSoPqSTLRQzW4PqVk1T5oa++ywyfLrw=; b=KZ2wRmmNjVN34FHFbVMt/kEIgloi0DSxiNUUv4uIYfhKitHZLC8n7Z24faP8daa4GZ qklsSOSwNydqUjYzmu+RgYufxmyanHizmv86LgV+f/BxawHwvYKS9E1ZwR75LhuzNFH4 KcjY853DmJp+rgaK9J4r19UyR+edjtjsdoqEUJWtKD3/sWT37NJRyW8d5Vd1D9tJG6Rj /il6ib/OgqrgEhvK7b2UZskMzh55x5jrHkgg9Kryq6CyFQ5UpmyZOF1oBWvXda0J+Xta KWuhxwkiEhI0gp6k3/Y/eIjc6qI0Nz7a5OTcP5dK0aiUXwluxO0gRBp9ELBEi/gNDOw7 IR5g== X-Gm-Message-State: AOJu0YzS247qgFmCoBvB/61xuw6dcSWeTeSPynWZ6U5uWh/HUCdb8aXL UQOivwIdlw/Lc+LmuKjOcZmUURvmNVvY7j3zUsdZERf3/fHSySEuwAjS8mTKjsc2BdVX4odydLC +e1NxE1CTzPDnWarfnemufQsDwcPA5OJcr71jlA7X04NAQWqF3H0Rx5keMj22FQFPj6t0 X-Received: by 2002:aa7:d6ce:0:b0:522:2d1b:5a2e with SMTP id x14-20020aa7d6ce000000b005222d1b5a2emr90718edr.12.1691101270484; Thu, 03 Aug 2023 15:21:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1rtyP3kz17SFTcDJzXw/q7+IIrUPLxGdEV0A77B+wYXyNFzXEGVfjIhYwt25y40aZWNLjCQ== X-Received: by 2002:aa7:d6ce:0:b0:522:2d1b:5a2e with SMTP id x14-20020aa7d6ce000000b005222d1b5a2emr90695edr.12.1691101269931; Thu, 03 Aug 2023 15:21:09 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id w26-20020a056402129a00b0051debcb1fa2sm344723edv.69.2023.08.03.15.21.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:09 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:07 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 07/22] tests: acpi: x86: update expected blobs Message-ID: <6e510855a90b7ca1811bdfc4be66b0fd4a4af28a.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov Following change is expected on each PCI slot with enabled ACPI PCI hotplug - BSEL, - ASUN + Zero, + Zero } + Local0 [Zero] = BSEL /* \_SB_.PCI0.BSEL */ + Local0 [One] = ASUN /* \_SB_.PCI0.S18_.ASUN */ Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-4-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 14 -------------- tests/data/acpi/pc/DSDT | Bin 6488 -> 6836 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6411 -> 6747 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7813 -> 8161 bytes tests/data/acpi/pc/DSDT.bridge | Bin 12615 -> 13707 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6952 -> 7300 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8142 -> 8490 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6451 -> 6787 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6560 -> 6908 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7847 -> 8195 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6346 -> 6694 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6494 -> 6842 bytes tests/data/acpi/pc/DSDT.roothp | Bin 9873 -> 10629 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11590 -> 11974 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 12770 -> 13214 bytes 15 files changed, 14 deletions(-) diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index 32d255cfc0a207c89bf8459edaca11fad12979e9..3f104cc65c4fcc55616540867ec1ec50a7b9c7fd 100644 GIT binary patch delta 1639 zcma*ly-vbV6u|LIp@g)BmeSTJAKggU6vBsNv6v8)sMSp^vk3{CiL;5!;%OEae3!eI;&HLON1Z$G^2P}4TU~{D1$?-RP*tNh~q`d=+T^p=T+D~EI*mb}< zq-|LI(?7T9Pya@YK1CQ^@X=eF{?m%h`-c%muWWu^A5WBrHS^?}AHsIYA>w)77a2vipwT$G65pav`?CIX2C<6u&EHSq~t^bOe5cQA-A zp%aUVqmGVF>SnlJyyaYfzfZn*_gH_ei69JyM+He*xSxm@P4s5RQP_^m&TRUj`SQv@ z3D=sD8nuFhv?L`YwH1!~BH@&yAnc_tEFrhU&i?%IWW1wS=f1Z3=N0q{>+jH0KZ!oc z`X9Y250vqek+Zq+hX#CK{_{OGV7qnNPQ_^|JIyp>Pur!?r&xa;`#SXndcpc<^wihT zYph?+!g+%%fBkh9*4?0726GuU_a6HOt*fKgS-)*Tzd?Niy}|n1*f*(fqBmLpZNYhq zHhGy)OXRltbcOgyibQeuj;~g-{rrr zT-a`xw)1eB$4+}gPumsH7g)cQgML8$BKjihZ_rb}gucZ3uN<7`=lS!7c^KcJTp4p^ dHaCfVm)5PIudrVCpx>pwkKX6}^wisve*rUoCENf2 diff --git a/tests/data/acpi/pc/DSDT.acpierst b/tests/data/acpi/pc/DSDT.acpierst index 33e872b2fae3d974a3dc4ec0401b1f1734db313b..d33cffc67a5dc49694a6c6a57b3f26da1f759bbe 100644 GIT binary patch delta 1579 zcma*my-LGS6bJCz*p%9&`A!D=wG|YEQa>8Sr6ER{@mkoW>MyWkw?SOj0dUF`$t z0|;({=%94+D+c5deJ?z!MYNQ>5#aI;0(e#aHu z@aRR3=#7Xz<%rHj)O6_qwq1VT5N}k2J!|Bi6JZB;&C%}u=Knrt*1l|tIEfF8lA_FQJc@Tie>+N(erj*OPCt!ET^?yk zGfMMmFWxs5MN{&<=hc|yMI1|KEwJ4>08v#qR+Bk zSkP}#KZicY`ctc+jfo$&-!!e`_vE62dw`hXM3s>Q~TLSbrz|fcjPRRo3T2I4=tM^NvG!ev5K7%+=W3 R6MC9kM_=dsv_8MC{s8n097O;C diff --git a/tests/data/acpi/pc/DSDT.acpihmat b/tests/data/acpi/pc/DSDT.acpihmat index cd84abc1b1d026e6055057f4c6170146e1921ea6..726741a0f0934fa6504ab451d6374a739f704301 100644 GIT binary patch delta 1640 zcma*mJxjw-6b9hiv}w~&+9XZVFKL_#f`ebs78FSu3#IB{)JaIhUE&YWO)Rb*1ZTmy z)Lr}o`U9N06v0_=l-_&rj3;y6C+|7;Cbv7YUDXf#TaS+x;mJjg@G4p?tE(N zj?^B?!FnfDLf1bkFqUSD8=M@fX>%p?gM&hBWF*F-*bDadM-gN3;^`<#v2j#xE$qhH zzs-QnkahwVdu6aPX(f~QZenj1Y?ibESnSP#&5`y=*e&c;z$&Eu0gJtPuzAw}Um~j6^jo_&AK*Me^xo!o)5bF@!k$HP&rh&;MkTN%(ymr`ZwGrd zuo`Kv!D6otRwwPduwCpmz#61=s(j`y_LjkxNgE66Vy_9-B<&km?6tsJq%~@MW)FL9 zur_Hgz+!I&Y=yKh!uGJY3bsmGxz1A&PzL_ZQle?@e;LBDm- i-~(JGh(0#>o_#!{ChXZH_xuKnXXJo&C_CL=8c2T^#Byc; delta 1309 zcmZwCO-{m45Ww+TnoybomX?+l+HRDM8$VDnN(@j)Oav02?o8@hS$G9CoPdpb3JE80 zrS3R^A16>Zx;0EE&Stjn{qmogkNr_Yi$ruh3M6S^IMHN7>&;GM(TW#4v#D)_^2$IF zYxP)-o6(UjNhwKfij%&Uvivv_J^iwv$t}@2oIjq8hh}x|*H{0&f?i?$i&>Qi%J|!~ zO)gip;Ja_}-!~Ra+o0{zI4#Xidry3gwo}ootZx*dU!#5oeTMb-iQlBYhF)X+ZxPN5 zZT`Gt8^&)@PRE?i<|gQA-7NYn>vInDx2c~)pJV+6dg|xV=UM;kz$JMj2#;lZ>PZRg-L zhn@D2_%>}(3J(QQt%FvHqzH*MFAz^Oh8O|oD diff --git a/tests/data/acpi/pc/DSDT.bridge b/tests/data/acpi/pc/DSDT.bridge index 69a73ea2a691de387b82bf85a7ba1a2279c01a0c..89b5ee17e156d08168fcc93ab635dfb83d63b335 100644 GIT binary patch literal 13707 zcmeHO&2QV-5uc|In|hLLN@n6D&WDgq+U^Gu$<8MVw2?^JR&2?NC}+1|P*IW>Rnh=U zWH-PjMo`6DWW6Z@G*wgd(1SMc-iqW;Xn~%3%W;p}LoYpU(M?Y4&OB10EsH=2T zV45@Y_?wS6ocBhgG+nFy<}3jFI=7-O>Z#lZWi^E#1^{$U|K&pH8W?RYw@_ozK!_Rl zqv9M7IZ1g>%dIZ3Keo(2nC2&+o2+g@=|sLH)%0A=*jOAd ztA(^wTP$d?>0YFVuUQf;-MfwC0NYkD!>J=eJbRwBs2>>m1Er6OFhDP`B!~P+nF}kp-mP zXqQ#J%A)X$OU8Yf2o?FODLiN?qpjyJqrcKK9zutSP;=@0WfbH}#R`kc_GLt-)mi;s{SM>fZkW0!cg1i3z-lT&aSU475!P>Q8f#Cw1Po?$&t#8rJ%)dINY6nq9fm#6gh|z;bCxgSGC7 zPLp*LojMQo**dI!8ShhB9F*uZd7#h9Ihaq znsvBc-!he{!WEqJZe*ReTd>6=TRf_qD_l`45vg3Mq!SZ7`o$PTDDB}6JR}|uWc}81jC5K@h>Xyl*yW2&B7KLQLbD` zD~Xy`(BU4P^S0nj*3^nlBh-qZr)zpeXAfJp6&9%{zN0-ipq=^9p4p*2BeZAGzMa}L z%5d!&W1~pEs{`73z=!(T9qMO=`q=^XvmWYa9rfCvdMqRVbL{7KsGk$+=LXczd8nT= zHdaFDy*{WuWUKF`P{f|{h&|<)XJcZrm8czKG8I`gyK>Pfi+O3WoUit98Tvy7(P%H0 zt3`+by!bu}SdC<&r>^EpTB=;pYANNM&|wkB#1zqL^}8mQ&2H>*$ApfFcf=NSCmwg| z@cViU{_&si7Un+YD^7MI!6zP&sR#~uPu>ApsV$WA!iacQEf>=1^f{1Me&SSae(iLy zS3=8`d_M|&OjsLN%d4ryk3O+(-u^}E)`uT|bo*BG!;isWYI%7HD?F);bH2dfIXq{v zJLnw-g39o79y9L$h=?qt)N;PW)Iv#TYNdFUVKGh9VV*%yRf`%H>?Dm0s(OAog~PRM zHKoLAg;GJXfS8ygbJs+zM}ur59d9yeGQ(bY!b(D|&i^dX<((EhP|?-v%HkNV1lfr3 z*0s~2osN7Bnrk_EbxD)|iDQl!?;49Q$p@WKWvNGOgyIO5yMz6DOrR{bZ1f)6)E^ z8^PMXjcUHKhRL!153*_At>z}#NOc>n`tp4D?4DsFGjRHvJZS9+3<~kO+fCYzqnuu}O$WBXUd3L;n1p;53li%kieJV0bQ~9I zfPa5J4PeV@sodVCrIJ1Y5E8KzBPnff|K)ojfWLnC@Ll&Bn@7WNJM*jFaGMKl`j16s zLk*!f_Kq`NE|t?+ENXVaBL0p_g{8Qf<YL}^JZB*Sxg07lmMeB?+zo=E7*h52 zV!<@%&6JDTR0dcS}T_B?%cX|JV(-v2kkteRbY8;7Y!@ zijzA_qX#UO!*ZBvtNiFu;F{Q@{rXXWX3N-!>gjaN-fkNk^D}z-f=%JnFsj98(rSR4 zJS4v-E;R0+I31)bX&?z1?LKg?bR|QFSvt%~#>SbYoQ6R5em;l`7n$U&FbDX)1!jT? z40B=)*6{!FfS8mM#g*0mRg+V@u9A58ILH+BtTeBw{bpet{iQ`@h96j9-v+-8LTG`# z489BkJAMh?2?^lL{Bjw0W_D9CuN9Ih8F-kl@HFGkF~%qHFUe>4HowWgvHC8e)-XNi=<6@UkfjeOWmCMm10mOy#ChD}P$ zN`^3QrbPp(SFlL9X)@TN9tO+HFHN+A#wTmEvQx7}V~J;M6cE-mhk<}*KB3uA=%w)P zxCm$-@QIBV46~cSUAu8o$!i|;3m)_WpLJ&xQ&511{DOx(!ClM44tUrvc-RYk&b55Z z0Uz@VKIRGTT8_0rgk{_>__!DN8P{@LDh0UY7hLiLcP)=N;1R#z5ijtwuI1bT=YGMt zC%9`lRw)sds9*4?7x+2X@|Xi2^9vsH1a~cuJK%A@;BhbT^RDF+4)}y$@Ci?F*YZgR ze9|xYq!;)F*K*kbm;Hjvp5U(K2?spk7d+twe$ll&>3}Ewf+sz}UCXB&@F~CGQ(oX% z*K)-HSNwu2p5U(K`yB9ne!=&7f#+Py_dDSG{etiJ1a~c;cEG3of=_#atFGk-9Pk5v z!4G(XyOtkxzz_NbKj;Onxt1Stzz_KaKjaDST0Y}|&-ewO@dD4gmLGP&5Bmi_>#w5z3Rpc`FpF?c{*^y}T& zdJ7v%BrZ5a2nlQvY>7lfPa-3MTTNS%BBCd`gamHoY)P94lEl|rQS3P$=(tyMDAIJM zFC$gB8*yZ$>ug^}%5c4RWTfp}UqxyS*IS}lMH*MF9*zA5(yknP=Lb5j z4Lv!2&4IKlmx;y-+>@sS?aD6^jdiXkZwuO$3y-my^yJuNJ(!P~o8)H8o7pC1J=&yEXM~-`o7x%edPYK>5jL;A zTQ)2nlz5jh|ql=|@MP2#cszj|bp=CL?on4T zG%Ta8U}#uIUBS?>jJkrMVHtG=L&NfBb_Gj^?1v}xz-06!gr2ng-#!VEOOpF)q`V;B zzLI}HkGK^44NnPwioyf*yBnHNe1&n9IVT#ulVuNJ9`c``A{ZLe8wuVc@yQvDlz&Pu e%qkc0mDvo?`@sFz$@tn%#?C;1@L{pgc0UBR0|8X2#h!5zlh`pHhuvzTdTeJ^Ly>mG zF4962)nuz|;HlJ`st;j9fhQ{2Qk*&G z-1(i~xgY1AJ03+dlhTdx^k?C5o%MtAE5=X4=n6{>2ss% zs4nJ}Nai{B3)PHL2BEr|S3p_{<`lIM?aZ}rff4gF&^yQe*lxzAxcL0i-~XvzykB@c z{jb8&zsZF?y)(Xhll%5`gFo2O0Z?(geT$D9@t_Z)pd*Rf05zj#8O3Gk95Ep8TB{_h z6&8l4T+kkfB*>^=P2iW3&{}Hl8pbO;v5~aNI zQ9@(cWqAptvn4rq&8NLX(*C~Dq!z|Kb`uCg`zfjSKzcue_Y7-ASO$IRc3WM_hDv6y zC}XeHEf_mFF}nf37}T*dH`{e+*CYG*fz2ALZPxBFKJIi==j?$#8~`xtc4sbLpuQBB zICZC_@M@`C0VD2f=?2uEWJ9|(-ZJjjxDV>a#+_OnxE~rFvE9H%p#Z>gaY=#o&Y5ldgHo)J#_8vPv!FvMEnj)w0SSH7ynfxhK8tJv-o?y@vNxpZApMJ%#-Gy{Dw% z-c#CEfnt{jymQ}cxKH=FPn+)31MbrsfxxuTLNm6d8jnlpVEq|tGTDAn41or`)W^0=)-TgMf#2c3z>?HYVl zi@-nr6WqhOkMk7=I~L;;+e8(?0oUX`5T)uuDQA+1X5>;nnM}@sxbh1-bMv+H{%#5_ zm2KL zup=l9KjRVY!Ouv@Kte9%icHQIRVJ4UHy9?~WmPT;E@23A zG52BIw{JkhVCzqmczc~0m_nJEx|bt=XzOgZfhyf-47xM}9#rC>bf$L)wKyz|Z#p5& z?fdBF8)KLq^Z%fl#@%S_5J$?}$m;7$or|wDGiL@4UxWLNS2_lbc;DRyl_R-;RgVy0 z9U3&`7+XV24G-=WEaY>yKD?U?A$diuL|nRg_-uIvA3M*uIoJurN)CG*cC&v-m6&f z6rQppm}K8wL-*=zH9i(#$QiFMRO3Q``>Cd7J=)z!YU4K znpzJq7K37ta;x|-?^`o#v{v3nqor+y)nu}2mD}3Z{EV8sY)LpYjB@dXr0nB54~QR_ zH);>gocGh6)R2sfst>G{uBYfLO<%Kuwsm1Ct00h7&--!XB1-lSbA%sSU^?i)a89hl zI{rWHGY92NVP&;<*W}cJy96FQ4I=e=MwnOR-eF-JdFYpyE9>We+nBtPdpQnorly=};78SgSyKG=;4BfcxC3yXwv`V!lS#;^t3{AbRPm4!G2+}u zjYy~O(YXav%5Qb_O>N>;+Rf>JL~Tfin>9i?6d0Ir%mW-73bztC7{3X}eID?z(J+1l z=pWfkQ?AdhatBCxfek03g|Gz3}J>G_5v7o z1DtahMr^={7r=-spu;d~14g|7M%@4}ISeOkzzHva6Rv;`!$})((hK0E8{lP!p=bk& zUI0Z`K!;(>28?+DjJW|`aTvyJz_=H{xGSK;aLNXp@&Y*J2AFXeN;aV61yFJYbQm78 z0S|crJmdzLbr>GD0S|itJnRbSFr2mlr@a79y8+4$!y`7}5ifv8Tmc=1M{U5PUI34} z0V)o|V>aM1FM!8f0Ud@jHsFjGz!^8doWt4#Sf+ z;7KolCtU#@hNo=6Q(gd14FQyjCzKn-imwyiXfoKQ67gmyveCqY4GNcSA%FswsFp<_ zp=%LQz|zRFBuMC5uA+b?iDhY#K$hr6GmJIwwu-fYEs>`SJsY{gUD&pfuZuk!Im7+W zwvo5Fo{ik$&STri-zBn5ZZyrq63UqMyE2{=P)I2h z?AWi8jQOT(Z<(@VHzUT?-nC%tIWPo@STfytp?1+{_ArD rLv6Y(!M!EArIz9^>18+R3cl`^0(zIP_lm3a0)L-^n$yd62U`3W8!JGy diff --git a/tests/data/acpi/pc/DSDT.cphp b/tests/data/acpi/pc/DSDT.cphp index 20379056b399bf1ad8b8316453eac344f604d3b6..cb9fc3c524f238f90d9d84d795061fe78a21a6dd 100644 GIT binary patch delta 1640 zcma*mJ4?e*6bJCzv?(P`+Ps<;`iL%qgT)8-AvmO@O07DWii?mA?$$4$ONWBs(nWAC zbd}=ZCVm0^0D@aVa2DL8_Z~ds$(;X>|2c=7X>Hh4{J`%GON_;;kIF<-I`i`|Xob2r zpFL}?RPV~cMk7pxo`0e;7H26hI6YS4_G;({N9w>#NR0Idt)P84>N7T2d>!>;Y#i5D z7It&}-zLB&NZSL8y)sytv=d>sur~=dN!lNMMe54qis87_diw^CUPg%Ci|9*)=$D8Z zCOyE8$?v<3H%h~vX>!k7VQY9J6|73y53ty)fz?R6X7QQp*qZ^HA?-C-?9GDBlJ-s5 z2KMS;b$YvuUN9`@Q`ZPH$V#oip)9BH3~ zZDFqi)*)@u;XhQ>p`ZSlh~7kqPDS)RLiATem-F-h2YG&9A8%BIJ&WX?55l(bMkTN% k(td-*-ZI!SX?F{J<~{7KfUS`B4lMS%U|q`2J_{Y`58!ojQvd(} delta 1309 zcmZwCy-vbV6u|LXN>VNqN?S^SKo=z@E^3sIs6(-sm4!(jPZ@{FxiKB$c z(MjES0`(2lMOVY=iDxE)l zU(LEY(8k}UYjfl4dHC+<`R}VdY_~z%={QYir+uKO?NaDdtlzPqze#<8UazCk$ya|WB6#J)-EX3=L^pLL+$q<#*4j`gRpZ&BYwZ?gWyf%Co` z{=B6EjBiuU!koqCF45DvHhP=&@39Z4@1S>BzwN?40rd;$3#`9!;k+l8Kkq00t`+%j zS%hi3w4I03Ja*axdfKjpzQlUNgMLW;GWs&>Pta4pg1*A~XAiFb^!W1@OEA7mxhm$W bZ0;iVd$ev1eU0^R=&A3c_c=e^D(|a*dzU5N diff --git a/tests/data/acpi/pc/DSDT.dimmpxm b/tests/data/acpi/pc/DSDT.dimmpxm index 435496e836939eeb767f1a524dc1471740ad917e..3fcb0a22a3d074ce3e6e6d12eed95d174876ff99 100644 GIT binary patch delta 1674 zcma*mJ4?e*6u|M@U}~DC4@#Ox+cXGL(8))&oh(VyLaBBzIw_>1V;6T3gl>vm1!u)Y zI{5`01@Q|gLN~=#L6F{i@QkPX`Q?A^<>skz>#IQ+>@6=a7W=+eyE(NpIgCO-%6gM= zlyfDiE00ce!(EDka7P>D<|M}Y13zqS5BrP_yl}ra?8n&XMz2gqpJy2T(JQsC9In+P zCGvt@jWL-i(+{b#PG!1zZr4}-Z5(Wzv{zuUI}diAv>(D&v8#YpNV{e5ovYYQfK8D0 zT-Xils$f;pzJkSW5^R#Rt0v!h6T2E%jkKp=v6}*$BJGQ?HSDIrrb)YK@ttef&4A62 z_E^|DcC%o!q4}|sc zjtsB{Y45;d*92>l_E*>@b}g_LX?sO}-X?Z!ur_J0g$=M<09zpK7g+2T!4^sDmH5sr o?3TcmNP7tuyAD`~wC}>Uv0DaPCT-Q>JGZgxf^{i7K65(KA8fySnE(I) delta 1292 zcmZ|KOG?8~6vpuw(g(LGO=6PPJaJMLC!(lzR2x!3v__4Oi4Zs7V+HC!-9V?h0SAIq zH=$Cx15sC@Bk8>d&*XG`fBf(H9-@Ae#c90P4<%{rx z7k&x*DtMLjzu>W7245!qVU4f9tkLVAYy8}0%vB&)A#?f!_YFK(1Fw<(6g>8I@H*+= zgkQnF0p1|}w8Q6ZJM_F8ho9TRoC!IT%zc5!b1m=|>6a=N)+b`C`O#&*Rs{c%1{kIplAeFFao7f_F)OB77VB9(a%Rui&xogZD{474UgU WK(D_J__=GC3n3R$x!z~6F8={LI3!;H diff --git a/tests/data/acpi/pc/DSDT.hpbridge b/tests/data/acpi/pc/DSDT.hpbridge index b6eafab250d508e1358ea09f81eb1b2a6d96ce32..2cb4310af36c483e62671c9a9eaefef9363e59c7 100644 GIT binary patch delta 1620 zcma*my-vbV6u|Kdp-|dVX({C!Hxgq^42WRjU~B7wI#Ah6+Ay2Q1Gur^OyUceI7>Qf zd;uLDTp5hJiJKAcJ;@mlbI-5;b8p(XJ?$!9;9X3sj3s^-%Db9fUWS1i=8u-~mpV@F zI8xBw4P_@7ohvD8EA)ahZDOX9j71YS@K0wEW0U`lX-FYG>cHLx0KzrkWR2R27q-{9x%VOIyMllIPNB?r>{*|0aMPw-QWZkY6F-{fzN z))>7Nql-00KTLkk1H7XGoU=flbGyK;gLhtfdiYm>HV@ts}l zmcW)sdoAoScFSPPq#of61Fo{!sCceVF_Mj7@Di delta 1250 zcmZ|KxlY4C5P)H0tQ?Nx#0Nf54$(wHG$8>JBnoUC4he|FLKn#qPY@cQrv{4jKm$E; z3$NgY;~h920@xif&7|G^^v}%2a?(;G79F;INt&8}RNo8vbP%&JF0ZG_N8wnW>nW_& zjB^1y+E*338b@qT8=0ycvfl3B<8XYgH{`xDzSA9x`hL?J3w?#PeyGOeku=k}&K#scj}^;1)wpA+9}_=(Q8+F+9Jyop^MtWMe);)kU`^6~fyHhbY?`zyCf~V% zT??#5+8eOgwZYn?{SdZ^-3-_aX_wM`=O%WuV6&vX64u3T4s4FJZ(y;T2b(9YVey?? n*e!r9koF8Lc8g$(qpo|NYc^H5NwUW^YVUMymI0ptIIsFOHhA*?#GN=m%=G zlZ>Vtu@(p6hM_14MGK;>RhDqdaTv9YW6soO)LI#S-0xoIDrzU$z00{a_57Zz40AJ> zOF=G0=7Le-Yg2!}PlHdB{suhuGvG6%|CW9h`x9ditFjLdOM zdOTMLuao{r`Z??y;0@A0gU5are3tZ+T+CbN^t=oCeEZMy8y9ODc%2Dnc%wKJff4wV#bijP?2rzqvW+G1i}a9rPk>c$TY7 z?9#%&je(7k_7yDl%3x*EmUZ5{jJ;D}r$~DO7JK7h9wu-$euqo31fW_W4*feRo7QeTK zy&13>(q4nbUJa~9+Am@2*qa5LC9ONn-(1Ju9M~LbuY`56R|l(;_5&>T8ek35uH^Zf z8`x`tHA#B`7JDtQ7HQw|{D=C@(?8T)fk(Fsbo5k2Z$d<0MD#mEv@pXrYT`yV+-Z|{ k9)rb=ieQVReG;~Xy(O?E(k5;G<`(ukU>(Yi4(+z|2NqUy#sB~S delta 1308 zcmZ|Ky-vbV6u|LPN+=EAEu}3K7Q^Boe&b+5p`a!riPa6QPoOON0*QOBl{Q@hpe+-e3Oboa^RzTk`||Xk3w`$m6TFkkfk8K^U~cY-c)YxgwkU z6uwRCTIem-FO{I*roN5dX8n!uKJ^{+4(q>5a9*y=pVuwJ_xYUfr!s8Uq3v9p=5o{S aUEp0>u7bS6@zDu-%2&}>IX`)G_vAl!D&||DW`8w!D*zis(P3&^{ z-^RekNc*Feq;7mz&{IXKrmgen=@ii$5q+K_`X!>4K@YHQ@I9+|qa^H^B=@`$b_H)F zgOy490Tz1|unK7xO+ND~_Nri2(w>9GUJa~9+Bacq*sFupNjqopnQPcaCTtyh zO|T|uU%+Co1=b?1WAmBUu-67_llBBG_Bvo4(mo06VXq6;CGCvEf2bvge)@+ZdND=x zK}6rDi2jP`yh{(TX(=Pyarw)y=h91{V4b- z=})9z!F~*UjPx&NS?y|rFVlCabr(`%d=+y#`z^M2%a(Wbw-EvBvFb|y?S$!YiCak~`w6zP+W=-07tfwxG13?BP7 zc$@Ukj=28Qq0gIl#rQSMxsY?o+=cWFT-O8dk^T)l_S4|gq+j>MK27ZV;C<3xd*ZwY zk3R2P=31D`LM}_@dTBAfh3n?P=SY7ieSrNu_&n(ozUT+oFMuzQ{>T^SUHSBRPxAZY fpYOShn6`=A6=7PDoOTW#w=01!QGWEA*;ao60qQ3j diff --git a/tests/data/acpi/pc/DSDT.numamem b/tests/data/acpi/pc/DSDT.numamem index 59e31338eeb3a84c39ed3ae63105226ce2ad1125..36bf83259ed7d3cb51e426d83663421ede24d998 100644 GIT binary patch delta 1674 zcma*mJxjw-6oBE|VrrVCX-u2+yAg+iASkW<5L^;dp;R4=Iti)x2P(QMjzw_l<{xmD zI&~AA73V_7E)K4a(t8h{@pM1Web2ol)9Sdc_dNk-o*l|-|%Hc#4nu-GktEs*w0*fw^H nV2h+(v-!?#?3TcmNP8{pK6cAs%cOk=i(Ln-L)np)=|ukk4#0Sa delta 1292 zcmZwC$x6du5Ww*m(uFT+vnRC+z4fAkv{dUwXiNmbS}=N0i}4X$ohgUXTW&f;KvsRZ0pi>0=EfvTZ*2pQ_-ueUoxS; zLVXRr#`-Jt)GwhgvHsJ9_jHSYFSKC&D&=&{>1^&M^F2D(KyR@A2R-#o^d{?%Y`ABQ z`WAYN_4hWs_h$3&xeny|lyflWu(@;ebgqluW&Km;1L}L|J=QO}a8E#eAHC1|OBddo zxcqw`*|_ZS;|&kCg>+pNw^i9~*XZfG8u}XRzcU|EzmC4n`a>V?iKyQ|-(dZn58uD~ V{CiFXa+{QEVy?;Mre~Ec`48DGBwPRh diff --git a/tests/data/acpi/pc/DSDT.roothp b/tests/data/acpi/pc/DSDT.roothp index 448d596cf413d7e487af114e5c80bc73311d17f9..ca44cca6a3e46777e1e3433512dfd101c1c7bb8b 100644 GIT binary patch literal 10629 zcmeHN&2Jmm5ue8oY57P>OKNS|mOlu^M(ZT7NlBJ%6lhKEQW7nZT5~BU#R}z;R8ZPA zkcATgkp-hPgF1?Psmr+Np$EoLP6g~gp#^&CrS-AL^w3L>DH{6}b!KX(bmx`uTesK|i-OjDbOIj-TzAC5i!vKKp>AzSAt%KfDa*I_K4TPBf zC~Do~B_~MlD!H{q_S>fM8^iecGlSJks6Q8<)obRbJ4PL7&}QA_oNmM$LRHIE_4d-J zDi_j1b*Z4lvafhhsAiQi2-UTM0@89guV}@1cfNBM%tVlZ(LMF+PBSsV#aCDV{15HQ zgW}W4e-=;vNiOah-O*=vcwpBs`J){J02!w{cloH93pk~%=p|~PlA`3{n z-cn_)!lLkk3;H9G2pRcnDZD5ty`|-EqQAlm9zutSkaOw$O%&ux#WIVE_G3iIxzbuO zr52R;Q##A7$jcyIQ04s1fc_RydwXV+Mwnad4iJX^J!0>I^iCF^88(WrOu87(SVPK1 zR4XdVh_A4q@1(>E16~-^F_;fKb?DS%d-#EeHCB6A+hTmw4O92Rffx<|m~|(ZOLG)U zahX#%C52bjas|v}pkcE50=!%^N4vK^TR!YkXY;@0e z8myb>)Oe`R)?nkyc%RDRphTy^1AR`;;RO2}88*y^TXil%6rI}H05G>}sBdS3fw{3` z)L^r=Ye*A?TR7+4$Tn{^VV6gCc~qJ&+>*-?K`ocli7_7id;}tt_OJy{h{wZtEp(&L zn&?fF?sti;w^v5dfov~{W8-%E3K#_~ahy+lJ_eCs7;!lMMJ+sOysA~QuuDd$axvbF$xopvsRjsVCCr#T5lhhO6(ViR7&U|Rk?9-mHv}e%1{n|6q zaP1krT_oS-0qs2CL;cJ?^)r_GnE~}P9_nWt^~#`nEF=GQ>}U6>pS9G_4yd2?P(Q1; zS3~H%HmE*itM8>y#GdkqJ>{5ZBi3X~Q9H(DDza#H#iCOd^TLvvuk>&k`a=a#Z!M{n zBE$e*eHR6+Mk3J@xAP?>rIwXyN}9KHn8YzKMU-mofx$(i8++O@pkv^Q*oE%c(@qV( zsKwy#{|@hB?qj~@k^&;DBp#3q+~9sOBvr;#pZOq|@nn5LbWbRBpb0IoK^EZ9jJ8I-mBN(zT7*-A=^ zRSTtpU;;5QM`qWpT8{?VMmpYP(qx9c@r0#>Tv_;WpvyZ=cr2r271t8N5q z`yQ(K${Z%g`aj5~c{dw7WFysWwCc;N-7ANNS($;;*Wf|(P+(Aq&uup7IFb+9=Me&| zLxZLqeQW5M;m#exLVGsr!^2#R$g5f<<`L%M*>VUUgJ<3u3Q@D7r3{>;!8E{rS zEhNe*QI_nLMccl;qHl2iyPY@$utwo$k1lMHy@|bvF#-8379`ed6u*h}={RoG0RQ@I z62O+zR=KxFTP1x0U`ed47)fDo?+@Qu0{G*%Pu_8#v3WEMk262-4Y#?_qW@TA+HwfJ zu}_?FwWOxASk&x-Mf`o03QKV%%cJ`$)z>e-e#t@vax(&`<=P!(AOK(TDbh>IExApeIl$O3`Q#dt@YVllJ4se5q#CNR+ z^+)F~2kA)~NJ2)Z4?HW~%FtzoF0+E(o?Ff-2xOnA4p|3vge?v(`Q*MIK*dp9DV%3c_^DvSCJEE%u)Y1FgTgy1pj1wCG32n_NfGr2! z%=B(%=|*q=^7l;3xM>hX)`2W3{_S9v2szvVnBLBZ-CPo~+FA*ui&gAVVrDXgVKYn` zN3DWM!X1ObF10XNU4CYu88kjwrH!3>B^paSy4^ z3QN>4c+?Ag-nBgDfXDoT$2`GZ%i|7s+%I_C3;e2U`IrMf<`;a-6Wq0Y+yNi=3qI}z ze$BO9bihTw;G!qEYk9%}Pxu8-c!6JcEl)b&Nx$GpPjJ`r2?u<_FZhHPc-FOCa=<0O z;F2e}Yxyw;{Fq({H!OqYxy|`{G4C#b3?$T(i!D;sS@Z$x0?(e(-HknH@4lxz7mOR z4iQ2EI|N%I5Ydx}NZ?V^mZXU2Np2v4M>$*4B7!9G?Pe5Pj>j6Fl^lvR&GluZ3Qr@B zjC5V;%SajS_l}IT&G%)b4tG>XM*6OjY<#&aUd?aD2Wv6}Sc*ke7`AH5!^NIX7F5S|c}Gj#{Ik*@CCZ zUTryQjjU{uvL3C`Q8$F$#s6bBL~p(hycZFbQTKJJxM01K5id~RE1gs268=1m(NFQH zL&mq7Ys|S(=sk@s2M_sAE)fcik?^;Ih=dGmn(0>j5xpvxuH(z{4A3tD`ah7dfBv_R MLBr`){ecnx0Z2bYmjD0& delta 2603 zcmeH}y-wRu6vrLMpy0U9hn)~d!ASsnXqSNaYM~zq2C1kaw3kjrGHWX}>I0yDAP^Hn zlmR+ad4mAT13;&$55NeBwL{7ykeqwz5z?V6OIH7X_jmtCvW~sYYGu`9-fGR2q`=aV zdKwPzHUeutEBVo_M(a;FEz3I_^?p73^n?{={E%Pt-e?_G3YFNxtH8U>mkKKs_;V># zWN()xbIA8tS^E@MkAFt#IA+6XJ4VM<8_G;z znE_E|fGl$u1AY>RRRyn-{DU}Lzmlb|{}2b=6zVjg(@5PfuKOFOb+N6r^_?*Ea(=26xShWb#RY1ry3lC=AbDe zXpfwut)=<{f@p9E8nWN-z!{IT=i~SM4m$3Rj}%SU_QrX}Ouk#?EpDG28hX?4tW8GW z@w(}CR8o^mJCa@~7`BGKzs&+UL(@CXzE3hU*6TO**4D7cSpWaSVb8=y12tXVko7{< zuo(?)*E#)W#;J*8+3oLe3uqtKm>N%_Q2VM%DrvLx| delta 1427 zcmZ|MxlRIM5WsOD%e8F6AxAi5kz;{1Dxw^A0t*#L;%Z~mHBlQYdo6qh)|XH#;|qud zy`9G3D=2Ru%uX`R*zWhse`d0ilgW{&>DobW&1SP-J&WII@ATNv+eV->HD~Ev``E0? z*-S^!D;2}j(hv7+;blY92hw#&bhPzufAQ_iyps#+V2+xG$7pH$(!6E^ZfE(ITv#0n z`sTce++lIi!TLrGv6Bk*iWpz?{J5X6R{KCweFA_g0|4MST}~7wezU zQ{Ro=&3aE3&Z}hk^DeV6ew%V$%z4?|o8@b?u83Y_y_|!7jrugg(T2 zw*u#FDE##o3XE@2E{wS_n;WC2btC8_tWOuA-==;PeU$Y#=&2t=A7lMTadF z6XPNl+M8D1xV-E}-etV&*i-eH?&agw^z$IkW?j9+U)9;br0ejFa4Q;A8Edx6yt2OE zWUSTsalffBZ#z-!xRZOj*~C5as=D_%k-T%Co^39h7d*G*>Tbz-5ms1$HQMDLV%p9( z{-^49Z`aJ;?a}9^y|||FY!RO8@0W?~DdhGNNxM+fc+Ow9Xo)dZQbQ$eE141&V*_9V zq&<^%4s(NGgQSgGB6kjRHLx0KH!XXnr15z;Ud97be6mt%P4mvJM{(*X-pI!CIFt^J z>10f8Tnv@Rp}N3!k@i5^1~>VcKe%_ zbm&d<9kKiZ>I~2sr0zBF7&iudjO2exei8j~;Nv9UaYdd*^e2E%ko=)5>V09oG^~~;S9>LS57T9U&yf5N;L$${{3yxaD~UW!^p62QM)GeT;mVQMv X-Patchwork-Id: 1816697 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z4kzw6fi; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3JC48KHz1ybS for ; Fri, 4 Aug 2023 08:22:51 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRgh5-0004Nt-SS; Thu, 03 Aug 2023 18:21:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh4-0004NO-QX for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh3-0000Rz-5c for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101276; 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: in-reply-to:in-reply-to:references:references; bh=ifjgxfMBV4xR+8ddwA/Qkk5UE1d3vleT1b8VgxEZlsk=; b=Z4kzw6fiqHX9jpoOUkWhs0YFAKM4aHe4OohZYjy2fcbOBEsEtg+w4aB+j9JXtz4HmIChoc 1RABjyjlKn1usl4PAlrHn+ZjG4nad6zBGe/WYqz2Eec8MOH2trx1ySCTPqfKj1ZobrOI12 xU4Z9NEbersKNIT44HQdgXKUHdEkoKU= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-421-_jWLPzabPvyK0SHz800DiA-1; Thu, 03 Aug 2023 18:21:14 -0400 X-MC-Unique: _jWLPzabPvyK0SHz800DiA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a34a0b75eso92202966b.1 for ; Thu, 03 Aug 2023 15:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101273; x=1691706073; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ifjgxfMBV4xR+8ddwA/Qkk5UE1d3vleT1b8VgxEZlsk=; b=CiWtrNNOBRW9XUbPdQI/fqvfd8eJQQyO1cHzAytp5JVIyDALW7qmOevGKp0lvOncm5 XmJTSltyfBy1clj4XF23gE85wbdJYO7hcZuxrCm+M2sCYiVtb52WErEcKdMk69BPYnmM I3Z9u5o1ek0ZwGDC7fS5/fuZ1uUlYG6mXR2RcRP7HmFlVAt4HD4E3nudvEue1I74TYl/ nzouY0rPdxX3Bvtnh6Q/ubKBOmRQU+vpgSJAfGv+6Dki20o9Usm+c6GhTQZq9PokY2So mFefSjQ3vFMNOnlhSZxFx6+DO1vzf04bZCfl0s7jrObM7ACYWw1hyS6swZRWA5G5hxT1 7j+Q== X-Gm-Message-State: ABy/qLanp0s95v5/jpTFyRrSHvNfi4IIWvssiV6vJycPMY4l3/C4xuE3 OM92VqSPdjcNq1rRdyuzP6i2Ta3fn1r0r5GMhjz5NXEC871q+VuAM//JWPc4m1We8nFReRpl9IY yGh7DocKAUPHWI++xDn+ZMNDm7lRnZGG2sQoupKJhZ3a11XLQm8/9nasNMq3HjZdR3OPC X-Received: by 2002:a17:906:3f18:b0:99b:f925:2f6c with SMTP id c24-20020a1709063f1800b0099bf9252f6cmr7882936ejj.39.1691101273305; Thu, 03 Aug 2023 15:21:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlE166Xo9jwcEL8BKiiktq7nlByWUENjjLpSxFjkAohdUOgfoGqFUEsxfGj86wUsE4/awu5TdQ== X-Received: by 2002:a17:906:3f18:b0:99b:f925:2f6c with SMTP id c24-20020a1709063f1800b0099bf9252f6cmr7882928ejj.39.1691101273101; Thu, 03 Aug 2023 15:21:13 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id d7-20020a170906c20700b009929d998abcsm368400ejz.209.2023.08.03.15.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:12 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:10 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 08/22] tests: acpi: whitelist expected blobs Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-5-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..8911b10650 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,38 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.hpbridge", +"tests/data/acpi/pc/DSDT.hpbrroot", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.nohpet", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/pc/DSDT.roothp", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.acpierst", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.acpihmat-noinitiator", +"tests/data/acpi/q35/DSDT.applesmc", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.core-count2", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.cxl", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.ipmismbus", +"tests/data/acpi/q35/DSDT.ivrs", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.multi-bridge", +"tests/data/acpi/q35/DSDT.noacpihp", +"tests/data/acpi/q35/DSDT.nohpet", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.pvpanic-isa", +"tests/data/acpi/q35/DSDT.tis.tpm12", +"tests/data/acpi/q35/DSDT.tis.tpm2", +"tests/data/acpi/q35/DSDT.viot", +"tests/data/acpi/q35/DSDT.xapic", From patchwork Thu Aug 3 22:21:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eqrtWkOl; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HB1NzYz1yfQ for ; Fri, 4 Aug 2023 08:21:58 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghB-0004OV-Kd; Thu, 03 Aug 2023 18:21:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh9-0004OM-Jo for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh7-0000Tu-Uk for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101281; 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: in-reply-to:in-reply-to:references:references; bh=mjcsuokqTESzikmNpnCXKmAhKUIJbTsj91hBriUgUdE=; b=eqrtWkOl5W4RzEeoP5tLSsWlbhAhQ4YpGwmYoCd16TkykFfm1DsYLhGBo+M51WI7/XxtzJ MAf4cXKY5a/QP5CR7e5h2iUeppzgmSTHONDirN6AAEydJRzQ4c3VVigMuQy3kMFR59SU9X etWVAAQE18y6JKJTKtahsOpCQH7TwGM= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-169-MF4FFNWnM7eUFMXtDGzVgA-1; Thu, 03 Aug 2023 18:21:19 -0400 X-MC-Unique: MF4FFNWnM7eUFMXtDGzVgA-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-98df34aa83aso298137466b.1 for ; Thu, 03 Aug 2023 15:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101276; x=1691706076; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mjcsuokqTESzikmNpnCXKmAhKUIJbTsj91hBriUgUdE=; b=ask7xVsSmJwD5dbXNFKgG7Dd80+UyfBuMecScZKfSUonUWQ9bApGTSD6ugU2vUVN6v NEVaUeWlisTNJgFyyMXX9Ov31O6j3D3bUYFIrTgm8PsW0bqxj0C8/AHMxOtMJ6fEHl7q szAVBH2j29dbwX0kUApHdzGhoATHWWypeGcNTpWwcJUAYMwZ8qlRtyEcgtjDDWIPA050 85Cc7Ri6pfrwOC+AGiRkkr6OL5tLMFDCxvkMJjYi0yfwzlSHNz0w1nuUVUCtlVEqJL79 Cd2foffDG0Cx4VtSDpkh1g7ujU+/9V5vVasd/74kieUgwKQqE23Tg4FvrCltEz907MMs /8BQ== X-Gm-Message-State: AOJu0Yw4UwxzMDMuKGE0X/yZWEN+qjGrpPeFx85XBhymQdXvFw6FAXgI sDYax5uZ8PewrgrqfdrddrACf6oVJVxdmUq8SaTWhYzNoGJacAw5lbPfQGusCzgLuxLnANylh33 AUvmvhhAkjGEATgALpCYlFWVTbdZQK8oxO3gAKNBrL/6pnkRutQtu7LEWzjgnUq7EWSPU X-Received: by 2002:a17:907:a050:b0:993:eee4:e704 with SMTP id gz16-20020a170907a05000b00993eee4e704mr48699ejc.38.1691101276711; Thu, 03 Aug 2023 15:21:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoyjCKdSBnYYl92MqJLhlxCenLiMYpsjQrN8lRCkZ4UeD3bZItyp8MqvjpEinwU56gQ0IV7g== X-Received: by 2002:a17:907:a050:b0:993:eee4:e704 with SMTP id gz16-20020a170907a05000b00993eee4e704mr48684ejc.38.1691101276522; Thu, 03 Aug 2023 15:21:16 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id ce21-20020a170906b25500b009920e9a3a73sm374105ejb.115.2023.08.03.15.21.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:15 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:13 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 09/22] acpi: x86: remove _ADR on host bridges Message-ID: <5ce869f788b0b8d82693212366d5637d9f3206c9.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov ACPI spec (since 2.0a) says " A device object must contain either an _HID object or an _ADR object, but can contain both. " _ADR is used when device is attached to an ennumerable bus, however hostbridge is not and uses dedicated _HID for discovery, drop _ADR field. It doesn't seem that having _ADR has a negative effects OSes manage to tolerate that, but there is no point of having it there. (only pc/q35 has it hostbridge description, while others (microvm/arm) don't) Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-6-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 19d268ff59..bb12b0ad43 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1464,7 +1464,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, sb_scope = aml_scope("_SB"); dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03"))); - aml_append(dev, aml_name_decl("_ADR", aml_int(0))); aml_append(dev, aml_name_decl("_UID", aml_int(pcmc->pci_root_uid))); aml_append(dev, aml_pci_edsm()); aml_append(sb_scope, dev); @@ -1479,7 +1478,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, dev = aml_device("PCI0"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); aml_append(dev, aml_name_decl("_CID", aml_eisaid("PNP0A03"))); - aml_append(dev, aml_name_decl("_ADR", aml_int(0))); aml_append(dev, aml_name_decl("_UID", aml_int(pcmc->pci_root_uid))); aml_append(dev, build_q35_osc_method(!pm->pcihp_bridge_en)); aml_append(dev, aml_pci_edsm()); @@ -1593,7 +1591,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(pkg, aml_eisaid("PNP0A08")); aml_append(pkg, aml_eisaid("PNP0A03")); aml_append(dev, aml_name_decl("_CID", pkg)); - aml_append(dev, aml_name_decl("_ADR", aml_int(0))); build_cxl_osc_method(dev); } else if (pci_bus_is_express(bus)) { aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A08"))); From patchwork Thu Aug 3 22:21:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RfbYhke3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3KT5WDYz1ybS for ; Fri, 4 Aug 2023 08:23:57 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghE-0004PD-86; Thu, 03 Aug 2023 18:21:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghC-0004Ok-21 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgh9-0000U6-Eq for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101282; 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: in-reply-to:in-reply-to:references:references; bh=D0gspcezD7bJ527qTvYSYLwpkwWSDznb8v7Svh8SQ78=; b=RfbYhke3mjfTYilkHgXjZGKuCAE0kK4u+0soI2FTVpC12k2v6jAsiUalhCA+GNrqYCjM7a BfxiCaCa6o/5fR8VUaFRbNwXplU+cpDLI3Da9Zjc7QCBfAs8knjzmSw3SKxx5EtcCU2zIG Vv4jeiNsXh5JWNa4NHoQkZNWXxtLfoQ= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-FSd6IWRyMwiX0stYsie1BQ-1; Thu, 03 Aug 2023 18:21:21 -0400 X-MC-Unique: FSd6IWRyMwiX0stYsie1BQ-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-993831c639aso90870266b.2 for ; Thu, 03 Aug 2023 15:21:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101280; x=1691706080; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=D0gspcezD7bJ527qTvYSYLwpkwWSDznb8v7Svh8SQ78=; b=OH6KW/Z7sA/hkL4NpsLHSKkWK4SpXbdqL2TvA6MoovH4mEsiiwZY0uYY2DVim+7vgt hERsYHJz8IaAdjjJl+fJGgZrqaftgykpemLT6oYkpPoIF8u0r/vmORvHAdsRPHQtg9Hu 78cNrlhcwF8ggxwm+abEHeN9VeWkFrBbyhjRLMaHM0cN7ZgyiwlI0rHzoU7k2M/nS25O RP9Mid8pJFe3rGdT0YoOW/ejfDf1DSj3OVkcN2H2AbE04LJn1r6TurqN9TLbXKsrk21L LQCnS6aj2zARglJPO+hDNCb881SZlXAW37n3huR6D+0JAwy2eNHlRGclIjGcokvpmzMd 5SRw== X-Gm-Message-State: ABy/qLbefCXVUwDoGMpDgMf0WvlKSmqZodTvVWvbehJXDgZrUXnxf1BB 4vfiMRw5Em/WUOfaZBx+Gb3OoVmpSNtVAciK80IX2v/K9v7JpxlVuu7XHu0UoSQTMbRseYy+db9 tsKAwHKTf42AA9ODtmjsclgHyEeq7vahAUpRLLLQSjOZJpdDY98GcjidiMUUBDEPlxeho X-Received: by 2002:a17:906:32cd:b0:99b:e5c3:2e55 with SMTP id k13-20020a17090632cd00b0099be5c32e55mr8676744ejk.38.1691101279852; Thu, 03 Aug 2023 15:21:19 -0700 (PDT) X-Google-Smtp-Source: APBJJlEMiTVSvlfzP1Omlhj5NbggWjMqXgVU2OtlYFheR7xWhuKZgKylsmE8svP3CNEvkLNTbVTa2w== X-Received: by 2002:a17:906:32cd:b0:99b:e5c3:2e55 with SMTP id k13-20020a17090632cd00b0099be5c32e55mr8676731ejk.38.1691101279425; Thu, 03 Aug 2023 15:21:19 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id bx22-20020a170906a1d600b00993860a6d37sm377018ejb.40.2023.08.03.15.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:18 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 10/22] tests: acpi: update expected blobs Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor Mammedov Expected change is that _ADR object is removed from hostbridge descriptor in DSDT for PC and Q35 machines. Signed-off-by: Igor Mammedov Message-Id: <20230720133858.1974024-7-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 37 ------------------ tests/data/acpi/pc/DSDT | Bin 6836 -> 6830 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 6747 -> 6741 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 8161 -> 8155 bytes tests/data/acpi/pc/DSDT.bridge | Bin 13707 -> 13701 bytes tests/data/acpi/pc/DSDT.cphp | Bin 7300 -> 7294 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 8490 -> 8484 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 6787 -> 6781 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3343 -> 3337 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6908 -> 6902 bytes tests/data/acpi/pc/DSDT.memhp | Bin 8195 -> 8189 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 6694 -> 6688 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6842 -> 6836 bytes tests/data/acpi/pc/DSDT.roothp | Bin 10629 -> 10623 bytes tests/data/acpi/q35/DSDT | Bin 8361 -> 8355 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9686 -> 9680 bytes tests/data/acpi/q35/DSDT.acpihmat-noinitiator | Bin 8640 -> 8634 bytes tests/data/acpi/q35/DSDT.applesmc | Bin 8407 -> 8401 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11974 -> 11968 bytes tests/data/acpi/q35/DSDT.core-count2 | Bin 32501 -> 32495 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8825 -> 8819 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9673 -> 9655 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 10015 -> 10009 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8436 -> 8430 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8449 -> 8443 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8378 -> 8372 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9720 -> 9714 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9491 -> 9485 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 13214 -> 13208 bytes tests/data/acpi/q35/DSDT.noacpihp | Bin 8241 -> 8235 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8219 -> 8213 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8367 -> 8361 bytes tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 8462 -> 8456 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8967 -> 8961 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8993 -> 8987 bytes tests/data/acpi/q35/DSDT.viot | Bin 9470 -> 9464 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35724 -> 35718 bytes 38 files changed, 37 deletions(-) diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index 3f104cc65c4fcc55616540867ec1ec50a7b9c7fd..c93ad6b7f83a168a1833d7dba1112dd2ab8a431f 100644 GIT binary patch delta 47 zcmdmDy3Ul#CDUsd5e+@xe~<(M=xg0nVNV9Pu8WE Cx($v1 delta 53 zcmca=a@&NzQD`Dps+g`;OuF@5%1yY!sB>>i+N-3KNA2s CSPi%U delta 53 zcmZq8?#||N33dtTHf3O7yfKk0RnCDUKG-Qfy2*n*z}eG)Bi_T)g~#y%7c)n^qe~FO I#`b?E0HnPSxBvhE diff --git a/tests/data/acpi/pc/DSDT.cphp b/tests/data/acpi/pc/DSDT.cphp index cb9fc3c524f238f90d9d84d795061fe78a21a6dd..dbc0141b2bbc77a6d806ff046dc137992c59a899 100644 GIT binary patch delta 47 zcmZp%{Aa=C66_LEC&R$Nm_Ly#Rlz}eG)Bi_T)g~#y%7xTv6@6rH4 C+zs0R delta 53 zcmexo(PGKv66_MvBE!JIs5g--RnCDUKG-Qfy2*n*z}eG)Bi_T)g~#y%7c)n^qe~FO I#`f>h0Ep2J+W-In diff --git a/tests/data/acpi/pc/DSDT.dimmpxm b/tests/data/acpi/pc/DSDT.dimmpxm index 3fcb0a22a3d074ce3e6e6d12eed95d174876ff99..1294f655d418dbdccc095e0d47ab220869a61a07 100644 GIT binary patch delta 47 zcmZ4Gw8V+aCDz}eG)Bi_T)g~#y%7xTv6Z;}8x CbPbyT delta 53 zcmexs(rn7*66_MvEXBaU_-`Uts+XhPg33dtLg`;OuF@5%1yY!sB>>i+N*j6Au6f CvkU70 delta 53 zcmeB_>X+hj33dtL=Vf4Ed^?dVRnCDUKG-Qfy2*n*z}eG)Bi_T)g~#y%7c)n^qe~FO I#`Y#20Bj-+>i_@% diff --git a/tests/data/acpi/pc/DSDT.ipmikcs b/tests/data/acpi/pc/DSDT.ipmikcs index b0e0922f5e38f01b9eed33d6b7c7d60f81850a20..0a891baf458abee4a772ffba7a31914ec22418ec 100644 GIT binary patch delta 47 zcmexk`puNfCDgR0%Kk_+Y2_=q4xj0B27Fj(87G7aqq8T+ADL%j5xQ Cj}CeO delta 53 zcmexs-|WEU66_MftiZs)xO*a3s+j2R5=HZ_+Y2_=q3;L0B27Fj(87G7aqq8T+AHtjxIqA J8{20}0swe^4m$t< diff --git a/tests/data/acpi/pc/DSDT.numamem b/tests/data/acpi/pc/DSDT.numamem index 36bf83259ed7d3cb51e426d83663421ede24d998..9fc731d3d2bcde5e2612a8ccd81e12098134afe9 100644 GIT binary patch delta 47 zcmdmGy2X^sCDsS;l7@xe~<(M?Y50nVNV9Pu8WEPi6s DOtTGd delta 53 zcmdmDy33TyCDkoZvX%Q diff --git a/tests/data/acpi/pc/DSDT.roothp b/tests/data/acpi/pc/DSDT.roothp index ca44cca6a3e46777e1e3433512dfd101c1c7bb8b..e654c83ebe40c413b204c711adcefe3f04655e8c 100644 GIT binary patch delta 47 zcmZn-{vX8U66_LEugSo`IDH~ls)QGNe6Uk|bdwW%fU~CoN4$rp3y#5>7&ehBRnCDUKG-Qfy2*n*z}eG)Bi_T)g~#y%7c)n^qe~FO I#`Yf?0Gt;ORR910 diff --git a/tests/data/acpi/q35/DSDT b/tests/data/acpi/q35/DSDT index 720e8cbbbb10d86a458027b5cb47884bf8c5ee78..fb89ae0ac6d4346e33156e9e4d3718698a0a1a8e 100644 GIT binary patch delta 57 zcmZ4KxY&`)CDu1FqxnRxR3&fW_+Y2_=q6A80B27Fj(87G7aqq8TpS$n&JY&! I#_2)|0LDuXT>t<8 delta 63 zcmZ4NxYCi!CD3$@xe~<(M_KG0nVNV9Pu8WEz>% delta 63 zcmdnuxXY2tCD3$@xe~<(M_KG0nVNV9Pu8WE;M1& delta 63 zcmccMea)N8CD3$@xe~<(M_KG0nVNV9Pu8WEWdmxs}CDz>% delta 63 zcmX>Qdn}gACDvTIqtHaIR1HUw_+Y2_=q7*u0B27Fj(87G7aqq8TpS$n&JY$e ON4%p;5W~ia`g#CDJrO|w diff --git a/tests/data/acpi/q35/DSDT.core-count2 b/tests/data/acpi/q35/DSDT.core-count2 index 2ec11fe3c36d635080af05afa32852fcc1bf10be..b47891ec10be131a59bf404242241c054ac902f8 100644 GIT binary patch delta 59 zcmezRm+}2yMlP3Nmyq{$3=E7x6S-2AyoKX~o#LaLJoy8hJqNAOs*<;Ge6Uk|bdx84fU~CoN4$rp3y`WA;R@R3&fW_+Y2_=q6A80B27Fj(87G7aqq8TpS$n&JY&! I#_6#N0RDXty#N3J delta 63 zcmaFo_{EXSCD3$@xe~<(M_KG0nVNV9Pu8WEz>% delta 63 zcmdnuxXY2tCD@~ delta 63 zcmez5{llBfCDE%>V!Z delta 63 zcmeD6n(W2p66_KptjfT^xOgI0s)nOTe6Uk|bdx`SfU~CoN4$rp3yi_@% delta 63 zcmbR0Fx!F4CDwR}kv} diff --git a/tests/data/acpi/q35/DSDT.numamem b/tests/data/acpi/q35/DSDT.numamem index 0cdec0b4c53b2b0e38cd019caab552f66f7728e7..ba6669437e65952f24516ded954b33fe54bdedfb 100644 GIT binary patch delta 57 zcmZ4QxYCi!CD3$@xe~<(M_KG0nVNV9Pu8WEOV delta 63 zcmZ4KxZaV=CDTu$633dtLP-I|Wd^wRTRmod8KG-Qfy2+D2z}eG)Bi_T)g~#y%7Y9eYGla#w IaeBD|0KB*lrT_o{ delta 63 zcmeBh>T}|933dtLQ)FOZTrrU=Rl`vvKG-Qfy2+nEz}eG)Bi_T)g~#y%7Y9eYGla#= O5%1^{#ISKw1;OuF@5%1yY!sB>>i-RNH8Ny=T IIK4m#0Hll$6aWAK delta 63 zcmZp4Yj@*v33dr#S7u;fRGY|^s^KUSAM6w#-Q>?7;OuF@5%1yY!sB>>i-RNH8Ny=b Oh<9`eV%RvbKnVcyZ4eXy diff --git a/tests/data/acpi/q35/DSDT.tis.tpm2 b/tests/data/acpi/q35/DSDT.tis.tpm2 index 35c6b08068d4d2fb0353802dc2460cc2912c129c..a09253042ce4a715922027245de8a2ab7449c5b7 100644 GIT binary patch delta 57 zcmZ4JHrtKMCDmvh{B HPeBC$z1a|1 delta 48 zcmez2`OlNfCD9P!Q& K7W2mGU%LPi*b*cF delta 65 zcmZph&eSuViOVI}C8VdDfq`+&M6Of~N0Inor}*e5fBpbxPXms44^I~!#|vB>9P!Q& Q7Bfe@qe~FO#))6M0BnU5Bme*a diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 8911b10650..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,38 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT", -"tests/data/acpi/pc/DSDT.acpierst", -"tests/data/acpi/pc/DSDT.acpihmat", -"tests/data/acpi/pc/DSDT.bridge", -"tests/data/acpi/pc/DSDT.cphp", -"tests/data/acpi/pc/DSDT.dimmpxm", -"tests/data/acpi/pc/DSDT.hpbridge", -"tests/data/acpi/pc/DSDT.hpbrroot", -"tests/data/acpi/pc/DSDT.ipmikcs", -"tests/data/acpi/pc/DSDT.memhp", -"tests/data/acpi/pc/DSDT.nohpet", -"tests/data/acpi/pc/DSDT.numamem", -"tests/data/acpi/pc/DSDT.roothp", -"tests/data/acpi/q35/DSDT", -"tests/data/acpi/q35/DSDT.acpierst", -"tests/data/acpi/q35/DSDT.acpihmat", -"tests/data/acpi/q35/DSDT.acpihmat-noinitiator", -"tests/data/acpi/q35/DSDT.applesmc", -"tests/data/acpi/q35/DSDT.bridge", -"tests/data/acpi/q35/DSDT.core-count2", -"tests/data/acpi/q35/DSDT.cphp", -"tests/data/acpi/q35/DSDT.cxl", -"tests/data/acpi/q35/DSDT.dimmpxm", -"tests/data/acpi/q35/DSDT.ipmibt", -"tests/data/acpi/q35/DSDT.ipmismbus", -"tests/data/acpi/q35/DSDT.ivrs", -"tests/data/acpi/q35/DSDT.memhp", -"tests/data/acpi/q35/DSDT.mmio64", -"tests/data/acpi/q35/DSDT.multi-bridge", -"tests/data/acpi/q35/DSDT.noacpihp", -"tests/data/acpi/q35/DSDT.nohpet", -"tests/data/acpi/q35/DSDT.numamem", -"tests/data/acpi/q35/DSDT.pvpanic-isa", -"tests/data/acpi/q35/DSDT.tis.tpm12", -"tests/data/acpi/q35/DSDT.tis.tpm2", -"tests/data/acpi/q35/DSDT.viot", -"tests/data/acpi/q35/DSDT.xapic", From patchwork Thu Aug 3 22:21:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816695 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A4YD2Koy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Hj4FJ3z1ybS for ; Fri, 4 Aug 2023 08:22:25 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghF-0004PN-J0; Thu, 03 Aug 2023 18:21:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghE-0004PE-9u for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghC-0000VA-QP for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101286; 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=7p2D4s0LesrJ/eATvXaVZ3Ta+r1WEUNem6KlZDsO1yk=; b=A4YD2KoyVSDRO/CqvmOMjxI6M79HVVfmbXcZah5hDsV+eF3IQQC94muJhXVPSXg0fJKbgD rJ05WX6xxMl3xCrNSVJNfiHZdqJy9hMkDb9yFNiprUvz2A3BcCCxCz9/hvvtO7cOm4Chwe 1xR1lQWfkAXsm+pquc2gK2dwp5K3caM= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-oKHp57rbM76gn2gjYJj-Ow-1; Thu, 03 Aug 2023 18:21:24 -0400 X-MC-Unique: oKHp57rbM76gn2gjYJj-Ow-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-99388334de6so131899666b.0 for ; Thu, 03 Aug 2023 15:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101283; x=1691706083; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7p2D4s0LesrJ/eATvXaVZ3Ta+r1WEUNem6KlZDsO1yk=; b=kqsd1p6yth1cHhBGv2CB5c35KsIDlLBzfvDco5d+7EyXiTYexuBiW1YE123LBCOJfg zmqUdNr7VfnGEjz6PPjYYOefPq4Bjm4OusPQ8epGNIorkRqj06FMFEIfjxE73Hluxqqp jELhKUvML6gm9I/fU/SQXot18+jrrerwcxK+QMG1ML4b41MX08hVl8YKuCrNQ+sJDc61 3N/IjeYZ8PoYNtL2SAOTYz9/xIkyKoSgKPxXtJ9GCwdqxxxENvj2Yd3vDuVdpDC+TDvA Vagszkd+nK1RLctX4Y2Pw21xQKhPDAV/HR6DfHZMbwcLdTxAsCCjTAYt1Mh2YXCp4/KZ NWZw== X-Gm-Message-State: ABy/qLalH3d/b+BnE7lSqzomtFAbJlX30Rx9pDkZqsQ1gR1lx9aHZjmf +XVnNQkw72EKO2iSyP2CuLmybUNMWFQPfmECDA3v4XT0VjMTCDQW1aZOIZT6k1SQq9fsnJGIXDD Fq1qtysVxcaTZXvwBTugus2svB0RLzcUn83CfvZU/ui+NOna7L+sXf7TuM9AELiCPbEze X-Received: by 2002:a17:906:74cb:b0:994:8e9:67fe with SMTP id z11-20020a17090674cb00b0099408e967femr7990821ejl.35.1691101282866; Thu, 03 Aug 2023 15:21:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHZWRVBC/4OthngQqFpzmDJa5NmB/lZ7UdnyoBRfTJ9RfXXeJNysTJucplaIfYsV2ZD/r72Cw== X-Received: by 2002:a17:906:74cb:b0:994:8e9:67fe with SMTP id z11-20020a17090674cb00b0099408e967femr7990812ejl.35.1691101282677; Thu, 03 Aug 2023 15:21:22 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id la1-20020a170906ad8100b0099b5a71b0bfsm375530ejb.94.2023.08.03.15.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:22 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:19 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , David Edmondson , Philippe =?utf-8?q?Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PULL 11/22] hw/virtio: qmp: add RING_RESET to 'info virtio-status' Message-ID: <92f04221379ae5e35f6474c2afed2eb02d552df3.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: David Edmondson Signed-off-by: David Edmondson Message-Id: <20230721072820.75797-1-david.edmondson@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- hw/virtio/virtio-qmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index 3d32dbec8d..7515b0947b 100644 --- a/hw/virtio/virtio-qmp.c +++ b/hw/virtio/virtio-qmp.c @@ -79,6 +79,8 @@ static const qmp_virtio_feature_map_t virtio_transport_map[] = { "VIRTIO_F_ORDER_PLATFORM: Memory accesses ordered by platform"), FEATURE_ENTRY(VIRTIO_F_SR_IOV, \ "VIRTIO_F_SR_IOV: Device supports single root I/O virtualization"), + FEATURE_ENTRY(VIRTIO_F_RING_RESET, \ + "VIRTIO_F_RING_RESET: Driver can reset a queue individually"), /* Virtio ring transport features */ FEATURE_ENTRY(VIRTIO_RING_F_INDIRECT_DESC, \ "VIRTIO_RING_F_INDIRECT_DESC: Indirect descriptors supported"), From patchwork Thu Aug 3 22:21:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816704 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MKxtd5E3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3K72dxfz1ybS for ; Fri, 4 Aug 2023 08:23:39 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghI-0004Q8-Qr; Thu, 03 Aug 2023 18:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghG-0004Pg-Ts for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghF-0000Va-CT for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101288; 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: in-reply-to:in-reply-to:references:references; bh=HIYdHtiBYjd2FsFQPPoQ8yirjasX+58jJpzdJ4zKBQE=; b=MKxtd5E3TfxLrKvkSa2oYu3/v+2wX+1pFK0hRkOVeq20CH3HinFpEgNGhm00Bk/hyHU3c3 OpsNs8njt0LNXxXcVrBfTMbpjFAHHdxkNuBoQFsExEmdkF3he3tVOMjyA0CQX7FE81ovM9 HP71y7KW5Uf5QbkY6Vq8qJYJtuBsbSw= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-SrI1rp7XMD-ZEJa5hzKvdA-1; Thu, 03 Aug 2023 18:21:27 -0400 X-MC-Unique: SrI1rp7XMD-ZEJa5hzKvdA-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2b9fa64dba8so13893561fa.0 for ; Thu, 03 Aug 2023 15:21:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101286; x=1691706086; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HIYdHtiBYjd2FsFQPPoQ8yirjasX+58jJpzdJ4zKBQE=; b=h2SyebTqpHUHgSQdoCp+qrIV3RfMAjwHxZPlj4yNr0PALJd4brjgdIHGaS94nbCmMm 2UUfNrYvIphYZKwFyENo2VeqAhXcf+kZExN0+GoU48ChJuggW4PSfC15pZTuCGjZhZLP p2dnYc4N0gdwNaJNjLHQDX2gRhWtBZgZ9iVOfNRrjgkbF9n+6mZIdWpJIsQO3VfTwI41 zHJWezb2tOZJb8HFBDq8FRCzJneu0UoECDM4vlBT15QSRW1gFx/2TfxpNr4QSVrI6OPK PvjsFJAnBuwWClZ2WUFJc9jjtbJNj0nKSYnANx0wGqyrkNbVobgxIaSg1EwegNaVdrE3 1J0g== X-Gm-Message-State: AOJu0YzAxKh2cE2Q69JO5SwSvi5pPZ8mxNTnS2c8sOsdzNkVfMJSLomv H+HrmkFyr1Th3xVH6zRN3BdOY+zDXQRU/zhS3WTDJyH4/lIaei9qov3oSNEgPh1Oa7MPsbMyhhu WejkVlpO8ovplo70qVx0htOZiANpaLLGmW1C9jARQ6rHCm6aq7zXV/kMhL7gCXaiJaDjO X-Received: by 2002:a2e:b617:0:b0:2b9:ea6b:64f with SMTP id r23-20020a2eb617000000b002b9ea6b064fmr76580ljn.37.1691101285795; Thu, 03 Aug 2023 15:21:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbmUQ7fU5RzQxo3+v1YjTtMVJK6sQAUiDC/ZJeGk9zFe0eSWKZtC2QkHHygyaEr/LvfbsNjg== X-Received: by 2002:a2e:b617:0:b0:2b9:ea6b:64f with SMTP id r23-20020a2eb617000000b002b9ea6b064fmr76569ljn.37.1691101285504; Thu, 03 Aug 2023 15:21:25 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id re8-20020a170906d8c800b00992076f4a01sm369306ejb.190.2023.08.03.15.21.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:25 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:22 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Hanna Czenczek , German Maglione Subject: [PULL 12/22] virtio: Fix packed virtqueue used_idx mask Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Hanna Czenczek virtio_queue_packed_set_last_avail_idx() is used by vhost devices to set the internal queue indices to what has been reported by the vhost back-end through GET_VRING_BASE. For packed virtqueues, this 32-bit value is expected to contain both the device's internal avail and used indices, as well as their respective wrap counters. To get the used index, we shift the 32-bit value right by 16, and then apply a mask of 0x7ffff. That seems to be a typo, because it should be 0x7fff; first of all, the virtio specification says that the maximum queue size for packed virt queues is 2^15, so the indices cannot exceed 2^15 - 1 anyway, making 0x7fff the correct mask. Second, the mask clearly is wrong from context, too, given that (A) `idx & 0x70000` must be 0 at this point (`idx` is 32 bit and was shifted to the right by 16 already), (B) `idx & 0x8000` is the used_wrap_counter, so should not be part of the used index, and (C) `vq->used_idx` is a `uint16_t`, so cannot fit the 0x70000 part of the mask anyway. This most likely never produced any guest-visible bugs, though, because for a vhost device, qemu will probably not evaluate the used index outside of virtio_queue_packed_get_last_avail_idx(), where we reconstruct the 32-bit value from avail and used indices and their wrap counters again. There, it does not matter whether the highest bit of the used_idx is the used index wrap counter, because we put the wrap counter exactly in that position anyway. Signed-off-by: Hanna Czenczek Message-Id: <20230721134945.26967-1-hreitz@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: German Maglione --- hw/virtio/virtio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 295a603e58..309038fd46 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -3321,7 +3321,7 @@ static void virtio_queue_packed_set_last_avail_idx(VirtIODevice *vdev, vq->last_avail_wrap_counter = vq->shadow_avail_wrap_counter = !!(idx & 0x8000); idx >>= 16; - vq->used_idx = idx & 0x7ffff; + vq->used_idx = idx & 0x7fff; vq->used_wrap_counter = !!(idx & 0x8000); } From patchwork Thu Aug 3 22:21:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816703 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=QVVQ92be; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3K44mwFz1ybS for ; Fri, 4 Aug 2023 08:23:36 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghL-0004QH-4L; Thu, 03 Aug 2023 18:21:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghJ-0004Q9-UP for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghI-0000W9-9W for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101291; 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: in-reply-to:in-reply-to:references:references; bh=6g7+lXqfDr0/pfU4duCWQ/Wn2r290XtxIMj1iKGKlcg=; b=QVVQ92beyqGFsHBxBbrSYeAicaYWhGS3ywPCq3uGJjB5l94r5tutvbqL3Md4Voe0H7nMtF EN3pOVpo+PILP7lF8uU6Vr7ywzX673sKWL/3zlDHij8+7pEEsU42gQhwyYz9BtTOay5Q17 eGefpQW2f+NSQ6ytgnW8mYw2SQ6sbEA= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203--DJ4FrcENBWFm2Tel11N8g-1; Thu, 03 Aug 2023 18:21:30 -0400 X-MC-Unique: -DJ4FrcENBWFm2Tel11N8g-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-51bef8bb689so3138221a12.1 for ; Thu, 03 Aug 2023 15:21:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101289; x=1691706089; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6g7+lXqfDr0/pfU4duCWQ/Wn2r290XtxIMj1iKGKlcg=; b=X5UH3jGk+Brvnju7Psdt2wdxYlAFvU+6dIKX7kwlZkKKvmHCQ0UDiRo8YAkvo9cQ6M Dff4yMBqxL6ZF9OsPutvhqq/jbP+H6oQAJXiueL5dznz0qtZ+TcHPDV85XNHtPAGW4d1 OswjBDvEBswoWrNjiHXx+H+QW4bKgdVUz4DvLi+YMHmjvkEGm1APcr7niu84nm4H72w0 CxUapE/Xc1g+V3zeaLzqCxlwxmfczV5hjgxjfIq0g47lg8nhDvsgqkd3BPbW/Db26oon nROjyAQMnqzIGmlmW/ss+N+jCVMGejXB2DbDZr92nk+yRhbzDGANy/2CvcQztPxP7IPc mxxA== X-Gm-Message-State: AOJu0Yy3AYdurARDVILhlFg9KPWZ+EgtZoTdb7CvjT/ucQyVvmkC8Fn5 vLtoU0VET23N5vf4s7/sxBGrA7QwfpG9Rb1mxWXJzWPuy/HkRp1lC3iMqOajV4odbkxMG8PEsMj QBaRyBztjhYD8ps4aXKaHIY72L1+VbJoKA5bjRNoEcpC3zAM2CUl2ySCh8n3YwK2Bcta+ X-Received: by 2002:a05:6402:42cb:b0:522:aad4:aae0 with SMTP id i11-20020a05640242cb00b00522aad4aae0mr52763edc.3.1691101289030; Thu, 03 Aug 2023 15:21:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGEBCb6m5wy78ttOOPndlAwBSVtcMAi2wTyHTxsrbOeyjpvvRSb1OYQn69OfdMKgzGMCEF/pA== X-Received: by 2002:a05:6402:42cb:b0:522:aad4:aae0 with SMTP id i11-20020a05640242cb00b00522aad4aae0mr52753edc.3.1691101288823; Thu, 03 Aug 2023 15:21:28 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id u4-20020a05640207c400b0051d9ee1c9d3sm352621edy.84.2023.08.03.15.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:28 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:26 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Yuri Benditovich , Marcel Apfelbaum Subject: [PULL 13/22] pci: do not respond config requests after PCI device eject Message-ID: <348e354417b64c484877354ee7cc66f29fa6c7df.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Yuri Benditovich Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2224964 In migration with VF failover, Windows guest and ACPI hot unplug we do not need to satisfy config requests, otherwise the guest immediately detects the device and brings up its driver. Many network VF's are stuck on the guest PCI bus after the migration. Signed-off-by: Yuri Benditovich Message-Id: <20230728084049.191454-1-yuri.benditovich@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/pci_host.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 7af8afdcbe..a18aa0a8d4 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -62,6 +62,17 @@ static void pci_adjust_config_limit(PCIBus *bus, uint32_t *limit) } } +static bool is_pci_dev_ejected(PCIDevice *pci_dev) +{ + /* + * device unplug was requested and the guest acked it, + * so we stop responding config accesses even if the + * device is not deleted (failover flow) + */ + return pci_dev && pci_dev->partially_hotplugged && + !pci_dev->qdev.pending_deleted_event; +} + void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, uint32_t limit, uint32_t val, uint32_t len) { @@ -75,7 +86,7 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, * allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0(pci_dev)) || - !pci_dev->has_power) { + !pci_dev->has_power || is_pci_dev_ejected(pci_dev)) { return; } @@ -100,7 +111,7 @@ uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr, * allowing direct removal of unexposed functions. */ if ((pci_dev->qdev.hotplugged && !pci_get_function_0(pci_dev)) || - !pci_dev->has_power) { + !pci_dev->has_power || is_pci_dev_ejected(pci_dev)) { return ~0x0; } From patchwork Thu Aug 3 22:21:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816699 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PH+NFJlw; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3JJ600pz1ybS for ; Fri, 4 Aug 2023 08:22:56 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghO-0004SJ-Ca; Thu, 03 Aug 2023 18:21:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghN-0004QZ-Cc for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghL-0000Wi-VP for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101295; 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: in-reply-to:in-reply-to:references:references; bh=jRsCclF9+O5GiFeLNLzg/MH5MtZPWdKpgBgSE0YMB44=; b=PH+NFJlwB8GySOzBtD5bRyXn15k1WQMTz9Um9NZiVm/98Jt5SBY7Qd4inxKJQpEmZaTrSc J3wmIIRMCncDs0yKhv8o1nXvlY6mA4d+TnIV4XtSVyrGZyWnehFmxwHcS4axcmX5Acmeui i0oAjexFo+hyjCV8M9H1XNhieGJWDOg= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-HzGIhpV1OWSwbvC3hoB6Pg-1; Thu, 03 Aug 2023 18:21:34 -0400 X-MC-Unique: HzGIhpV1OWSwbvC3hoB6Pg-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2b8405aace3so14609081fa.3 for ; Thu, 03 Aug 2023 15:21:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101292; x=1691706092; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jRsCclF9+O5GiFeLNLzg/MH5MtZPWdKpgBgSE0YMB44=; b=CyV6q6E6hyUmpJ50zlFifSEoWx1sc7x1OYRYyM/XnL65KNqQWSf4fGOVPqrRLeP6cL CNnIIVqyh9E2zPzzlM4UPFF6pE2gSc5rfUbjHJngECk1Ji50VXT9mYN56bL1zUGFqajS XlNnMjmWk/nY6q6keVBxPEq0+vYX/kaAq8a5WC2EsMl5glU0vkQu8qB4234hw8xbVPBV 9Ub6pESCMooSuQ45AfED7DB9wsgK1L7uiI7gnHIJfoFJ4bwIaSxNqLODtAHucyi3tuzd f+BLAjye22bU5eQX1I/0G8qsJkWEfyFLBX5jBnWoRCAP44IkRqRSe3UZUq735+sOUJjs rRfQ== X-Gm-Message-State: AOJu0YxSCwmGUH/8M4Fb55eQG9edXxxQ1RSaTul6ySsRkCf45D7ISSJK rFbbA94PruDVI+fyUt0vowhOKpMCh7fhF6MNBUHPRJ0+3pq0crzP4dN2FsZzhp/91qQyDDMSxmR U8T3bHT8HjeNJOcpDFEikTodUjN5vQi3xEFUJZUkP9ZLgqE8V4lU3/3MsQBfk1+BBOKR3 X-Received: by 2002:a2e:861a:0:b0:2b9:c864:9e3f with SMTP id a26-20020a2e861a000000b002b9c8649e3fmr93217lji.39.1691101292207; Thu, 03 Aug 2023 15:21:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFskJOhYGL9yVUrXR4v1cnqDYClU8g8Osoo1pleAwE5yMVRz1pxazAPkRNR8uQFYVSlLkozIQ== X-Received: by 2002:a2e:861a:0:b0:2b9:c864:9e3f with SMTP id a26-20020a2e861a000000b002b9c8649e3fmr93202lji.39.1691101291943; Thu, 03 Aug 2023 15:21:31 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id l9-20020a17090612c900b009932337747esm376457ejb.86.2023.08.03.15.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:31 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:29 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Li Feng , Raphael Norwitz , Fiona Ebner Subject: [PULL 14/22] vhost: fix the fd leak Message-ID: <18f2971ce403008d5e1c2875b483c9d1778143dc.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Li Feng When the vhost-user reconnect to the backend, the notifer should be cleanup. Otherwise, the fd resource will be exhausted. Fixes: f9a09ca3ea ("vhost: add support for configure interrupt") Signed-off-by: Li Feng Reviewed-by: Raphael Norwitz Message-Id: <20230731121018.2856310-2-fengli@smartx.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Fiona Ebner --- hw/virtio/vhost.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index abf0d03c8d..e2f6ffb446 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -2044,6 +2044,8 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) event_notifier_test_and_clear( &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); event_notifier_test_and_clear(&vdev->config_notifier); + event_notifier_cleanup( + &hdev->vqs[VHOST_QUEUE_NUM_CONFIG_INR].masked_config_notifier); trace_vhost_dev_stop(hdev, vdev->name, vrings); From patchwork Thu Aug 3 22:21:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=X4X1/FIc; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HW3Jvmz1ybS for ; Fri, 4 Aug 2023 08:22:15 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghS-0004Sx-M9; Thu, 03 Aug 2023 18:21:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghR-0004Sf-47 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghP-0000XQ-Kr for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101299; 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=TVuqOt0marpKSqE9sEGY+DQ7kMdO14FEtpwntaCFVNY=; b=X4X1/FIcs7HoPVyVrG6joIffIpLabNHXVVConN03UdbigfgaZVYIbZbZuse1YcsgpIbuR/ rv37N44mhJBXOix9WGLo55e6k1+YHSk3gn6zW6Dx4wUrGmALWE5Si+EnjirHSSPIzRx3HV RpspeS/bJamyGIq/vxGetF0M9+12TtA= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-61-z4MnU7vkMWS9O-8xq5mnhg-1; Thu, 03 Aug 2023 18:21:37 -0400 X-MC-Unique: z4MnU7vkMWS9O-8xq5mnhg-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-51d8823eb01so864173a12.1 for ; Thu, 03 Aug 2023 15:21:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101296; x=1691706096; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TVuqOt0marpKSqE9sEGY+DQ7kMdO14FEtpwntaCFVNY=; b=WIKNa5H3QNiarJZNmSHYS54fvYmFC72egfPP+dFBxzuBB7KEiZ4+dRKRHibl9N4bDn kj0RBA2jHrW+JC09j7Da8+v/SesQYAHm8JF2qG3GVpwOAXTWIlESdXJ0av0A6AoVCM+5 rYQ8ITaqjcwxGVT3jnt2oeve3LGMjDG9cFYESFXzlaDZ9HDy9BxenU8T+yyBYSmZbRO8 cuJ4MwAVNvL2oJezpfkHQlkf7MzO2usOOCcdS960P9gjyBpvkj9uxZss/YuVmmP57L6F lwrsn5nZj3bMIzlyhDk3RvDogGgX8KgprW0Upx4Lsy711jUFIph9UwaSRGlvpLGYoxt/ rYFg== X-Gm-Message-State: AOJu0YzH+APMtVdtKuvKwm4pu5n6Kl7ud386oK+yzrHu+I9/R8iTWigy Z/f9oHLJ46l/iMcR65WkSM1AKnSIn3ovsfuDQK4iWzwkVEhFB6cSQLKl0ftOS5nABvadaWCl906 YdayoDBbOB5rlw5aHDh0t8h1wBluK5uzko0UzK9nTh8kFtixLNvGpAi07EnDJTqruaEHe X-Received: by 2002:a50:ee90:0:b0:522:203d:c9b1 with SMTP id f16-20020a50ee90000000b00522203dc9b1mr98592edr.11.1691101296455; Thu, 03 Aug 2023 15:21:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGU74j3MbAzUnyPB9qtD7vu2ksShX3aXjezzp6G7rMTcVM03zf54oUtFU0PK8trs7WnvFP94Q== X-Received: by 2002:a50:ee90:0:b0:522:203d:c9b1 with SMTP id f16-20020a50ee90000000b00522203dc9b1mr98575edr.11.1691101296216; Thu, 03 Aug 2023 15:21:36 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id m13-20020aa7c2cd000000b0051df54c6a27sm355860edp.56.2023.08.03.15.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:35 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:32 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Peter Xu , Jason Wang , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Michael Tokarev , Laurent Vivier , qemu-trivial@nongnu.org Subject: [PULL 15/22] hw/i386/intel_iommu: Fix trivial endianness problems Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth After reading the guest memory with dma_memory_read(), we have to make sure that we byteswap the little endian data to the host's byte order. Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-2-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu --- hw/i386/intel_iommu.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index dcc334060c..13fcde8e91 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -756,6 +756,8 @@ static int vtd_get_pdire_from_pdir_table(dma_addr_t pasid_dir_base, return -VTD_FR_PASID_TABLE_INV; } + pdire->val = le64_to_cpu(pdire->val); + return 0; } @@ -780,6 +782,9 @@ static int vtd_get_pe_in_pasid_leaf_table(IntelIOMMUState *s, pe, entry_size, MEMTXATTRS_UNSPECIFIED)) { return -VTD_FR_PASID_TABLE_INV; } + for (size_t i = 0; i < ARRAY_SIZE(pe->val); i++) { + pe->val[i] = le64_to_cpu(pe->val[i]); + } /* Do translation type check */ if (!vtd_pe_type_check(x86_iommu, pe)) { From patchwork Thu Aug 3 22:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RztnKXn3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HP5kfYz1ybS for ; Fri, 4 Aug 2023 08:22:09 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghV-0004UQ-Ur; Thu, 03 Aug 2023 18:21:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghV-0004U3-3J for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghT-0000YW-8w for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101302; 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: in-reply-to:in-reply-to:references:references; bh=aDw+xuFXwgPlXVT00FhXsKo7gpeTtfswMTTY64LM71Q=; b=RztnKXn3isATuRbxeSCUkZ23bDISrLSkwm5mcIiIWNYwO7BB/+TtdDxlAfYyabvOkjA22Z +6jm8TQzNNAK1CHSoGUarof4mZJ6JoCVZ7bruhcHpLGb3NM9O3WPjnhiY5G8gVYFDOJXJX +MCYglhDA9IPyvos9B2qgtoN1lLjVl0= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-691-UJSc9T_OPJeHKzjjUr885Q-1; Thu, 03 Aug 2023 18:21:41 -0400 X-MC-Unique: UJSc9T_OPJeHKzjjUr885Q-1 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-522abbc863fso960869a12.0 for ; Thu, 03 Aug 2023 15:21:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101300; x=1691706100; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=aDw+xuFXwgPlXVT00FhXsKo7gpeTtfswMTTY64LM71Q=; b=AYXt1vS6SkF9ROI9FWfdaEva2GgZZZhhKi/MlTBecIikSdpgo+jP66pWoTStwJEnnr 554oeS3kP7NEXNtZmth68CcsJrUMZciT+Ui53NhSu5DENeNGaGx3Kw1tdRDK2S4PtU/O bbmQyIC4eWw5EPjTgDqw3Mplco5dDu4qDfaVFh8yL5WGFS8jUeKBxl+0a4GTWy1W3qdU XRB2MWvb6Et4BvkESVaLn6omTSk/TINk0QQgOQpsb8XiTlsT2xUEzp4VReZ7jPv4w1r5 kVJTs2af3LliTomtfNR22ekJMgInCChtSgFxZ6EiEmgGii84b89QvvLgCNUor7U0StqO R86g== X-Gm-Message-State: AOJu0YzZEmgQQAXQMIylL4NHQKpM+WyXYpQ+3Oop4G32tdeigqjMLkg0 XrUj3WRjgDiEqLKsHLFnGckKPOO+BJXHwZcGU6mY+m+nIbuFJ/8KH6Zq2MK4ly4TYcpS1jMiLF2 1gwff2MmJ7yJSi9KVyb7ZcaaHs7fzJWLYSOHhKEvtZ3w5k1L1R9XSRDKyBDW/rCK+F3s5 X-Received: by 2002:aa7:dc12:0:b0:522:cb97:f198 with SMTP id b18-20020aa7dc12000000b00522cb97f198mr77406edu.38.1691101299995; Thu, 03 Aug 2023 15:21:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXo4iTsPyeaMetia1z6TwV2wS9TAA2HLeQaJQ1gSmg5J46O5RkbikDfGT1A3ihVrOwJdo2dQ== X-Received: by 2002:aa7:dc12:0:b0:522:cb97:f198 with SMTP id b18-20020aa7dc12000000b00522cb97f198mr77393edu.38.1691101299785; Thu, 03 Aug 2023 15:21:39 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id p12-20020aa7d30c000000b00522ce914f51sm348389edq.67.2023.08.03.15.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:39 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:36 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Peter Xu , Jason Wang , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 16/22] hw/i386/intel_iommu: Fix endianness problems related to VTD_IR_TableEntry Message-ID: <642ba89672279fbdd14016a90da239c85e845d18.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The code already tries to do some endianness handling here, but currently fails badly: - While it already swaps the data when logging errors / tracing, it fails to byteswap the value before e.g. accessing entry->irte.present - entry->irte.source_id is swapped with le32_to_cpu(), though this is a 16-bit value - The whole union is apparently supposed to be swapped via the 64-bit data[2] array, but the struct is a mixture between 32 bit values (the first 8 bytes) and 64 bit values (the second 8 bytes), so this cannot work as expected. Fix it by converting the struct to two proper 64-bit bitfields, and by swapping the values only once for everybody right after reading the data from memory. Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-3-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Xu --- include/hw/i386/intel_iommu.h | 50 ++++++++++++++++++----------------- hw/i386/intel_iommu.c | 16 +++++------ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index 89dcbc5e1e..7fa0a695c8 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -178,37 +178,39 @@ enum { union VTD_IR_TableEntry { struct { #if HOST_BIG_ENDIAN - uint32_t __reserved_1:8; /* Reserved 1 */ - uint32_t vector:8; /* Interrupt Vector */ - uint32_t irte_mode:1; /* IRTE Mode */ - uint32_t __reserved_0:3; /* Reserved 0 */ - uint32_t __avail:4; /* Available spaces for software */ - uint32_t delivery_mode:3; /* Delivery Mode */ - uint32_t trigger_mode:1; /* Trigger Mode */ - uint32_t redir_hint:1; /* Redirection Hint */ - uint32_t dest_mode:1; /* Destination Mode */ - uint32_t fault_disable:1; /* Fault Processing Disable */ - uint32_t present:1; /* Whether entry present/available */ + uint64_t dest_id:32; /* Destination ID */ + uint64_t __reserved_1:8; /* Reserved 1 */ + uint64_t vector:8; /* Interrupt Vector */ + uint64_t irte_mode:1; /* IRTE Mode */ + uint64_t __reserved_0:3; /* Reserved 0 */ + uint64_t __avail:4; /* Available spaces for software */ + uint64_t delivery_mode:3; /* Delivery Mode */ + uint64_t trigger_mode:1; /* Trigger Mode */ + uint64_t redir_hint:1; /* Redirection Hint */ + uint64_t dest_mode:1; /* Destination Mode */ + uint64_t fault_disable:1; /* Fault Processing Disable */ + uint64_t present:1; /* Whether entry present/available */ #else - uint32_t present:1; /* Whether entry present/available */ - uint32_t fault_disable:1; /* Fault Processing Disable */ - uint32_t dest_mode:1; /* Destination Mode */ - uint32_t redir_hint:1; /* Redirection Hint */ - uint32_t trigger_mode:1; /* Trigger Mode */ - uint32_t delivery_mode:3; /* Delivery Mode */ - uint32_t __avail:4; /* Available spaces for software */ - uint32_t __reserved_0:3; /* Reserved 0 */ - uint32_t irte_mode:1; /* IRTE Mode */ - uint32_t vector:8; /* Interrupt Vector */ - uint32_t __reserved_1:8; /* Reserved 1 */ + uint64_t present:1; /* Whether entry present/available */ + uint64_t fault_disable:1; /* Fault Processing Disable */ + uint64_t dest_mode:1; /* Destination Mode */ + uint64_t redir_hint:1; /* Redirection Hint */ + uint64_t trigger_mode:1; /* Trigger Mode */ + uint64_t delivery_mode:3; /* Delivery Mode */ + uint64_t __avail:4; /* Available spaces for software */ + uint64_t __reserved_0:3; /* Reserved 0 */ + uint64_t irte_mode:1; /* IRTE Mode */ + uint64_t vector:8; /* Interrupt Vector */ + uint64_t __reserved_1:8; /* Reserved 1 */ + uint64_t dest_id:32; /* Destination ID */ #endif - uint32_t dest_id; /* Destination ID */ - uint16_t source_id; /* Source-ID */ #if HOST_BIG_ENDIAN uint64_t __reserved_2:44; /* Reserved 2 */ uint64_t sid_vtype:2; /* Source-ID Validation Type */ uint64_t sid_q:2; /* Source-ID Qualifier */ + uint64_t source_id:16; /* Source-ID */ #else + uint64_t source_id:16; /* Source-ID */ uint64_t sid_q:2; /* Source-ID Qualifier */ uint64_t sid_vtype:2; /* Source-ID Validation Type */ uint64_t __reserved_2:44; /* Reserved 2 */ diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 13fcde8e91..4028e32701 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3328,14 +3328,15 @@ static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index, return -VTD_FR_IR_ROOT_INVAL; } - trace_vtd_ir_irte_get(index, le64_to_cpu(entry->data[1]), - le64_to_cpu(entry->data[0])); + entry->data[0] = le64_to_cpu(entry->data[0]); + entry->data[1] = le64_to_cpu(entry->data[1]); + + trace_vtd_ir_irte_get(index, entry->data[1], entry->data[0]); if (!entry->irte.present) { error_report_once("%s: detected non-present IRTE " "(index=%u, high=0x%" PRIx64 ", low=0x%" PRIx64 ")", - __func__, index, le64_to_cpu(entry->data[1]), - le64_to_cpu(entry->data[0])); + __func__, index, entry->data[1], entry->data[0]); return -VTD_FR_IR_ENTRY_P; } @@ -3343,14 +3344,13 @@ static int vtd_irte_get(IntelIOMMUState *iommu, uint16_t index, entry->irte.__reserved_2) { error_report_once("%s: detected non-zero reserved IRTE " "(index=%u, high=0x%" PRIx64 ", low=0x%" PRIx64 ")", - __func__, index, le64_to_cpu(entry->data[1]), - le64_to_cpu(entry->data[0])); + __func__, index, entry->data[1], entry->data[0]); return -VTD_FR_IR_IRTE_RSVD; } if (sid != X86_IOMMU_SID_INVALID) { /* Validate IRTE SID */ - source_id = le32_to_cpu(entry->irte.source_id); + source_id = entry->irte.source_id; switch (entry->irte.sid_vtype) { case VTD_SVT_NONE: break; @@ -3404,7 +3404,7 @@ static int vtd_remap_irq_get(IntelIOMMUState *iommu, uint16_t index, irq->trigger_mode = irte.irte.trigger_mode; irq->vector = irte.irte.vector; irq->delivery_mode = irte.irte.delivery_mode; - irq->dest = le32_to_cpu(irte.irte.dest_id); + irq->dest = irte.irte.dest_id; if (!iommu->intr_eime) { #define VTD_IR_APIC_DEST_MASK (0xff00ULL) #define VTD_IR_APIC_DEST_SHIFT (8) From patchwork Thu Aug 3 22:21:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UNV19sX3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HC6r9Pz1ybS for ; Fri, 4 Aug 2023 08:21:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghZ-0004t0-G9; Thu, 03 Aug 2023 18:21:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghY-0004gu-1O for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghW-0000ZC-CZ for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101305; 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: in-reply-to:in-reply-to:references:references; bh=laQg5kxWKJ7/tyTA7x0YuEWfZWimTpJ1rnaPQY0+oxM=; b=UNV19sX3EHJQJZSCLSx7TuAsNd7nlKeGSpia2uREVNuY3XWKFKibFygJY/b77+2y/NIuBp rLSpuqUq686LuuwLnT4MhyuKrrCQlA+KomTKWE0ShAPmxuzh2P2NlgV4+LmnCGvgijsxlZ B8jPG5u3fPIxhAlHAMqPKJU199NreIw= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-0CeY6DWkO2Ga3WAjZ06Urg-1; Thu, 03 Aug 2023 18:21:44 -0400 X-MC-Unique: 0CeY6DWkO2Ga3WAjZ06Urg-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-99beea69484so93778466b.0 for ; Thu, 03 Aug 2023 15:21:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101303; x=1691706103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=laQg5kxWKJ7/tyTA7x0YuEWfZWimTpJ1rnaPQY0+oxM=; b=V+4T3ApxW7u1it0ymwn1Q/GWOHLy9XsQW7WMn42omDEzLQ5a/+o0SloU+TAJZYJUwb cJu9+i4dWNQNtzk0nG+2e/ShAkyOJUV84q9E2Fk9D5JL8JiON91vD0bFNMMWPRemg3N4 gz8AzcYvkO8Q4NB63yHzZenvA0IEZvTRHoKLFsR7RX3IhUfVZZPb9ry+r7bAcsGu2X3f X108UPNrbjNPEkLne5lVZ1r7GGHooRtkCKNuX/pWxcK7CxcdfH70XzZBvM2gxEAnGJZ4 XEinH/Nq1j6Pdmzha3x6LpzckUTq3TIy0EL/yfcA3hmCGnqg6Pgu9+0Nl08OWJ2vbplL El7A== X-Gm-Message-State: AOJu0Yw/bhLHKwwzq1o/BlYUpmFUzYLm8aq65TjBpxCku1/Am0heJy/L aTva9I3wljdVkiIWg6VWr/RJXpfuc7aDJTNlvqec71heGXPSnEeiESf92Nxm37wtO35co/5O0Ux Qf5enhiPsiXUQ1nbyh2UsSEO7El07c+AdAfFF7UulQubSlh+h89/I11lzGKi9ehBCnVgf X-Received: by 2002:a17:906:7695:b0:99b:cb78:8537 with SMTP id o21-20020a170906769500b0099bcb788537mr2049ejm.11.1691101303431; Thu, 03 Aug 2023 15:21:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqZeOSwK2HKRzlXdOxtU8LE5LYBkC9Fv48Aob8xHfdKI/+ZM+UtF2PQ/ShsGY8+PeUyOTApg== X-Received: by 2002:a17:906:7695:b0:99b:cb78:8537 with SMTP id o21-20020a170906769500b0099bcb788537mr2037ejm.11.1691101303262; Thu, 03 Aug 2023 15:21:43 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id z25-20020a170906271900b0099b4d86fbccsm376818ejc.141.2023.08.03.15.21.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:42 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Peter Xu , Jason Wang , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 17/22] hw/i386/intel_iommu: Fix struct VTDInvDescIEC on big endian hosts Message-ID: <4572b22cf9ba432fa3955686853c706a1821bbc7.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth On big endian hosts, we need to reverse the bitfield order in the struct VTDInvDescIEC, just like it is already done for the other bitfields in the various structs of the intel-iommu device. Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-4-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Xu --- hw/i386/intel_iommu_internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 2e61eec2f5..e1450c5cfe 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -321,12 +321,21 @@ typedef enum VTDFaultReason { /* Interrupt Entry Cache Invalidation Descriptor: VT-d 6.5.2.7. */ struct VTDInvDescIEC { +#if HOST_BIG_ENDIAN + uint64_t reserved_2:16; + uint64_t index:16; /* Start index to invalidate */ + uint64_t index_mask:5; /* 2^N for continuous int invalidation */ + uint64_t resved_1:22; + uint64_t granularity:1; /* If set, it's global IR invalidation */ + uint64_t type:4; /* Should always be 0x4 */ +#else uint32_t type:4; /* Should always be 0x4 */ uint32_t granularity:1; /* If set, it's global IR invalidation */ uint32_t resved_1:22; uint32_t index_mask:5; /* 2^N for continuous int invalidation */ uint32_t index:16; /* Start index to invalidate */ uint32_t reserved_2:16; +#endif }; typedef struct VTDInvDescIEC VTDInvDescIEC; From patchwork Thu Aug 3 22:21:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=h8PHxk0F; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HY5Rmwz1ybS for ; Fri, 4 Aug 2023 08:22:17 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghd-0005MQ-IL; Thu, 03 Aug 2023 18:21:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghb-00057m-Ub for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:52 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRgha-0000Zv-DL for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101309; 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=M3GPlmcjnFZlSHkWXzkRW1s0JmfHVO7cSpboUgzOa3Y=; b=h8PHxk0FBEHvVTCnrExbqMa6tgT0cHWSfOfwF+qNdTw3ajBRrs39lEHiU9/nMCkOePDXqc LArmuPzi/QMLfvE5eTSPbvJ4e97iscZrK9eyed4Z28Rwfl8YGFOPQCxaQgdIX9cUA5ThTT RQ5WMATXob9+LS5EnfLgskviy/Nnqwc= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-479-6lfav-HjP2qPQOG89QfkMQ-1; Thu, 03 Aug 2023 18:21:48 -0400 X-MC-Unique: 6lfav-HjP2qPQOG89QfkMQ-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a34d3e5ebso91692266b.3 for ; Thu, 03 Aug 2023 15:21:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101307; x=1691706107; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M3GPlmcjnFZlSHkWXzkRW1s0JmfHVO7cSpboUgzOa3Y=; b=ZCn1K2FuILbJKausZQGAGw/Br0+GT/PWy2vlnKMyVCoZ9/dEk54v5KfEtoBCbBnIK+ MVFfXB28U5pgp+VOoHn13va3vjIZBMrWn3tgyxRlwNWr9Px8IkmSboI2PR+T2JVuTGTk rm3cD8MOITb5FM2PCRkO0ieiYXbGkvvibFwi0VlJJDdT4fz0yEcDi3mYUw6pFWTBbC2D qRVGA9n0ZljldD7Pp+9+IyLxoD3AcmVBdXjYHhiCE62a2xPWhHK02cONHkTJJPxwGV1A iZdETrgpc0Ja5AjjynRJSsisOfYu5WXSTvt1+MAcp8Fa2W73gE708SDpp1ByRSdsdNEb bwRw== X-Gm-Message-State: ABy/qLZCZS+k2DQnHoVbicLp5cysECtzivXK9Vtz2Fq+cBB9Wt/Ycsly LzRV8YzvJ+gFm5lNA7FgRvUugbnSbWrBb7eIuXTh0ZPg1XFp4Ae3x1JJJViQkBSu7OMMuSm/lwC mGS0O9Vm937V7skNoPPZFoN9i8krdj3f1K5RyPAe/frRJUs1ehdhIXX4XOkU5H+zjsiWe X-Received: by 2002:a17:906:74d7:b0:991:b834:af83 with SMTP id z23-20020a17090674d700b00991b834af83mr9065365ejl.59.1691101307241; Thu, 03 Aug 2023 15:21:47 -0700 (PDT) X-Google-Smtp-Source: APBJJlH5EPDU5LAhnxkSdjn/1WT0wJF3/isCMAeHRWCvichcP3upMM0976tSooPCLBRzrJy++VrV6w== X-Received: by 2002:a17:906:74d7:b0:991:b834:af83 with SMTP id z23-20020a17090674d700b00991b834af83mr9065349ejl.59.1691101307059; Thu, 03 Aug 2023 15:21:47 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id rl2-20020a170907216200b00992e51fecfbsm379998ejb.64.2023.08.03.15.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:46 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:43 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Peter Xu , Jason Wang , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 18/22] hw/i386/intel_iommu: Fix index calculation in vtd_interrupt_remap_msi() Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The values in "addr" are populated locally in this function in host endian byte order, so we must not swap the index_l field here. Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-5-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu --- hw/i386/intel_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4028e32701..3ca71df369 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -3459,7 +3459,7 @@ static int vtd_interrupt_remap_msi(IntelIOMMUState *iommu, goto out; } - index = addr.addr.index_h << 15 | le16_to_cpu(addr.addr.index_l); + index = addr.addr.index_h << 15 | addr.addr.index_l; #define VTD_IR_MSI_DATA_SUBHANDLE (0x0000ffff) #define VTD_IR_MSI_DATA_RESERVED (0xffff0000) From patchwork Thu Aug 3 22:21:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L4A1jYJG; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3HQ0HBsz1yf5 for ; Fri, 4 Aug 2023 08:22:10 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghh-0005uw-JU; Thu, 03 Aug 2023 18:21:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghf-0005hu-Rn for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghe-0000ae-5j for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101313; 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=QMxXfvAJzOt0WNpV9VUtDC6V3YHI5GSC1EpO+HIGguo=; b=L4A1jYJG8XSR6OupXB5hanAi1PuxnZ79VC5KK580ICmyqcyQnt7S1TpzCxd6S/uPRYZmYf 242laiCP5JVTOOJN0Mtytu+ehSU85NA595F7HcO6R5EzwsRs8ap5dSXj3CsYrQ+DXKJ9Oz xlZWY5TKc188TvbwRHFy7Ijyqp/BmB8= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-153-4pW5UCMHMvONhlSFHLwO4g-1; Thu, 03 Aug 2023 18:21:52 -0400 X-MC-Unique: 4pW5UCMHMvONhlSFHLwO4g-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-98e40d91fdfso92699866b.3 for ; Thu, 03 Aug 2023 15:21:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101310; x=1691706110; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QMxXfvAJzOt0WNpV9VUtDC6V3YHI5GSC1EpO+HIGguo=; b=ZZIhwjrB+M+nveXqMiNrUOvfZbTdjeD86e6GE7SLjDPR5L1Wny6eUF4U0sXeSndc6D yyrkDFZ65VYXL8+IeePv/QtVjbJpO6jh7DjMmPUMrGYHbyTWGvGorRfEBn7QvSzxg6yC ZVK3H5sP4eywQRgmqsWCAuJGtfry8vlveQCP4Z3wukSVRG6JcsypIT9DwGElH/Pvtqh5 f1JGAwh3lA0j/Rdoh0iPKOMWmSyp5NYINo+L5Da8OIihMz2mWVmXnqhpty4CiiwBiHgt d205VfFCYds4VaJZ9ofMEp/fSGFV0L+0VbLuMGWj4gaWdUA5GaLHMgo8UjGgE13f5ul3 ykRg== X-Gm-Message-State: ABy/qLa7xBFN1izjcQt6ZvCXDDwSiRT5gvfq41n3DJNvDQ/4Om4ru+JK dAo/I+dL2pO3djjso+RDcVDrZFnGj/KHQsLw5JPSlfI5er5BATmSExNY+sBtCF7gt1NxadpWVIe FmsYgcezhKvTbuzV0YUu30TdisZXIv5LRcAJ5UV3QVfpFdwhJzAfhcvNkhA+C+i3L9X+F X-Received: by 2002:a17:907:2716:b0:98d:1f6a:fd47 with SMTP id w22-20020a170907271600b0098d1f6afd47mr8673145ejk.76.1691101310751; Thu, 03 Aug 2023 15:21:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlHmuLldzX1EJjHUX0iftmnr1cGwNbEAmSL5Tnx9QBRL46mgde7bYaSMDajlFQzGluoFPHu7sg== X-Received: by 2002:a17:907:2716:b0:98d:1f6a:fd47 with SMTP id w22-20020a170907271600b0098d1f6afd47mr8673127ejk.76.1691101310472; Thu, 03 Aug 2023 15:21:50 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id lt1-20020a170906fa8100b009934707378fsm376024ejb.87.2023.08.03.15.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:49 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:47 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Peter Xu , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 19/22] hw/i386/x86-iommu: Fix endianness issue in x86_iommu_irq_to_msi_message() Message-ID: <37cf5cecb039a063c0abe3b51ae30f969e73aa84.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The values in "msg" are assembled in host endian byte order (the other field are also not swapped), so we must not swap the __addr_head here. Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-6-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu --- hw/i386/x86-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index 01d11325a6..726e9e1d16 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -63,7 +63,7 @@ void x86_iommu_irq_to_msi_message(X86IOMMUIrq *irq, MSIMessage *msg_out) msg.redir_hint = irq->redir_hint; msg.dest = irq->dest; msg.__addr_hi = irq->dest & 0xffffff00; - msg.__addr_head = cpu_to_le32(0xfee); + msg.__addr_head = 0xfee; /* Keep this from original MSI address bits */ msg.__not_used = irq->msi_addr_last_bits; From patchwork Thu Aug 3 22:21:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=S3yNJbEv; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Hv63Phz1ybS for ; Fri, 4 Aug 2023 08:22:35 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghl-000603-HY; Thu, 03 Aug 2023 18:22:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghi-0005y3-W0 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghh-0000bW-CW for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:21:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101316; 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: in-reply-to:in-reply-to:references:references; bh=7JJGQmIG8/D9w2B8AamYYdIjwo2ZvijCQld71KYHtag=; b=S3yNJbEv3Mg867df1sDAvomfQgUwcc7/AULCslkOqhM6WRWNQVXqLOw6Yg43aB6FZm2yKl +tUcWfyiEhr2K0Z3Memv8YMCRM2wHs7aViDUTUiKH3fgDvKDdt3xwQ/PC/78zWjI4QOn3v +TzOQESspR4J5KBS88ZCRdChRvIfVDM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-301-Xs1YYjYCMk-Z6N9xHVPCyg-1; Thu, 03 Aug 2023 18:21:55 -0400 X-MC-Unique: Xs1YYjYCMk-Z6N9xHVPCyg-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-51bef8bb689so3138457a12.1 for ; Thu, 03 Aug 2023 15:21:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101314; x=1691706114; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7JJGQmIG8/D9w2B8AamYYdIjwo2ZvijCQld71KYHtag=; b=VIZsydCPL1NdCTiZJWNwn/IWOiMozdWpim66X38XehECDT1D8XwKdnUW1ntldwHBx6 ca8bfW/iXt03pZViI3aMTT3YG+uWlgpXXXHRArQ+zuKzgtEetpmISRy30aFcV6OORWno /RJOascvL6y6k1bAEKTh6VPeeFj8qZqcpDiY3FE0ZhtnZq4LxARWme4Q4kSmfrmbpDRA xyObIUeOKDDPQKd9XD3i+/StrYioJ9FTr4ZVQXqKvT42/WiE2nrt6Zp82oo+12Y7u+fQ 1S7KqUR+gFXgz/IJJ0yojI77Q4FQO2ymoRF58ut8LhAppx24Tq7dWnYd4YBf4A4r8KKk D91g== X-Gm-Message-State: AOJu0Yya173Icm6xTTwO+JXtroP5+z4FFdV74zfo5X7yNeKdwlUkI+aH jsdN10HRpkeq9c2F+JvBiAvW0Z6Yax9VsjFO7AWgj8KiDduw+lSelIz5AWNYUbHIIiBfuNe42sd XsxD+w22tEdRiOAJlF3WRw8Ja9TZ6N+f+VJgri8aYLRXzF81y8ZC72HZSZ1nsJv8U2XPn X-Received: by 2002:a17:907:720a:b0:978:8979:c66c with SMTP id dr10-20020a170907720a00b009788979c66cmr64178ejc.18.1691101313889; Thu, 03 Aug 2023 15:21:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVej7J65taYSwtsHM9Uoy9QqmtUBQjxJ/WJ6soD3dxApuLDuGeocbMON3t9scMHQPJLKucgA== X-Received: by 2002:a17:907:720a:b0:978:8979:c66c with SMTP id dr10-20020a170907720a00b009788979c66cmr64163ejc.18.1691101313640; Thu, 03 Aug 2023 15:21:53 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id lg12-20020a170906f88c00b00992ca779f42sm375300ejb.97.2023.08.03.15.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:53 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Thomas Huth , Peter Xu , Marcel Apfelbaum Subject: [PULL 20/22] include/hw/i386/x86-iommu: Fix struct X86IOMMU_MSIMessage for big endian hosts Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Thomas Huth The first bitfield here is supposed to be used as a 64-bit equivalent to the "uint64_t msi_addr" in the union. To make this work correctly on big endian hosts, too, the __addr_hi field has to be part of the bitfield, and the the bitfield members must be declared with "uint64_t" instead of "uint32_t" - otherwise the values are placed in the wrong bytes on big endian hosts. Same applies to the 32-bit "msi_data" field: __resved1 must be part of the bitfield, and the members must be declared with "uint32_t" instead of "uint16_t". Signed-off-by: Thomas Huth Message-Id: <20230802135723.178083-7-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Xu --- include/hw/i386/x86-iommu.h | 50 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index 8d8d53b18b..bfd21649d0 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -87,40 +87,42 @@ struct X86IOMMU_MSIMessage { union { struct { #if HOST_BIG_ENDIAN - uint32_t __addr_head:12; /* 0xfee */ - uint32_t dest:8; - uint32_t __reserved:8; - uint32_t redir_hint:1; - uint32_t dest_mode:1; - uint32_t __not_used:2; + uint64_t __addr_hi:32; + uint64_t __addr_head:12; /* 0xfee */ + uint64_t dest:8; + uint64_t __reserved:8; + uint64_t redir_hint:1; + uint64_t dest_mode:1; + uint64_t __not_used:2; #else - uint32_t __not_used:2; - uint32_t dest_mode:1; - uint32_t redir_hint:1; - uint32_t __reserved:8; - uint32_t dest:8; - uint32_t __addr_head:12; /* 0xfee */ + uint64_t __not_used:2; + uint64_t dest_mode:1; + uint64_t redir_hint:1; + uint64_t __reserved:8; + uint64_t dest:8; + uint64_t __addr_head:12; /* 0xfee */ + uint64_t __addr_hi:32; #endif - uint32_t __addr_hi; } QEMU_PACKED; uint64_t msi_addr; }; union { struct { #if HOST_BIG_ENDIAN - uint16_t trigger_mode:1; - uint16_t level:1; - uint16_t __resved:3; - uint16_t delivery_mode:3; - uint16_t vector:8; + uint32_t __resved1:16; + uint32_t trigger_mode:1; + uint32_t level:1; + uint32_t __resved:3; + uint32_t delivery_mode:3; + uint32_t vector:8; #else - uint16_t vector:8; - uint16_t delivery_mode:3; - uint16_t __resved:3; - uint16_t level:1; - uint16_t trigger_mode:1; + uint32_t vector:8; + uint32_t delivery_mode:3; + uint32_t __resved:3; + uint32_t level:1; + uint32_t trigger_mode:1; + uint32_t __resved1:16; #endif - uint16_t __resved1; } QEMU_PACKED; uint32_t msi_data; }; From patchwork Thu Aug 3 22:21:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816707 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=P9HEp3MT; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Kd2fRhz1ybS for ; Fri, 4 Aug 2023 08:24:05 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghr-00067Z-KD; Thu, 03 Aug 2023 18:22:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghm-00060u-V5 for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:22:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghk-0000cE-OY for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:22:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101320; 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: in-reply-to:in-reply-to:references:references; bh=jCTXF+0lbl62gsI88fAfOsRF/xYzDCyMeNpegzpcFFI=; b=P9HEp3MT2JfAHb23a5A4XDyJ8c75Yw3LJX56ljCWhniOLpaSD2O6C+xlorELpMakAEGxyV GL+Xm6D+sHYuUgH0P7ldKy0dRdzoQkUlGzqtwegZXOFNZnbqfZVqjLPY9VruAtiLh1XOE3 Wt8MvWitFnvGiLFSbRBteP0+zSURY4I= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-425-L94ddGMHOf2FJjBQiVGjug-1; Thu, 03 Aug 2023 18:21:59 -0400 X-MC-Unique: L94ddGMHOf2FJjBQiVGjug-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-99bfe6a531bso131000666b.1 for ; Thu, 03 Aug 2023 15:21:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101317; x=1691706117; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jCTXF+0lbl62gsI88fAfOsRF/xYzDCyMeNpegzpcFFI=; b=SBcqA/4WGTepiORn+m14GKf32IFRb0w3OYBndxdX0+4egvD8FkMuhoBWPvs2dTNkoe AEvWqBbNMv+PBW99m6aRzkiCPQ7b4hTSyBWrXfR3mvuf6zB9ZOOPrZsKCJLKfw2pbeXG 2wilwHbs6A9ayPm6jX2Q6CE9ueckQIYDVw8HMVejEZmDnscqrIMTlhg8FwpV8KC+UwFy O7IMfCO14Hun92fC/Qj0ehmCM2mVYiHiEQl8JHi+uNBdbAuUH2SaXSMWWk1/CNET1t9m wI7TrRSVVgSddngrpsTjooNqKohzahxAuA2SGpKPM9VZO/qGvwS3MV/r4Wa7bp0dFP+j OSDA== X-Gm-Message-State: ABy/qLbqMuaFc85dcgxgplcrno5/sARDlRl7EfzyxHCm+tdak4fXlUxc IcHRwrDVZhLlHV1GUQDDvQALVneiJKsp/LCb9MhkuQwUVou8PVy/O2d1ODNYCdlObcjZfkHO431 GwgHBKH6o+vKq4PJxM8XZPty3osYjB9zVS85Eymia0178K62qEk8AsQFzPGuOXsW6+jb1 X-Received: by 2002:a17:907:7710:b0:99b:f50b:d7d5 with SMTP id kw16-20020a170907771000b0099bf50bd7d5mr8377023ejc.44.1691101317506; Thu, 03 Aug 2023 15:21:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmL+JMoTuDZVaB5J91GZ325tj9Dj5HOpixZz7DGkr+eEDuNJzbU50rveyARl8BJqWeCMF3tw== X-Received: by 2002:a17:907:7710:b0:99b:f50b:d7d5 with SMTP id kw16-20020a170907771000b0099bf50bd7d5mr8377004ejc.44.1691101317215; Thu, 03 Aug 2023 15:21:57 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id q18-20020a1709064c9200b009875a6d28b0sm379345eju.51.2023.08.03.15.21.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:21:56 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , zhenwei pi , Gonglei , Mauro Matteo Cascella , Yiming Tao Subject: [PULL 21/22] virtio-crypto: verify src&dst buffer length for sym request Message-ID: <9d38a8434721a6479fe03fb5afb150ca793d3980.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: zhenwei pi For symmetric algorithms, the length of ciphertext must be as same as the plaintext. The missing verification of the src_len and the dst_len in virtio_crypto_sym_op_helper() may lead buffer overflow/divulged. This patch is originally written by Yiming Tao for QEMU-SECURITY, resend it(a few changes of error message) in qemu-devel. Fixes: CVE-2023-3180 Fixes: 04b9b37edda("virtio-crypto: add data queue processing handler") Cc: Gonglei Cc: Mauro Matteo Cascella Cc: Yiming Tao Signed-off-by: zhenwei pi Message-Id: <20230803024314.29962-2-pizhenwei@bytedance.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-crypto.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 44faf5a522..13aec771e1 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -634,6 +634,11 @@ virtio_crypto_sym_op_helper(VirtIODevice *vdev, return NULL; } + if (unlikely(src_len != dst_len)) { + virtio_error(vdev, "sym request src len is different from dst len"); + return NULL; + } + max_len = (uint64_t)iv_len + aad_len + src_len + dst_len + hash_result_len; if (unlikely(max_len > vcrypto->conf.max_size)) { virtio_error(vdev, "virtio-crypto too big length"); From patchwork Thu Aug 3 22:21:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1816693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LEWP93vp; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RH3Hc2MG0z1ybS for ; Fri, 4 Aug 2023 08:22:20 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRghw-0006ND-6T; Thu, 03 Aug 2023 18:22:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghq-00067E-Rq for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:22:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRghp-0000d8-9w for qemu-devel@nongnu.org; Thu, 03 Aug 2023 18:22:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691101324; 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: in-reply-to:in-reply-to:references:references; bh=CAtiw9pOJqz+4/AtNB9psY6BRMakFeABmSxYufoyBfw=; b=LEWP93vpX9t3E55EHVo2Bb2kkcqyKCKxXAXikGOhFvwlClHboND4bN2UOXiZPGco0/w/XK ML22oJd2jFovl1l9rTzZv3DQPHXyn5mp9RPojkBdeVxbFdoD82WwNwfJuLjTLkhmLjf+wN hYKWtM3rrGKonK6zEW+wUXmUtmwXu84= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-172-bQ1bp6rKPJ6oM5i9BmLFCg-1; Thu, 03 Aug 2023 18:22:03 -0400 X-MC-Unique: bQ1bp6rKPJ6oM5i9BmLFCg-1 Received: by mail-lf1-f72.google.com with SMTP id 2adb3069b0e04-4fb87c48aceso1548585e87.3 for ; Thu, 03 Aug 2023 15:22:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691101321; x=1691706121; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CAtiw9pOJqz+4/AtNB9psY6BRMakFeABmSxYufoyBfw=; b=jMMJNRF4/wvKPu7PybWdzpfd0vSbGuwII7LtGY8Vv0YRI1yuPaM/PmS69D5ia7D4Bw vsSChZtJpgrpwHQTkEzJDvvf+4rKanmPs81p/Vu0t3XOMn5htoh7/pkx4XzjSGwdl0hj LjPOYz31DKBBmHOTdjXgpkQwka02gSkLIIauPOqsIBHBl/IrrqPYF/ZpHKTMdgWWx13L GfydXAMH0CznYWRwIiB0zgNhPQnLoBee6CaHTAs3vueKvHone+C1OaD8KrTwrYleMF/6 CMZ4M8zYWEljjMd0U3EcV9YVeTpBqfK55Qr17IJf1BCUf7KfbklhbSt+iZ6aRF0pEr2E W94Q== X-Gm-Message-State: ABy/qLaT8hDfG8DUfKi+ddZMH+54g9qxSw7yP0wjp+X33esIfmzG17lU +6bNBl7As61eyiis8vSoHYBu90E0ylKPitt48K4VOj8LUPev9+GcbmipsnLzvrYGGJ4nfYNud7E jzPFhQ8yFUJtGqk+in2AuETZ93J3Ya+xFRIN6YiFQvFgGCVvAB56jGMWXngp+OevuhFwX X-Received: by 2002:a19:921a:0:b0:4fd:fafd:1ed4 with SMTP id u26-20020a19921a000000b004fdfafd1ed4mr6935218lfd.2.1691101321687; Thu, 03 Aug 2023 15:22:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEB46lCbnx/anJD76gv6lYMucYEdx1EEI0uTWFKKsXxEElAUP8TWhybI3AJ4fXUyHgvI5fbSw== X-Received: by 2002:a19:921a:0:b0:4fd:fafd:1ed4 with SMTP id u26-20020a19921a000000b004fdfafd1ed4mr6935204lfd.2.1691101321289; Thu, 03 Aug 2023 15:22:01 -0700 (PDT) Received: from redhat.com ([2.52.12.104]) by smtp.gmail.com with ESMTPSA id d19-20020aa7d693000000b0051ded17b30bsm362300edr.40.2023.08.03.15.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 15:22:00 -0700 (PDT) Date: Thu, 3 Aug 2023 18:21:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , zhenwei pi , Gonglei , Mauro Matteo Cascella , Xiao Lei , Yongkang Jia , Yiming Tao Subject: [PULL 22/22] cryptodev: Handle unexpected request to avoid crash Message-ID: <15b11a1da6a4b7c6b8bb37883f52b544dee2b8fd.1691101215.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: zhenwei pi Generally guest side should discover which services the device is able to offer, then do requests on device. However it's also possible to break this rule in a guest. Handle unexpected request here to avoid NULL pointer dereference. Fixes: e7a775fd ('cryptodev: Account statistics') Cc: Gonglei Cc: Mauro Matteo Cascella Cc: Xiao Lei Cc: Yongkang Jia Reported-by: Yiming Tao Signed-off-by: zhenwei pi Message-Id: <20230803024314.29962-3-pizhenwei@bytedance.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- backends/cryptodev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 7d29517843..4d183f7237 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -191,6 +191,11 @@ static int cryptodev_backend_account(CryptoDevBackend *backend, if (algtype == QCRYPTODEV_BACKEND_ALG_ASYM) { CryptoDevBackendAsymOpInfo *asym_op_info = op_info->u.asym_op_info; len = asym_op_info->src_len; + + if (unlikely(!backend->asym_stat)) { + error_report("cryptodev: Unexpected asym operation"); + return -VIRTIO_CRYPTO_NOTSUPP; + } switch (op_info->op_code) { case VIRTIO_CRYPTO_AKCIPHER_ENCRYPT: CryptodevAsymStatIncEncrypt(backend, len); @@ -210,6 +215,11 @@ static int cryptodev_backend_account(CryptoDevBackend *backend, } else if (algtype == QCRYPTODEV_BACKEND_ALG_SYM) { CryptoDevBackendSymOpInfo *sym_op_info = op_info->u.sym_op_info; len = sym_op_info->src_len; + + if (unlikely(!backend->sym_stat)) { + error_report("cryptodev: Unexpected sym operation"); + return -VIRTIO_CRYPTO_NOTSUPP; + } switch (op_info->op_code) { case VIRTIO_CRYPTO_CIPHER_ENCRYPT: CryptodevSymStatIncEncrypt(backend, len);