From patchwork Wed Jun 24 23:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: 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=SiPchCM3; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf3312h3z9sRW for ; Thu, 25 Jun 2020 09:08:47 +1000 (AEST) Received: from localhost ([::1]:45270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEVY-0002Bi-Rz for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:08:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETY-0008FP-SO for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:41 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:59127 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETV-0001FL-OA for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593039996; 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=yEBYz/1rOCc1PXQNYXHobgljmWeZgraW/Nx26o3Lqgc=; b=SiPchCM3pKMfdHqr/vozTJga0lhPkaANCSsSccPYee2DY+6YLLD18WaDVuzgSfVye1J7Kv Ujfy05ByiAtOv2vcS3MuBpRX9Bbim+pJOaJ6IlgEDSSnxIuc01YtDkxxZ8aPOmdJUQKrJ4 xgJjitSx1dnpODOx19dmfsU9U61XoME= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-sSiZUijPP6C3qDywOTEpvQ-1; Wed, 24 Jun 2020 19:06:33 -0400 X-MC-Unique: sSiZUijPP6C3qDywOTEpvQ-1 Received: by mail-wm1-f70.google.com with SMTP id g187so4665061wme.0 for ; Wed, 24 Jun 2020 16:06:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yEBYz/1rOCc1PXQNYXHobgljmWeZgraW/Nx26o3Lqgc=; b=a6OBDVAR9ZG5HPpGGLMpL7lBBDwVIST0AygteiL+LMIWpf2R0ffX2JRyNs+CHsOrkm 3qabw0bFu5I6JZaDUe+3Tsqe9ZqtdOYS2uXQt4rJK0erUj7vI8laBlT5DDBDadKZUSvl /RFmUHLCgGN9/ntY1wKo2p3/XBZSWmbHltGAnh500yDDitepXoqBNpe4PWeqbxHkJf0P dQJj5knUhy1w0TggWvL1dRa0qKBwVhhwK4cmCvE1eVyeZ76vau+7dBBoSb65ktLsAIgx hcAE/wO1ziGegu8qdKCg34D83ja+BSIdh9v+rzZQM+cVTRcFf+/nVoHHYoXmybFRuYds Z1rQ== X-Gm-Message-State: AOAM533lLwFNVpEa1oznRjUbzBAne8Ya1GC7Y44RPIk1Ko8FHspY8XYr c8EdzzCfleakfueia5thGTWiErqKokaLyKwzn+NU3VeNzspWdRetOmoTLqKwyxzgAivUwEg12f0 Mgv6D2qFecRr2Aek= X-Received: by 2002:a5d:6107:: with SMTP id v7mr32849297wrt.174.1593039992425; Wed, 24 Jun 2020 16:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkpBhYqoNFCWvxqzVFvefHVuz9Owc83laJA9ZQUI/co/ll1ZIUNGqyLO5yLI7014U4c4Ok6w== X-Received: by 2002:a5d:6107:: with SMTP id v7mr32849281wrt.174.1593039992233; Wed, 24 Jun 2020 16:06:32 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id t16sm7036094wru.9.2020.06.24.16.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:31 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 01/19] qtest: allow DSDT acpi table changes Message-ID: <20200624230609.703104-2-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Gerd Hoffmann , Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Message-Id: <20200619091905.21676-2-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..8992f1f12b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,19 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"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.ipmikcs", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.tis", From patchwork Wed Jun 24 23:06:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316628 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HPyfhcGy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf1W2r74z9sRf for ; Thu, 25 Jun 2020 09:07:27 +1000 (AEST) Received: from localhost ([::1]:40164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEUH-0008Ht-2a for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:07:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETa-0008Fz-AQ for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:42 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52292 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETY-0001Gx-4d for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593039998; 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=unmpPZT+vnpLsu4lIIaVV67y5xez7uhexAq7iIY4vXw=; b=HPyfhcGybRlHNBhyZIiHiIfSltFGmNezUlfQAwqZYY6wJutmXe0UARZMohIX9UXCz6/05r fvbTByQ1atJNvHdwbkE1kJA5ciSdYr+TJzrJ7yKulLaYsycyzbYElRE4SunBKef9/u+8bA N+KUaxxNAq9FmSmhNiI5JAwlMTW8G+Y= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-330-7CInZu-9OlScFJTzELXy9w-1; Wed, 24 Jun 2020 19:06:36 -0400 X-MC-Unique: 7CInZu-9OlScFJTzELXy9w-1 Received: by mail-wm1-f70.google.com with SMTP id a7so4655299wmf.1 for ; Wed, 24 Jun 2020 16:06:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=unmpPZT+vnpLsu4lIIaVV67y5xez7uhexAq7iIY4vXw=; b=FD2NJwh/PSug/16H8U4aX1t2ySOy2Lptn5ZnAhsyEyxcjz0cixHJTQGI8lCRFl0k2+ A7Zi0Y9Bz/3BV1FQ6XynrF3SQj37hgl1AYq/4DmTvyN31S2vljX6YmAu9uxEfn0SQuwb ybebHZTXHDqRcwHV+OJsF1ASLz2Cjeain1x3qsBKNl8b7DpjAFpkcX+EgsqcyYNR5SXM G5fIbMrTUY77buG4TP3Y7J61xNHIWcQDFE/SN/2E7JKux4YJTJ1AlK3KFkxGK6CzjLQU qMXV7gbiwC/z5DNSeB8/BShT2tsQtmd72ZzSrmI2apX6ByUWZyfSRssUrX7rkcAHZYkk vLCA== X-Gm-Message-State: AOAM530U2FpJabFC7Al6MmBqvhDrUizSjWgkdSDBpVG5tEFoIlXfxx9E jHwlIhH64tkNHeufvzAz7DYBp4fAgG//4nhSQpvs3XWaMWdZWuBvvL/NCe9Fj6BX10Un2sPxt8K IrCgPBjmshfum2Ng= X-Received: by 2002:a5d:46d0:: with SMTP id g16mr36125726wrs.229.1593039995232; Wed, 24 Jun 2020 16:06:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKCZlW+0JXE9TiCemf/+lstqFrAJ86Pr8zhKuKa52H9sHan2LZflf1+KahV2APOTnzIkhwTw== X-Received: by 2002:a5d:46d0:: with SMTP id g16mr36125708wrs.229.1593039995044; Wed, 24 Jun 2020 16:06:35 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id u23sm15316490wru.94.2020.06.24.16.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:34 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:32 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 02/19] acpi: bios-tables-test: show more context on asl diffs Message-ID: <20200624230609.703104-3-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Makes it easier to create good commit messages from the logs. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200619091905.21676-3-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index b482f76c03..c315156858 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -469,7 +469,7 @@ static void test_acpi_asl(test_data *data) fflush(stderr); if (getenv("V")) { const char *diff_env = getenv("DIFF"); - const char *diff_cmd = diff_env ? diff_env : "diff -u"; + const char *diff_cmd = diff_env ? diff_env : "diff -U 16"; char *diff = g_strdup_printf("%s %s %s", diff_cmd, exp_sdt->asl_file, sdt->asl_file); int out = dup(STDOUT_FILENO); From patchwork Wed Jun 24 23:06:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jQooglJZ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf2b20K4z9sRW for ; Thu, 25 Jun 2020 09:08:23 +1000 (AEST) Received: from localhost ([::1]:43822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEVA-0001cB-WD for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:08:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETh-0008KE-3u for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:49 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:44706 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETe-0001Lg-6r for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040004; 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=LlXSXRC7gmuzJ8FU1ybfVUVcMWw4EEXgB/iHq9TKgg0=; b=jQooglJZlWMOE10qw2TKTEbEhmgRiY9mj6XuzZmThjsKmf2L339oeEuBXhvgSKFESyOHDS reTC+bWf04LPi5Ok+nXWe+JCucVQN9ect3c1mCJaMx27XV4M5zk+dEgcCWp05SkXuwO2VY x7Aa3TM4J4OX3LXTgoJ8ZaUkrHKZifg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-305-qha8T9NPPcSlbatKuuDEIw-1; Wed, 24 Jun 2020 19:06:40 -0400 X-MC-Unique: qha8T9NPPcSlbatKuuDEIw-1 Received: by mail-wm1-f70.google.com with SMTP id b13so2662984wme.9 for ; Wed, 24 Jun 2020 16:06:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LlXSXRC7gmuzJ8FU1ybfVUVcMWw4EEXgB/iHq9TKgg0=; b=Df2WJExBHayJgUn1gdqtlFLiDPN48VmQl6kmtUUKSXBYGlUfHJeXwukKUsQuHHM7m6 4PPnMuX3raBfp6bBpoFwYTcJh7qDHZ4EAB4JNeqGwkJ4HuKvGo01EDaocc6pMQGutJn7 VI2FnQYj+zb46VBaPzLbvZZfHubQ6EjsQ7z2rtMiZnxJBUt1vQHpdoCW6ZlY5Cw5Stog fjD/zCn3UIkXnHn4zNhBvraFOJmPHOdxR5Yf2MjgjL9qlSg8mCflWwGmNgxclFMyjfAv qVOY0GnRAb1VlUwnSyZYRh/UOqT/UDQjlWmKUOacXHLyCHmds9lk46V/fEHSYrmd4JnY 1FtA== X-Gm-Message-State: AOAM533SbuND6cqF7ALWkX6z9EtS3Cjys5Vt0y4G9Kn2upjQNa3o16vn hfZ/Kq9ffcf2s228bPdntb5DdoNtads9a5TowxgJFwcp2YlcexDR42RDVLpPe3yV3s2L5YCl87f yJDWbf5zl1McRvZI= X-Received: by 2002:a5d:688c:: with SMTP id h12mr22037251wru.212.1593039998868; Wed, 24 Jun 2020 16:06:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqCj1d2+GELAC8AYKGte68c2vJgzLzDZ2dODGKBbafhaZkRZlE+DjtEfwglSs102lG9QU6pw== X-Received: by 2002:a5d:688c:: with SMTP id h12mr22037183wru.212.1593039998087; Wed, 24 Jun 2020 16:06:38 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id q128sm9681543wma.38.2020.06.24.16.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:37 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:35 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 03/19] acpi: move aml builder code for floppy device Message-ID: <20200624230609.703104-4-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, Max Reitz , Gerd Hoffmann , Paolo Bonzini , Igor Mammedov , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann DSDT change: isa device order changes in case MI1 (ipmi) is present. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Message-Id: <20200619091905.21676-4-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/block/fdc.c | 83 ++++++++++++++++++++++++++++++++++++++++++++ hw/i386/acpi-build.c | 83 -------------------------------------------- stubs/cmos.c | 7 ++++ stubs/Makefile.objs | 1 + 4 files changed, 91 insertions(+), 83 deletions(-) create mode 100644 stubs/cmos.c diff --git a/hw/block/fdc.c b/hw/block/fdc.c index be0674e4aa..5244df6f91 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -32,6 +32,8 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" +#include "hw/i386/pc.h" +#include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -2768,6 +2770,85 @@ void isa_fdc_get_drive_max_chs(FloppyDriveType type, (*maxc)--; } +static Aml *build_fdinfo_aml(int idx, FloppyDriveType type) +{ + Aml *dev, *fdi; + uint8_t maxc, maxh, maxs; + + isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs); + + dev = aml_device("FLP%c", 'A' + idx); + + aml_append(dev, aml_name_decl("_ADR", aml_int(idx))); + + fdi = aml_package(16); + aml_append(fdi, aml_int(idx)); /* Drive Number */ + aml_append(fdi, + aml_int(cmos_get_fd_drive_type(type))); /* Device Type */ + /* + * the values below are the limits of the drive, and are thus independent + * of the inserted media + */ + aml_append(fdi, aml_int(maxc)); /* Maximum Cylinder Number */ + aml_append(fdi, aml_int(maxs)); /* Maximum Sector Number */ + aml_append(fdi, aml_int(maxh)); /* Maximum Head Number */ + /* + * SeaBIOS returns the below values for int 0x13 func 0x08 regardless of + * the drive type, so shall we + */ + aml_append(fdi, aml_int(0xAF)); /* disk_specify_1 */ + aml_append(fdi, aml_int(0x02)); /* disk_specify_2 */ + aml_append(fdi, aml_int(0x25)); /* disk_motor_wait */ + aml_append(fdi, aml_int(0x02)); /* disk_sector_siz */ + aml_append(fdi, aml_int(0x12)); /* disk_eot */ + aml_append(fdi, aml_int(0x1B)); /* disk_rw_gap */ + aml_append(fdi, aml_int(0xFF)); /* disk_dtl */ + aml_append(fdi, aml_int(0x6C)); /* disk_formt_gap */ + aml_append(fdi, aml_int(0xF6)); /* disk_fill */ + aml_append(fdi, aml_int(0x0F)); /* disk_head_sttl */ + aml_append(fdi, aml_int(0x08)); /* disk_motor_strt */ + + aml_append(dev, aml_name_decl("_FDI", fdi)); + return dev; +} + +static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) +{ + Aml *dev; + Aml *crs; + int i; + +#define ACPI_FDE_MAX_FD 4 + uint32_t fde_buf[5] = { + 0, 0, 0, 0, /* presence of floppy drives #0 - #3 */ + cpu_to_le32(2) /* tape presence (2 == never present) */ + }; + + crs = aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); + aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); + aml_append(crs, aml_irq_no_flags(6)); + aml_append(crs, + aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); + + dev = aml_device("FDC0"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700"))); + aml_append(dev, aml_name_decl("_CRS", crs)); + + for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) { + FloppyDriveType type = isa_fdc_get_drive_type(isadev, i); + + if (type < FLOPPY_DRIVE_TYPE_NONE) { + fde_buf[i] = cpu_to_le32(1); /* drive present */ + aml_append(dev, build_fdinfo_aml(i, type)); + } + } + aml_append(dev, aml_name_decl("_FDE", + aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf))); + + aml_append(scope, dev); +} + static const VMStateDescription vmstate_isa_fdc ={ .name = "fdc", .version_id = 2, @@ -2801,11 +2882,13 @@ static Property isa_fdc_properties[] = { static void isabus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); dc->realize = isabus_fdc_realize; dc->fw_name = "fdc"; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; + isa->build_aml = fdc_isa_build_aml; device_class_set_props(dc, isa_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 900f786d08..45297d9a90 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -938,85 +938,6 @@ static void build_hpet_aml(Aml *table) aml_append(table, scope); } -static Aml *build_fdinfo_aml(int idx, FloppyDriveType type) -{ - Aml *dev, *fdi; - uint8_t maxc, maxh, maxs; - - isa_fdc_get_drive_max_chs(type, &maxc, &maxh, &maxs); - - dev = aml_device("FLP%c", 'A' + idx); - - aml_append(dev, aml_name_decl("_ADR", aml_int(idx))); - - fdi = aml_package(16); - aml_append(fdi, aml_int(idx)); /* Drive Number */ - aml_append(fdi, - aml_int(cmos_get_fd_drive_type(type))); /* Device Type */ - /* - * the values below are the limits of the drive, and are thus independent - * of the inserted media - */ - aml_append(fdi, aml_int(maxc)); /* Maximum Cylinder Number */ - aml_append(fdi, aml_int(maxs)); /* Maximum Sector Number */ - aml_append(fdi, aml_int(maxh)); /* Maximum Head Number */ - /* - * SeaBIOS returns the below values for int 0x13 func 0x08 regardless of - * the drive type, so shall we - */ - aml_append(fdi, aml_int(0xAF)); /* disk_specify_1 */ - aml_append(fdi, aml_int(0x02)); /* disk_specify_2 */ - aml_append(fdi, aml_int(0x25)); /* disk_motor_wait */ - aml_append(fdi, aml_int(0x02)); /* disk_sector_siz */ - aml_append(fdi, aml_int(0x12)); /* disk_eot */ - aml_append(fdi, aml_int(0x1B)); /* disk_rw_gap */ - aml_append(fdi, aml_int(0xFF)); /* disk_dtl */ - aml_append(fdi, aml_int(0x6C)); /* disk_formt_gap */ - aml_append(fdi, aml_int(0xF6)); /* disk_fill */ - aml_append(fdi, aml_int(0x0F)); /* disk_head_sttl */ - aml_append(fdi, aml_int(0x08)); /* disk_motor_strt */ - - aml_append(dev, aml_name_decl("_FDI", fdi)); - return dev; -} - -static Aml *build_fdc_device_aml(ISADevice *fdc) -{ - int i; - Aml *dev; - Aml *crs; - -#define ACPI_FDE_MAX_FD 4 - uint32_t fde_buf[5] = { - 0, 0, 0, 0, /* presence of floppy drives #0 - #3 */ - cpu_to_le32(2) /* tape presence (2 == never present) */ - }; - - dev = aml_device("FDC0"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0700"))); - - crs = aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x03F2, 0x03F2, 0x00, 0x04)); - aml_append(crs, aml_io(AML_DECODE16, 0x03F7, 0x03F7, 0x00, 0x01)); - aml_append(crs, aml_irq_no_flags(6)); - aml_append(crs, - aml_dma(AML_COMPATIBILITY, AML_NOTBUSMASTER, AML_TRANSFER8, 2)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) { - FloppyDriveType type = isa_fdc_get_drive_type(fdc, i); - - if (type < FLOPPY_DRIVE_TYPE_NONE) { - fde_buf[i] = cpu_to_le32(1); /* drive present */ - aml_append(dev, build_fdinfo_aml(i, type)); - } - } - aml_append(dev, aml_name_decl("_FDE", - aml_buffer(sizeof(fde_buf), (uint8_t *)fde_buf))); - - return dev; -} - static Aml *build_kbd_device_aml(void) { Aml *dev; @@ -1092,7 +1013,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge) static void build_isa_devices_aml(Aml *table) { - ISADevice *fdc = pc_find_fdc0(); VMBusBridge *vmbus_bridge = vmbus_bridge_find(); bool ambiguous; @@ -1101,9 +1021,6 @@ static void build_isa_devices_aml(Aml *table) aml_append(scope, build_kbd_device_aml()); aml_append(scope, build_mouse_device_aml()); - if (fdc) { - aml_append(scope, build_fdc_device_aml(fdc)); - } if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data"); diff --git a/stubs/cmos.c b/stubs/cmos.c new file mode 100644 index 0000000000..416cbe4055 --- /dev/null +++ b/stubs/cmos.c @@ -0,0 +1,7 @@ +#include "qemu/osdep.h" +#include "hw/i386/pc.h" + +int cmos_get_fd_drive_type(FloppyDriveType fd0) +{ + return 0; +} diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index 28e48171d1..f32b9e47a3 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -1,4 +1,5 @@ stub-obj-y += blk-commit-all.o +stub-obj-y += cmos.o stub-obj-y += cpu-get-clock.o stub-obj-y += cpu-get-icount.o stub-obj-y += dump.o From patchwork Wed Jun 24 23:06:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=B+Oz6v7d; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf4303jGz9sRW for ; Thu, 25 Jun 2020 09:09:39 +1000 (AEST) Received: from localhost ([::1]:48876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEWO-0003tu-Mg for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:09:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETg-0008JR-N7 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36416 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETe-0001MG-6w for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040004; 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=FFvaXkZTKjDx5cRD4SdzQ8DkQ6V3EUCI1ITwbUTwI1E=; b=B+Oz6v7dqPJQR7Kqd02tmk3a/zKrl4IkzcrsamsJLNEFWo9DZP1tcK7vZwoJuhnIHO3OYG 70VdGtfEDqezQrMh+/v1aNU7RrAmqGUuAxu+lw2iq+q5swUCCEgKLAPLHVFHNvzf77i+Fy DcN2G875OBIIglh6GRqClInZkwIDR9M= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-8zXIXV8AN8WP6UqOplPyug-1; Wed, 24 Jun 2020 19:06:42 -0400 X-MC-Unique: 8zXIXV8AN8WP6UqOplPyug-1 Received: by mail-wm1-f72.google.com with SMTP id g187so4665737wme.0 for ; Wed, 24 Jun 2020 16:06:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=FFvaXkZTKjDx5cRD4SdzQ8DkQ6V3EUCI1ITwbUTwI1E=; b=spbBx4jDnh9b70F8uGFhmndlrFkYaogsGkKPZj+0EWKxWtmY2aUgsvmg92uoTkKg3g uTrYDKhZ2EDwQcZRGF+olKwBpJMjTSlm+hiL8v7NdKtBIiY35uXWvFiffYuU1Eh0+8fb bgGKxmCu2g26dtJtd4VlWeArcwc0WKqRaEJy73VfVE4nyqmm7r9whsNJEUKR6CSUZRju SL0wJqYvTvqmGftd1+NSGxgDPBopkqf9XP3AhtiQJbMZJPAcx5DKwZSU32KYimsrFI0i hDHf6Ujk1kwtEv8B13JShTAVMsYiPPjAky36keHKGV7L9alegSKnHPHMX70zdJIcx7+R Er0g== X-Gm-Message-State: AOAM531+IIzD2vg9OvsXgVYzGg/yadaplpzlA4LWOMOX/XUxFKctHlhn aeCLtRQpEjW7HrJUO86W6JMrc9qIdzW/K87VLbexrSVhkR2muWKuYD7tMnmPqK9F0rwArKY5KZx Oez94sjQM1Dzwvys= X-Received: by 2002:a05:600c:281:: with SMTP id 1mr88827wmk.143.1593040001164; Wed, 24 Jun 2020 16:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhRyS1fsGCzgI4mnuybl4XyDKFZEE1Bg+DLCaCxPgDE3g4ulKnK4W3h2yvXF191n+EST0C3Q== X-Received: by 2002:a05:600c:281:: with SMTP id 1mr88814wmk.143.1593040000987; Wed, 24 Jun 2020 16:06:40 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id y16sm29078848wro.71.2020.06.24.16.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:40 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:38 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 04/19] floppy: make isa_fdc_get_drive_max_chs static Message-ID: <20200624230609.703104-5-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , qemu-block@nongnu.org, Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Max Reitz , Gerd Hoffmann , Igor Mammedov , John Snow Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann acpi aml generator needs this, but it is in floppy code now so we can make the function static. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Acked-by: John Snow Message-Id: <20200619091905.21676-5-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/block/fdc.h | 2 -- hw/block/fdc.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index c15ff4c623..5d71cf9722 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -16,7 +16,5 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc); FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i); -void isa_fdc_get_drive_max_chs(FloppyDriveType type, - uint8_t *maxc, uint8_t *maxh, uint8_t *maxs); #endif diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 5244df6f91..f1da83f08e 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2747,8 +2747,8 @@ FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i) return isa->state.drives[i].drive; } -void isa_fdc_get_drive_max_chs(FloppyDriveType type, - uint8_t *maxc, uint8_t *maxh, uint8_t *maxs) +static void isa_fdc_get_drive_max_chs(FloppyDriveType type, uint8_t *maxc, + uint8_t *maxh, uint8_t *maxs) { const FDFormat *fdf; From patchwork Wed Jun 24 23:06:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316634 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=E7R12VcA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf4r3kGQz9sRf for ; Thu, 25 Jun 2020 09:10:20 +1000 (AEST) Received: from localhost ([::1]:52422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEX4-0005LH-3k for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:10:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETi-0008LS-TC for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:51 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:32943 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETg-0001O1-Qe for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040007; 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=Sy5UuEMEVgAtCPDE5daNRSt9ncB2ZYgss6jFaBLRUiw=; b=E7R12VcACOxbBqqtPELa1fssAVsTvh2wDoFHKD9L7pbzWUJzxYzTsw1EkqSPARRxxmKcHX LLNQGJ3Yi98gbjBWPTkwX01TPtjRuaMiSOWIMrE1KNh80/SfeSbgs2c3DVPpftv7jDrvvg ZMWo4JuKmFSVkoMEZAIAMwr9BX06/QM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-V1XBCWGUM5aXMp3j8xoF-w-1; Wed, 24 Jun 2020 19:06:45 -0400 X-MC-Unique: V1XBCWGUM5aXMp3j8xoF-w-1 Received: by mail-wm1-f70.google.com with SMTP id g187so4665986wme.0 for ; Wed, 24 Jun 2020 16:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Sy5UuEMEVgAtCPDE5daNRSt9ncB2ZYgss6jFaBLRUiw=; b=mxq0rNLMS0tvpbJFscYNwK9E40/5xQqTNDbv/Y/fVhK7ycnQrvgJmmRObbgMqjs2BB Xsph0+ZjJcWJUYeLqT95lihGJjHBF/w803Mn8UIb468pHu5RAOB8112TTMBHf0AvDW++ CRWYtrSqdbHOe0P+IFGrFoXhSfgY0aqnUMaIJQAMRWlInO108kRsBT2HeCs5c2VlpLyf EGTZfqdGPgovOSSMIP5xvtalMnx5yug8GRojtTlMRcID9aKRvVhfDrmYsqpmQlIkb30P rCtC9BoJLjsBL7OQCwDR5/sSTN+JHxCjwK7O17ySeeYcDthSQizeYUlFr984H5b6PDHc e/Nw== X-Gm-Message-State: AOAM533cW6pzSBZsytx/ClUCHFZLXMdohZtj8+ExhkBrJXFVi38hrzu5 O0lwFXTmIwFwREgExsgwmHa/UTPZmEmD789juMGpFa+bF1BgmhUGl1GNQEieLrxe/lhH91uqZT5 5Va0QFJrx41BDPPA= X-Received: by 2002:a1c:acc3:: with SMTP id v186mr102486wme.79.1593040004057; Wed, 24 Jun 2020 16:06:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZJsRmhkq89lNyMezMk+RsoqHPeMFLjdH/DVpMtpEz8LXw0DS7Bn93WxjX7yey8cHhti4iVg== X-Received: by 2002:a1c:acc3:: with SMTP id v186mr102459wme.79.1593040003809; Wed, 24 Jun 2020 16:06:43 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id 1sm9718686wmf.0.2020.06.24.16.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:43 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:41 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 05/19] floppy: move cmos_get_fd_drive_type() from pc Message-ID: <20200624230609.703104-6-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Peter Maydell , Eduardo Habkost , qemu-block@nongnu.org, Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Max Reitz , Gerd Hoffmann , Paolo Bonzini , John Snow , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Acked-by: John Snow Message-Id: <20200619091905.21676-6-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/block/fdc.h | 1 + include/hw/i386/pc.h | 1 - hw/block/fdc.c | 26 +++++++++++++++++++++++++- hw/i386/pc.c | 25 ------------------------- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/include/hw/block/fdc.h b/include/hw/block/fdc.h index 5d71cf9722..479cebc0a3 100644 --- a/include/hw/block/fdc.h +++ b/include/hw/block/fdc.h @@ -16,5 +16,6 @@ void sun4m_fdctrl_init(qemu_irq irq, hwaddr io_base, DriveInfo **fds, qemu_irq *fdc_tc); FloppyDriveType isa_fdc_get_drive_type(ISADevice *fdc, int i); +int cmos_get_fd_drive_type(FloppyDriveType fd0); #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index e6135c34d6..dce1273c7d 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -178,7 +178,6 @@ typedef void (*cpu_set_smm_t)(int smm, void *arg); void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259_irqs); ISADevice *pc_find_fdc0(void); -int cmos_get_fd_drive_type(FloppyDriveType fd0); /* port92.c */ #define PORT92_A20_LINE "a20" diff --git a/hw/block/fdc.c b/hw/block/fdc.c index f1da83f08e..4f0921298b 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -32,7 +32,6 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" -#include "hw/i386/pc.h" #include "hw/acpi/aml-build.h" #include "hw/irq.h" #include "hw/isa/isa.h" @@ -2812,6 +2811,31 @@ static Aml *build_fdinfo_aml(int idx, FloppyDriveType type) return dev; } +int cmos_get_fd_drive_type(FloppyDriveType fd0) +{ + int val; + + switch (fd0) { + case FLOPPY_DRIVE_TYPE_144: + /* 1.44 Mb 3"5 drive */ + val = 4; + break; + case FLOPPY_DRIVE_TYPE_288: + /* 2.88 Mb 3"5 drive */ + val = 5; + break; + case FLOPPY_DRIVE_TYPE_120: + /* 1.2 Mb 5"5 drive */ + val = 2; + break; + case FLOPPY_DRIVE_TYPE_NONE: + default: + val = 0; + break; + } + return val; +} + static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) { Aml *dev; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index d103b8c0ab..e78e32b41b 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -386,31 +386,6 @@ static uint64_t ioportF0_read(void *opaque, hwaddr addr, unsigned size) #define REG_EQUIPMENT_BYTE 0x14 -int cmos_get_fd_drive_type(FloppyDriveType fd0) -{ - int val; - - switch (fd0) { - case FLOPPY_DRIVE_TYPE_144: - /* 1.44 Mb 3"5 drive */ - val = 4; - break; - case FLOPPY_DRIVE_TYPE_288: - /* 2.88 Mb 3"5 drive */ - val = 5; - break; - case FLOPPY_DRIVE_TYPE_120: - /* 1.2 Mb 5"5 drive */ - val = 2; - break; - case FLOPPY_DRIVE_TYPE_NONE: - default: - val = 0; - break; - } - return val; -} - static void cmos_init_hd(ISADevice *s, int type_ofs, int info_ofs, int16_t cylinders, int8_t heads, int8_t sectors) { From patchwork Wed Jun 24 23:06:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cSThRj2h; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf776dRgz9sRf for ; Thu, 25 Jun 2020 09:12:19 +1000 (AEST) Received: from localhost ([::1]:60862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEYz-0000o5-HK for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETk-0008NX-TC for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:52 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:35924 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETj-0001Pd-21 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040010; 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=4103IHCahkyMhhMJ5CqnoOKuVcMixIsrI5jBYx2fDK8=; b=cSThRj2hGitj9SomN1O0iFQgiMNNS+YZx9uSaTR+HFMPmDUmEEdPA8m8PUiJXvGqZd5nc1 LgJ0WUSb94CJMMGZgFJRQcZPxns6x2OSHkpCpQ9o/wCfy6DbRKHA42PUZvMzzHgOAidfrP lUnlPTLZtl9M9yKH3i3ekis6z39I1wM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-33-Q0EoPfi8MXywKDE_PKDB2w-1; Wed, 24 Jun 2020 19:06:48 -0400 X-MC-Unique: Q0EoPfi8MXywKDE_PKDB2w-1 Received: by mail-wr1-f70.google.com with SMTP id a6so4733245wrq.3 for ; Wed, 24 Jun 2020 16:06:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=4103IHCahkyMhhMJ5CqnoOKuVcMixIsrI5jBYx2fDK8=; b=ZfTJp3JE/7bKQQCJBMgx7Hdh3fRnMxD2u7oM+eyEEIW55ItWVJ7OirQ9/ij1604J+l 2Y5zeIUbjCxAPQ4gDLkni8Kjl1/ruo/Jw6arJ845ZxNl4Mgyv3veXv1+3ZZQjM5Y9qPZ Mg9t6xjtwf/luWq0eceEHfrqXGMO6OOpxTzU2s7W9lvSSh/wgeK1lT+lnsD6inpdiS5U ZKvWRrkLaR1y/5SeIunQlB3Fau9jca963vRv51q0v40y/X5nni3K2Sd0PpBmiNZOdimp q7qp8PoEgugwJniC2KWUDwPBykYdNK2mVIpQ8S2YcBmeT9OU/xROBGHKyophSw5frYMn iqpA== X-Gm-Message-State: AOAM532J8gB5bMhUYo3gH4ImC8gHii41HzHpcuMQs0+5gOsEA10CqalU twoI7BrUvi1HdH6oIPvGTHKaZeh977pvFuR+7agF/fX0BotsQzuIm1uUoHY9THRIcyJeM5v0t+Q W/K1BPmRytz59PAg= X-Received: by 2002:adf:9286:: with SMTP id 6mr33831454wrn.361.1593040006716; Wed, 24 Jun 2020 16:06:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo8ugK1vjkowQx1kL5pUwtfekIUeCULLH1ZVGFiaadrPFIkvACHNVcpkfpV1rFxi6ZxV0iDQ== X-Received: by 2002:adf:9286:: with SMTP id 6mr33831436wrn.361.1593040006534; Wed, 24 Jun 2020 16:06:46 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id 11sm10040719wmg.41.2020.06.24.16.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:45 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 06/19] acpi: move aml builder code for i8042 (kbd+mouse) device Message-ID: <20200624230609.703104-7-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann DSDT change: isa device order changes in case MI1 (ipmi) is present. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20200619091905.21676-7-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 39 --------------------------------------- hw/input/pckbd.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 45297d9a90..13113e83df 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -938,42 +938,6 @@ static void build_hpet_aml(Aml *table) aml_append(table, scope); } -static Aml *build_kbd_device_aml(void) -{ - Aml *dev; - Aml *crs; - - dev = aml_device("KBD"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0303"))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs = aml_resource_template(); - aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); - aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01)); - aml_append(crs, aml_irq_no_flags(1)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - return dev; -} - -static Aml *build_mouse_device_aml(void) -{ - Aml *dev; - Aml *crs; - - dev = aml_device("MOU"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xf))); - - crs = aml_resource_template(); - aml_append(crs, aml_irq_no_flags(12)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - return dev; -} - static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge) { Aml *dev; @@ -1019,9 +983,6 @@ static void build_isa_devices_aml(Aml *table) Aml *scope = aml_scope("_SB.PCI0.ISA"); Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); - aml_append(scope, build_kbd_device_aml()); - aml_append(scope, build_mouse_device_aml()); - if (ambiguous) { error_report("Multiple ISA busses, unable to define IPMI ACPI data"); } else if (!obj) { diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 60a4130320..29d633ca94 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -26,6 +26,7 @@ #include "qemu/log.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" +#include "hw/acpi/aml-build.h" #include "hw/input/ps2.h" #include "hw/irq.h" #include "hw/input/i8042.h" @@ -561,12 +562,42 @@ static void i8042_realizefn(DeviceState *dev, Error **errp) qemu_register_reset(kbd_reset, s); } +static void i8042_build_aml(ISADevice *isadev, Aml *scope) +{ + Aml *kbd; + Aml *mou; + Aml *crs; + + crs = aml_resource_template(); + aml_append(crs, aml_io(AML_DECODE16, 0x0060, 0x0060, 0x01, 0x01)); + aml_append(crs, aml_io(AML_DECODE16, 0x0064, 0x0064, 0x01, 0x01)); + aml_append(crs, aml_irq_no_flags(1)); + + kbd = aml_device("KBD"); + aml_append(kbd, aml_name_decl("_HID", aml_eisaid("PNP0303"))); + aml_append(kbd, aml_name_decl("_STA", aml_int(0xf))); + aml_append(kbd, aml_name_decl("_CRS", crs)); + + crs = aml_resource_template(); + aml_append(crs, aml_irq_no_flags(12)); + + mou = aml_device("MOU"); + aml_append(mou, aml_name_decl("_HID", aml_eisaid("PNP0F13"))); + aml_append(mou, aml_name_decl("_STA", aml_int(0xf))); + aml_append(mou, aml_name_decl("_CRS", crs)); + + aml_append(scope, kbd); + aml_append(scope, mou); +} + static void i8042_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); dc->realize = i8042_realizefn; dc->vmsd = &vmstate_kbd_isa; + isa->build_aml = i8042_build_aml; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } From patchwork Wed Jun 24 23:06:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Gi3rOBgR; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf3z3wd8z9sRf for ; Thu, 25 Jun 2020 09:09:35 +1000 (AEST) Received: from localhost ([::1]:48562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEWL-0003m7-7K for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:09:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETn-0008TO-6a for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:55 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:31968 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETl-0001QF-9a for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040012; 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=OtvGed/OFKwo/KPonF6wNPBQThzBS/0Dl1GdOBvffZw=; b=Gi3rOBgRw1wGMYnUR1hUHwmjhrjtApCsInm4yRzDNSBDWnTqvnnPoXWk9wU5HCJc+/xTQM C6b5gyvXvLFEf0duu9g3kQ2MEhv0jdpS56OjH4a2ieGjqMpKgyQpY6HKKRvcSc11rly0Va vwINJfY+b+TWoErJCLLr0eoSdSzkWg4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-EZigzOzBNpGNtzOIav3qvA-1; Wed, 24 Jun 2020 19:06:51 -0400 X-MC-Unique: EZigzOzBNpGNtzOIav3qvA-1 Received: by mail-wm1-f71.google.com with SMTP id v6so2542709wmg.1 for ; Wed, 24 Jun 2020 16:06:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=OtvGed/OFKwo/KPonF6wNPBQThzBS/0Dl1GdOBvffZw=; b=aQ8XN52jQ3WNNcBNz5M954UdkI5re9U1Qlu81f45S+HhVoJQwT4oPl38T3cz4jbcSW n2p2fwf2lKFZTGS6/Q7ViVJ8jNT897wqi6wjE+V3RKP4UF+md9wn6l2rSQgBWAkTSMyl bG2Eo6cJXmZtEmnqwrFYA6IkVtByv3ekkH/j0FPZ78lq4o2odZSwxSt2qRYhCASZ0lEU 6x8FuoT2qvGOBqk/vfrNZFhc68U47n/Lhw/ujtn25l6MCskTsObgHEGuU9NHeCyFYssH 8LrtCpLWF78oI23x6kqdoC+Df7Lha+2LtP9JCwQlu5UrvZGf8m6Y/TO3QTF165Xhid6o 7OIw== X-Gm-Message-State: AOAM530iKMK5mYiV37D6S6G9s4PQqmJZMDL00iebXXtbq/2Lq6AXMhcM KMwiwHW2mgfK0sJm+nmOqbTkHaoPwm+19dR5kTQLCJZLcrXWhOkRBxbn6QkPw64nUrfjRnOwWor f5o/y+ZIIuFyLR58= X-Received: by 2002:adf:e68d:: with SMTP id r13mr28428359wrm.141.1593040009613; Wed, 24 Jun 2020 16:06:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztrMV1Bsnja9uCJaWHYmsKJLkfIStaHHf7JmnrceFOVmlkAoLSTJWM9U4xr8z2dgTUyyCNgw== X-Received: by 2002:adf:e68d:: with SMTP id r13mr28428338wrm.141.1593040009426; Wed, 24 Jun 2020 16:06:49 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id h29sm30691207wrc.78.2020.06.24.16.06.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:48 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:46 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 07/19] acpi: factor out fw_cfg_add_acpi_dsdt() Message-ID: <20200624230609.703104-8-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Add helper function to add fw_cfg device, also move code to hw/i386/fw_cfg.c. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Igor Mammedov Message-Id: <20200619091905.21676-8-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/fw_cfg.h | 1 + hw/i386/acpi-build.c | 24 +----------------------- hw/i386/fw_cfg.c | 28 ++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/hw/i386/fw_cfg.h b/hw/i386/fw_cfg.h index 9e74278779..275f15c1c5 100644 --- a/hw/i386/fw_cfg.h +++ b/hw/i386/fw_cfg.h @@ -25,5 +25,6 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, uint16_t apic_id_limit); void fw_cfg_build_smbios(MachineState *ms, FWCfgState *fw_cfg); void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg); +void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg); #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 13113e83df..19e9c298dc 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1802,30 +1802,8 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, /* create fw_cfg node, unconditionally */ { - /* when using port i/o, the 8-bit data register *always* overlaps - * with half of the 16-bit control register. Hence, the total size - * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the - * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 */ - uint8_t io_size = object_property_get_bool(OBJECT(x86ms->fw_cfg), - "dma_enabled", NULL) ? - ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : - FW_CFG_CTL_SIZE; - scope = aml_scope("\\_SB.PCI0"); - dev = aml_device("FWCF"); - - aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); - - /* device present, functioning, decoding, not shown in UI */ - aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); - - crs = aml_resource_template(); - aml_append(crs, - aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size) - ); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(scope, dev); + fw_cfg_add_acpi_dsdt(scope, x86ms->fw_cfg); aml_append(dsdt, scope); } diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index da60ada594..c55abfb01a 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -15,6 +15,7 @@ #include "qemu/osdep.h" #include "sysemu/numa.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/aml-build.h" #include "hw/firmware/smbios.h" #include "hw/i386/fw_cfg.h" #include "hw/timer/hpet.h" @@ -179,3 +180,30 @@ void fw_cfg_build_feature_control(MachineState *ms, FWCfgState *fw_cfg) *val = cpu_to_le64(feature_control_bits | FEATURE_CONTROL_LOCKED); fw_cfg_add_file(fw_cfg, "etc/msr_feature_control", val, sizeof(*val)); } + +void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg) +{ + /* + * when using port i/o, the 8-bit data register *always* overlaps + * with half of the 16-bit control register. Hence, the total size + * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the + * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 + */ + Object *obj = OBJECT(fw_cfg); + uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ? + ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : + FW_CFG_CTL_SIZE; + Aml *dev = aml_device("FWCF"); + Aml *crs = aml_resource_template(); + + aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); + + /* device present, functioning, decoding, not shown in UI */ + aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); + + aml_append(crs, + aml_io(AML_DECODE16, FW_CFG_IO_BASE, FW_CFG_IO_BASE, 0x01, io_size)); + + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(scope, dev); +} From patchwork Wed Jun 24 23:06:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VO5x8kUh; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf6D1DXSz9sRf for ; Thu, 25 Jun 2020 09:11:32 +1000 (AEST) Received: from localhost ([::1]:57334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEYD-0007QK-Q7 for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:11:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETq-000095-4W for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:58 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50527 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETo-0001RI-9A for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:06:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040015; 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=ToFNM9aVXQBet1ZT+w3NmxhXnSHtmFVtuTLjusFLtHM=; b=VO5x8kUhMOYIcXhVu0EtDxy/GMdl/ftwOaZfpr63tz+UbAFPT+Xg29BgGJS2Fk/RiBQA6g ce3lEahsHiAgC5NiW3mZC3g7xVKNn9lBFme6cYjXUXBT+GHBNbtM5CHmHkfGKnz0qWzcsN Zge04UH6iQA+tcADChFUk2BV3340rGM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-fOE397vhPpW74SRctjRSNQ-1; Wed, 24 Jun 2020 19:06:53 -0400 X-MC-Unique: fOE397vhPpW74SRctjRSNQ-1 Received: by mail-wm1-f69.google.com with SMTP id a18so4645988wmm.3 for ; Wed, 24 Jun 2020 16:06:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ToFNM9aVXQBet1ZT+w3NmxhXnSHtmFVtuTLjusFLtHM=; b=EkBrh9M009b4HvELBMX4EPNTC7TgdW813qwEGOIwj+HEkKz2ypFFNtrrBc6fHuM4AL GkWa7c+lUkjIxh04loXMsILpwuKScSt6ixmN+6aCRA4esdKBTd8ZEz8x4/CA13+HmA7X gznVjcW6UgaVRZfeZdC+Vxw4p2UH8zG2psjdLv8440Y7ZueN8obxb+DyI3nZQ0moLYE/ LNBU93DR8UVpLuMCyeo7X6JqrxjUXxNZIbC4HmAQuS7GGYBptQXG1x25bJ6qcOZFt8yO jUPSrQVG9wlSE7dQstZfEmELwPzB1hzX8qJjsGZBmef/qwYmJsfCRFsmJF/11FslfDnK XBeg== X-Gm-Message-State: AOAM530YZbWA5XVGy4XHq4eNtbKF9PpgkbGWUaye0//CMbTa1LL4ho+q k2G0RddvyMJWJKmQkbD0KNQUbyJhzWqqCdAzLzcast3ty5qhOxIatfbXM/DgSDqbleMNPOiQbwl AwrhjC5IU/5XaSD4= X-Received: by 2002:adf:e40e:: with SMTP id g14mr15027162wrm.271.1593040012245; Wed, 24 Jun 2020 16:06:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvcr5MZAJbcbla0TfBIwcJt5/2SRI/fxVP+qKYbiBzekuqGu1ip0hs7lt45IpzuPJpVASBMA== X-Received: by 2002:adf:e40e:: with SMTP id g14mr15027146wrm.271.1593040012089; Wed, 24 Jun 2020 16:06:52 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id y6sm10454373wmy.0.2020.06.24.16.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:51 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:49 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 08/19] acpi: simplify build_isa_devices_aml() Message-ID: <20200624230609.703104-9-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann x86 machines can have a single ISA bus only. Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200619091905.21676-9-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 19e9c298dc..d27cecc877 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -979,18 +979,14 @@ static void build_isa_devices_aml(Aml *table) { VMBusBridge *vmbus_bridge = vmbus_bridge_find(); bool ambiguous; - - Aml *scope = aml_scope("_SB.PCI0.ISA"); Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); + Aml *scope; - if (ambiguous) { - error_report("Multiple ISA busses, unable to define IPMI ACPI data"); - } else if (!obj) { - error_report("No ISA bus, unable to define IPMI ACPI data"); - } else { - build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); - isa_build_aml(ISA_BUS(obj), scope); - } + assert(obj && !ambiguous); + + scope = aml_scope("_SB.PCI0.ISA"); + build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); + isa_build_aml(ISA_BUS(obj), scope); if (vmbus_bridge) { aml_append(scope, build_vmbus_device_aml(vmbus_bridge)); From patchwork Wed Jun 24 23:06:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=A4lWc5Ly; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf8S2Vk5z9sRf for ; Thu, 25 Jun 2020 09:13:28 +1000 (AEST) Received: from localhost ([::1]:37560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEa6-00035d-0P for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:13:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETs-0000Fq-VS for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:00 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:23435 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETr-0001T8-69 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040018; 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=DkqmilDoYxlrdvOEadJHYOZPGQ72zPB+ueTswvkBgD4=; b=A4lWc5LygmNFDIm3DNYwvhn3CdYOi1ce4fLjTQ/c61LudZtKkOD6RG+XynqfVLuEMGVQAo 4MT9mkbN8W1ELqST8OPzupa12/BrsFZK1ob6/UVrlh0jWyVy8dj4uQRcXu3rSAu9j7eKuL KKqjE5IXkaEHKqFNZfGvrQHAKk1pbBI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-288-sHUR8HAKOlWtqSNKEZDUNQ-1; Wed, 24 Jun 2020 19:06:56 -0400 X-MC-Unique: sHUR8HAKOlWtqSNKEZDUNQ-1 Received: by mail-wr1-f72.google.com with SMTP id w4so2809917wrm.5 for ; Wed, 24 Jun 2020 16:06:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DkqmilDoYxlrdvOEadJHYOZPGQ72zPB+ueTswvkBgD4=; b=FlBvqOTPbl5bxIitV+uzUQae0H2vq/NpJOQnpeL9ogNQbODZ5Ae5v/M/H0dxc+I4V6 qfhXvW3r2FapTwblCMSKaPN9usFX7ZoVo5J1h7ZVNMDUsn+ZWRoqvRFvNbrJ6hh+wGX5 k5fkAuk1JD4ec4Ow/NGqkvuM4yhPYFsmQqtT07C+ccCj5NnT2+ttTg0svO3Nk0NrFr5F P/8iCdYd/SQg86KE0v236PlMkmQoui4rX4JtTOVg/Hg6npwWGzwlwqr5/C/C2WsYpqb0 jBz2ytSXSELVcTvbzNLvwmQVrS8MPsf+UPW/FKsCW/CORKTLLuQCjgZpKUUaXsHwUA5p /7zw== X-Gm-Message-State: AOAM5336Gz5Jf+hKlAbG67wd21iIv2FaXmJvQ1MhlJZiqxu40PlT9p0k PnV8+PrJk/M4rWE7cRbZYChe1fmxUbYtbYVlln5PLeHPEAKh+pzj4hty46gYj0loBWblSLWY7Ah OLLgFNN8/LBxhCJs= X-Received: by 2002:a7b:ce97:: with SMTP id q23mr99007wmj.89.1593040014852; Wed, 24 Jun 2020 16:06:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp1NhzHTme6qLKxQGXsLqANtXaOH2ZjVwQ+zBuD8DhQAi79Stv3ibQjBzElJmCHQrT+ap3cQ== X-Received: by 2002:a7b:ce97:: with SMTP id q23mr98988wmj.89.1593040014620; Wed, 24 Jun 2020 16:06:54 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id 3sm4181906wmi.45.2020.06.24.16.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:54 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:52 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 09/19] acpi: drop serial/parallel enable bits from dsdt Message-ID: <20200624230609.703104-10-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann The _STA methods for COM+LPT used to reference them, but that isn't the case any more. piix4 DSDT changes: Scope (_SB.PCI0) { Device (ISA) { Name (_ADR, 0x00010000) // _ADR: Address OperationRegion (P40C, PCI_Config, 0x60, 0x04) - Field (^PX13.P13C, AnyAcc, NoLock, Preserve) - { - Offset (0x5F), - , 7, - LPEN, 1, - Offset (0x67), - , 3, - CAEN, 1, - , 3, - CBEN, 1 - } } } ich9 DSDT changes: Scope (_SB.PCI0) { Device (ISA) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) OperationRegion (LPCD, PCI_Config, 0x80, 0x02) Field (LPCD, AnyAcc, NoLock, Preserve) { COMA, 3, , 1, COMB, 3, Offset (0x01), LPTD, 2 } - - OperationRegion (LPCE, PCI_Config, 0x82, 0x02) - Field (LPCE, AnyAcc, NoLock, Preserve) - { - CAEN, 1, - CBEN, 1, - LPEN, 1 - } } } Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Message-Id: <20200619091905.21676-10-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index d27cecc877..ffbdbee51a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1360,15 +1360,6 @@ static void build_q35_isa_bridge(Aml *table) aml_append(field, aml_named_field("LPTD", 2)); aml_append(dev, field); - aml_append(dev, aml_operation_region("LPCE", AML_PCI_CONFIG, - aml_int(0x82), 0x02)); - /* enable bits */ - field = aml_field("LPCE", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE); - aml_append(field, aml_named_field("CAEN", 1)); - aml_append(field, aml_named_field("CBEN", 1)); - aml_append(field, aml_named_field("LPEN", 1)); - aml_append(dev, field); - aml_append(scope, dev); aml_append(table, scope); } @@ -1392,7 +1383,6 @@ static void build_piix4_isa_bridge(Aml *table) { Aml *dev; Aml *scope; - Aml *field; scope = aml_scope("_SB.PCI0"); dev = aml_device("ISA"); @@ -1401,19 +1391,6 @@ static void build_piix4_isa_bridge(Aml *table) /* PIIX PCI to ISA irq remapping */ aml_append(dev, aml_operation_region("P40C", AML_PCI_CONFIG, aml_int(0x60), 0x04)); - /* enable bits */ - field = aml_field("^PX13.P13C", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE); - /* Offset(0x5f),, 7, */ - aml_append(field, aml_reserved_field(0x2f8)); - aml_append(field, aml_reserved_field(7)); - aml_append(field, aml_named_field("LPEN", 1)); - /* Offset(0x67),, 3, */ - aml_append(field, aml_reserved_field(0x38)); - aml_append(field, aml_reserved_field(3)); - aml_append(field, aml_named_field("CAEN", 1)); - aml_append(field, aml_reserved_field(3)); - aml_append(field, aml_named_field("CBEN", 1)); - aml_append(dev, field); aml_append(scope, dev); aml_append(table, scope); From patchwork Wed Jun 24 23:06:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316635 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dmGlODnJ; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf5713bJz9sSn for ; Thu, 25 Jun 2020 09:10:35 +1000 (AEST) Received: from localhost ([::1]:53640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEXI-0005p1-R5 for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:10:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETw-0000K8-1u for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52423 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETu-0001Ul-A4 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040021; 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=OrDy+2bSGC3EvnrEAuXyXBzNgsnQeum1itKPO21c+vk=; b=dmGlODnJOspocfDmQBtvz/pkYNit2xr4cHfkOXYqT3JCdFcIAa2B7MFgf2dAGCX/Ny1VJN hAVN0IzptXpsfOnSPe24laRD+Q00mEx69yLKMDWtCyXKO9Kel+ggVVRvi1wMtvYrmKsSp8 W8xZ9LmggrMGwOUtVSj7m5kvIFL9sek= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-432-IEfoCfwOMj6aDKgvnc1kMA-1; Wed, 24 Jun 2020 19:06:59 -0400 X-MC-Unique: IEfoCfwOMj6aDKgvnc1kMA-1 Received: by mail-wm1-f69.google.com with SMTP id a21so4588766wmd.0 for ; Wed, 24 Jun 2020 16:06:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OrDy+2bSGC3EvnrEAuXyXBzNgsnQeum1itKPO21c+vk=; b=EpdNFbugE6r6ZF5dO5n01ev5PcVbAeX3SCErZ4My0HrpDWV0IN4wRia0P7GKzGaHJ4 OFyAjEcAAI4iIf3xeUClPVQnNLfub657zA5T9L91Piiy5UHo8eMBnZB48BgMVhjJTpjX 6mmdmoeGwRmJ9sJLJHcQAqQtsOaGNM6CqVIYwEkCwrAojEt+JxIS8+xBMxut4b//eeTM lRwPATI9MGkvHJ77Im2vAscyAW7Yw8psZ54xLcUtG8ZPYPc6ftHFgaUyTkCBWlpEl3LD HOuoebaOEFFLQHxBNOeZBogvk5eOcGYep21gj4qfkT6bvOtFz5xAHZciJWoDs6AvcmmL yImQ== X-Gm-Message-State: AOAM533B5lbwSu7B0O0BNccwgE+459Uhjbf4esIjIoQuuwmna3j9D8X4 z9IvXWRf0ADMmmjpDB5UjqGmbU0+bOrLWBRnFnL5frqvagHjjTfDMLsoPGPzpdSgjxbSmHTm2g4 pdGx74pTgM1RTCHQ= X-Received: by 2002:a5d:664a:: with SMTP id f10mr33505922wrw.300.1593040017680; Wed, 24 Jun 2020 16:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9PT1kTteKSaNNFWjTQ2x+g8uAJj/OQBtYL+CHh+6oI5Fd+TbLDbwVHIfQ5c4N47O7lkx5iw== X-Received: by 2002:a5d:664a:: with SMTP id f10mr33505909wrw.300.1593040017464; Wed, 24 Jun 2020 16:06:57 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id u15sm23548697wrm.64.2020.06.24.16.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:56 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:55 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 10/19] acpi: drop build_piix4_pm() Message-ID: <20200624230609.703104-11-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 03:27:53 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedow , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann The _SB.PCI0.PX13.P13C opregion (holds isa device enable bits) is not used any more, remove it from DSDT. piix4 DSDT changes: Scope (_SB.PCI0) { - Device (PX13) - { - Name (_ADR, 0x00010003) // _ADR: Address - OperationRegion (P13C, PCI_Config, Zero, 0xFF) - } - } - - Scope (_SB.PCI0) - { Device (ISA) { Name (_ADR, 0x00010000) // _ADR: Address OperationRegion (P40C, PCI_Config, 0x60, 0x04) } } Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedow Message-Id: <20200619091905.21676-11-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ffbdbee51a..59f1b4d890 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1364,21 +1364,6 @@ static void build_q35_isa_bridge(Aml *table) aml_append(table, scope); } -static void build_piix4_pm(Aml *table) -{ - Aml *dev; - Aml *scope; - - scope = aml_scope("_SB.PCI0"); - dev = aml_device("PX13"); - aml_append(dev, aml_name_decl("_ADR", aml_int(0x00010003))); - - aml_append(dev, aml_operation_region("P13C", AML_PCI_CONFIG, - aml_int(0x00), 0xff)); - aml_append(scope, dev); - aml_append(table, scope); -} - static void build_piix4_isa_bridge(Aml *table) { Aml *dev; @@ -1530,7 +1515,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dsdt, sb_scope); build_hpet_aml(dsdt); - build_piix4_pm(dsdt); build_piix4_isa_bridge(dsdt); build_isa_devices_aml(dsdt); build_piix4_pci_hotplug(dsdt); From patchwork Wed Jun 24 23:06:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gN7aLmEr; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf7P230Sz9sRf for ; Thu, 25 Jun 2020 09:12:33 +1000 (AEST) Received: from localhost ([::1]:33824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEZC-0001IY-Pq for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:12:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joETy-0000N6-BV for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:06 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:26865 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joETw-0001Vk-Go for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040023; 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=XlFSgiVnedcPbHMPcza92pu5ADeDm2yfx70RS10qWhY=; b=gN7aLmEre2CHmt2pxcmHmMc/YoE2pYMOYmlye6z1rGHmfmw6cupXyImuFEV6kS4pYo+IJ3 o6PTHgW4zE2oCwWiwlky4kELbpVheDJ0tIEymGocYTRR81+S5uljtV9NhbaGzIc3utqo9k 8/UUIrs1oIFj0huX7wdKqSA175hswVk= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-aLzSSXkwMSWJuh8zl_AE0w-1; Wed, 24 Jun 2020 19:07:01 -0400 X-MC-Unique: aLzSSXkwMSWJuh8zl_AE0w-1 Received: by mail-wr1-f69.google.com with SMTP id g14so4715533wrp.8 for ; Wed, 24 Jun 2020 16:07:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XlFSgiVnedcPbHMPcza92pu5ADeDm2yfx70RS10qWhY=; b=ENp9Z/L7unfLYCqx+nNTWo0sbqDw9IvSfYu4aZsE3iJnNS34WkYEW2VIRDzpSdPC7M kxeZf1xrTDrHzX5CWjapYehEyM4nlpO5Ic4fLbBqFifqOeyboyhsREFHjZ7hxYd8EvDw hhPmlzytCQIfEEFdD+71OP5UDempjzmDAsOiHAZBSGcdc3grrMyvO06SHy1ALaCUNLyu Oo184i8V8K+omiAzGynOdbpmcH1gvL2uRxEwrpQ8lsJzlM/6XxNIwQxDhHRieozlU09+ 0ezbMN4P1J4Ch4uQVq4i8pyAgaUvxPg/Mq68u3Wh5RG3Jb23n6XQozE1aicgeVwynHly ItiQ== X-Gm-Message-State: AOAM532fo3/EhUJI5xCbY5U4IleWBs+HQfZ5qN8hET0J3vIx86keyQoy CaVpLc5UAa3ZOwJT6OXNGXFVC8xBK4d9LOUVAiKfMQncxODUoptxPyAATxutobs959iCqbrewTe F9cs6CP2vuVVq7dM= X-Received: by 2002:a1c:7e52:: with SMTP id z79mr133112wmc.104.1593040020375; Wed, 24 Jun 2020 16:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/+ly/FKD5+cQ9M7V0rzjx9wLH+MmfnUk2RtTQjBDo/b4nnBiXpwDJKCGheg8UipldjpnlAg== X-Received: by 2002:a1c:7e52:: with SMTP id z79mr133087wmc.104.1593040020149; Wed, 24 Jun 2020 16:07:00 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id q1sm14484983wro.82.2020.06.24.16.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:06:59 -0700 (PDT) Date: Wed, 24 Jun 2020 19:06:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 11/19] acpi: q35: drop _SB.PCI0.ISA.LPCD opregion. Message-ID: <20200624230609.703104-12-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , Gerd Hoffmann , Igor Mammedov , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Seems to be unused. ich9 DSDT changes: Scope (_SB.PCI0) { Device (ISA) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) - OperationRegion (LPCD, PCI_Config, 0x80, 0x02) - Field (LPCD, AnyAcc, NoLock, Preserve) - { - COMA, 3, - , 1, - COMB, 3, - Offset (0x01), - LPTD, 2 - } } } Signed-off-by: Gerd Hoffmann Reviewed-by: Igor Mammedov Message-Id: <20200619091905.21676-12-kraxel@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 59f1b4d890..378515df66 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1340,7 +1340,6 @@ static void build_q35_isa_bridge(Aml *table) { Aml *dev; Aml *scope; - Aml *field; scope = aml_scope("_SB.PCI0"); dev = aml_device("ISA"); @@ -1350,16 +1349,6 @@ static void build_q35_isa_bridge(Aml *table) aml_append(dev, aml_operation_region("PIRQ", AML_PCI_CONFIG, aml_int(0x60), 0x0C)); - aml_append(dev, aml_operation_region("LPCD", AML_PCI_CONFIG, - aml_int(0x80), 0x02)); - field = aml_field("LPCD", AML_ANY_ACC, AML_NOLOCK, AML_PRESERVE); - aml_append(field, aml_named_field("COMA", 3)); - aml_append(field, aml_reserved_field(1)); - aml_append(field, aml_named_field("COMB", 3)); - aml_append(field, aml_reserved_field(1)); - aml_append(field, aml_named_field("LPTD", 2)); - aml_append(dev, field); - aml_append(scope, dev); aml_append(table, scope); } From patchwork Wed Jun 24 23:07:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TJWQHqRA; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf682QPsz9sRf for ; Thu, 25 Jun 2020 09:11:28 +1000 (AEST) Received: from localhost ([::1]:56942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEY9-0007FS-TN for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:11:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUC-0000p1-62 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:20 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:54813 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEU6-0001fL-G2 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040033; 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=nBtOThswta21xs6hvx04p8u9gjPXfF6q3aEihEmOyno=; b=TJWQHqRAcZD/nXYbKHUz2dSRJMCJ2Wf+Ox3PXlo/AX7KT3Eu9FdS/PjNWz4/s/XqRszppa y+5RPQ6Msdbx0BWTz1q28bpOZkj7GbFZNNgQwZp2U2YWb+T1GAjHrRnCYEfd2RHIoYGsaq jIXoEfSxyxDoud72YKuxp4JtY5t763Y= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-pmeJit2_P8GhBFblmooV-g-1; Wed, 24 Jun 2020 19:07:06 -0400 X-MC-Unique: pmeJit2_P8GhBFblmooV-g-1 Received: by mail-wm1-f71.google.com with SMTP id h6so4608448wmb.7 for ; Wed, 24 Jun 2020 16:07:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=nBtOThswta21xs6hvx04p8u9gjPXfF6q3aEihEmOyno=; b=az0dgssZBxClXa7+LL4lOPVlLw0aDG7Qd84npUafyw7s3kmcSjiIQS6C10S21qIr0h IjprzhLgu1n6CSQU9wjMJuMjPZRzi5n/yqzaaYlXx2TjfbMsbGAPbL4HGOU6lgxAFvx1 ib7inb2BLcQQxea66fr8CHSJWI0gRQ7wdQhuxgCt2RJXbq+b3mcTYNs91dJB1dS2R+H4 VHAIn6V5Nu84JCNQOI2lTCfcVmb/MoW6r91iNHuZBMXDLgZBdvFi5nLBG3HG9MbViIwW zfvlugu89JmDTylq2RVYN8bmDn3+6dKW2cnrdNxPLSeRgUkAcLrIExK6tEXPthT+Ifhl 2FNQ== X-Gm-Message-State: AOAM530GJRapWChgKkfNit94/Mzb/nZeTgFeaTZaHqCAhPqrAjz0WwJ1 0XHZX+/OcknisrrvQ9K7UeJEYOS8vIaGSgBwUTPJNh218w9aGYxPJOOevCGiRhjs+r6lDclk20U vB+4tkDvIKCmNpik= X-Received: by 2002:a5d:4307:: with SMTP id h7mr1349443wrq.241.1593040025282; Wed, 24 Jun 2020 16:07:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG6ebJEAgXsxgsMH0TbzwT43ebkw69AyLPa1sgA7pFhH2COyMru6Qjom4mpTv3stnV0QgVCQ== X-Received: by 2002:a5d:4307:: with SMTP id h7mr1349433wrq.241.1593040025070; Wed, 24 Jun 2020 16:07:05 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id v20sm29602988wrb.51.2020.06.24.16.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:04 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:02 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 13/19] acpi: Some build_tpm2() code reshape Message-ID: <20200624230609.703104-14-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov , Stefan Berger , Ard Biesheuvel , Eric Auger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger Remove any reference to Acpi20TPM2 and adopt an implementation similar to build_ghes_v2(). Signed-off-by: Eric Auger Suggested-by: Igor Mammedov Reviewed-by: Stefan Berger Tested-by: Stefan Berger Reviewed-by: Igor Mammedov Message-Id: <20200622140620.17229-2-eric.auger@redhat.com> Tested-by: Ard Biesheuvel Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/acpi-defs.h | 18 ------------- hw/acpi/aml-build.c | 51 +++++++++++++++++++++++-------------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index 3be9ab5049..38a42f409a 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -465,24 +465,6 @@ struct Acpi20Tcpa { } QEMU_PACKED; typedef struct Acpi20Tcpa Acpi20Tcpa; -/* - * TPM2 - * - * Following Version 1.2, Revision 8 of specs: - * https://trustedcomputinggroup.org/tcg-acpi-specification/ - */ -struct Acpi20TPM2 { - ACPI_TABLE_HEADER_DEF - uint16_t platform_class; - uint16_t reserved; - uint64_t control_area_address; - uint32_t start_method; - uint8_t start_method_params[12]; - uint32_t log_area_minimum_length; - uint64_t log_area_start_address; -} QEMU_PACKED; -typedef struct Acpi20TPM2 Acpi20TPM2; - /* DMAR - DMA Remapping table r2.2 */ struct AcpiTableDmar { ACPI_TABLE_HEADER_DEF diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 2cb7b991ef..f6fbc9b95d 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -1878,48 +1878,61 @@ build_hdr: "FACP", tbl->len - fadt_start, f->rev, oem_id, oem_table_id); } +/* + * build_tpm2 - Build the TPM2 table as specified in + * table 7: TCG Hardware Interface Description Table Format for TPM 2.0 + * of TCG ACPI Specification, Family “1.2” and “2.0”, Version 1.2, Rev 8 + */ void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) { - Acpi20TPM2 *tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); - unsigned log_addr_size = sizeof(tpm2_ptr->log_area_start_address); - unsigned log_addr_offset = - (char *)&tpm2_ptr->log_area_start_address - table_data->data; uint8_t start_method_params[12] = {}; + unsigned log_addr_offset, tpm2_start; + uint64_t control_area_start_address; TPMIf *tpmif = tpm_find(); + uint32_t start_method; + void *tpm2_ptr; - /* platform class */ + tpm2_start = table_data->len; + tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); + + /* Platform Class */ build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); - /* reserved */ + /* Reserved */ build_append_int_noprefix(table_data, 0, 2); if (TPM_IS_TIS_ISA(tpmif) || TPM_IS_TIS_SYSBUS(tpmif)) { - /* address of control area */ - build_append_int_noprefix(table_data, 0, 8); - /* start method */ - build_append_int_noprefix(table_data, TPM2_START_METHOD_MMIO, 4); + control_area_start_address = 0; + start_method = TPM2_START_METHOD_MMIO; } else if (TPM_IS_CRB(tpmif)) { - build_append_int_noprefix(table_data, TPM_CRB_ADDR_CTRL, 8); - build_append_int_noprefix(table_data, TPM2_START_METHOD_CRB, 4); + control_area_start_address = TPM_CRB_ADDR_CTRL; + start_method = TPM2_START_METHOD_CRB; } else { - g_warn_if_reached(); + g_assert_not_reached(); } + /* Address of Control Area */ + build_append_int_noprefix(table_data, control_area_start_address, 8); + /* Start Method */ + build_append_int_noprefix(table_data, start_method, 4); - /* platform specific parameters */ - g_array_append_vals(table_data, &start_method_params, 12); + /* Platform Specific Parameters */ + g_array_append_vals(table_data, &start_method_params, + ARRAY_SIZE(start_method_params)); - /* log area minimum length */ + /* Log Area Minimum Length */ build_append_int_noprefix(table_data, TPM_LOG_AREA_MINIMUM_SIZE, 4); acpi_data_push(tcpalog, TPM_LOG_AREA_MINIMUM_SIZE); bios_linker_loader_alloc(linker, ACPI_BUILD_TPMLOG_FILE, tcpalog, 1, false); - /* log area start address to be filled by Guest linker */ + log_addr_offset = table_data->len; + + /* Log Area Start Address to be filled by Guest linker */ build_append_int_noprefix(table_data, 0, 8); bios_linker_loader_add_pointer(linker, ACPI_BUILD_TABLE_FILE, - log_addr_offset, log_addr_size, + log_addr_offset, 8, ACPI_BUILD_TPMLOG_FILE, 0); build_header(linker, table_data, - (void *)tpm2_ptr, "TPM2", sizeof(*tpm2_ptr), 4, NULL, NULL); + tpm2_ptr, "TPM2", table_data->len - tpm2_start, 4, NULL, NULL); } /* ACPI 5.0: 6.4.3.8.2 Serial Bus Connection Descriptors */ From patchwork Wed Jun 24 23:07:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cKE9YOcU; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf9t63Hjz9sRf for ; Thu, 25 Jun 2020 09:14:42 +1000 (AEST) Received: from localhost ([::1]:42196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEbI-0005Dr-GJ for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:14:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEU7-0000kY-Ie for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:15 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34226 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEU5-0001eV-Sw for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040033; 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=SQTJT5wD23Ewuir8n5bTPAK5U6CWsgr7NunGte4p7ow=; b=cKE9YOcUwQwaTHRgUQW8/z7krYHwRvQMcUJp9V9T5pNVPt+317bYC1emLGUJajlzGSnRv+ /XDMlSKaC+ZEyxKWD9WjcR+4AcM5WrrwRgYzEhqyzs824JPIn+oVbj9SIsgf0kEDsgeICG ZaR0JeHy1atHNi8IKm82A2Fl6QZBqdE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-2e211tEyMTuI_3fk2u1_Gw-1; Wed, 24 Jun 2020 19:07:09 -0400 X-MC-Unique: 2e211tEyMTuI_3fk2u1_Gw-1 Received: by mail-wm1-f72.google.com with SMTP id o138so3541664wme.4 for ; Wed, 24 Jun 2020 16:07:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SQTJT5wD23Ewuir8n5bTPAK5U6CWsgr7NunGte4p7ow=; b=I63H43w5EHA2YYMOSZ6KWTsKAXK7p0dh9Dgl+hm4XsWGjnNqZ9vqh7RQXBwc0+XXC+ QZ/v9aQ2b5RgPRRjPaZ6HqKycgOQ5by2A5XmslZFETNEIDcZbgUidBKw6jg78eEVOyQJ zvglcyw+U3hUTI+NsNLg/3bghVf0jHu4GYL0yS2wNk1ZPsVr6R/mM5ZT55WIhLTNShD8 ImnHJGU14TwBeLPndgmlEPgMEonbfUjPjGqtG5PwBogFfdDXa+93OrzKIN8e4pcoHw9n +WAddt5GVglBjzeSU+uQ1nzvP6Ycb/aLOrwbBZM+KmpRvwqyyRr9gAFa/w7rx7I3dHrq aEiA== X-Gm-Message-State: AOAM531MNfvazhUOxQTE6IOXmoEoQTgwPz62dDytxjeBIz3VewrYexh/ HdciaXZJaZ1nQJkTfhVlfinSvyyr17deSiAyUfSRYnUozCuT58qkP5kSXsQtI+W5KZBJIbnM1ny jdRkiQF1NRJMjzC4= X-Received: by 2002:a5d:5549:: with SMTP id g9mr30907635wrw.419.1593040027795; Wed, 24 Jun 2020 16:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1RMAqt9WNySzVX1iZbayqEIAQT5cW9NJNo4TdHVTf4DSak64GFPRHXQ0x92CSagYmJ/fsyg== X-Received: by 2002:a5d:5549:: with SMTP id g9mr30907620wrw.419.1593040027627; Wed, 24 Jun 2020 16:07:07 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id x5sm10239713wmg.2.2020.06.24.16.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:07 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:05 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 14/19] arm/acpi: Add the TPM2.0 device under the DSDT Message-ID: <20200624230609.703104-15-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eric Auger , Shannon Zhao , qemu-arm@nongnu.org, Igor Mammedov , Ard Biesheuvel , Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger In case it is dynamically instantiated, add the TPM 2.0 device object under the DSDT table in the ACPI namespace. Its HID is MSFT0101 while its current resource settings (CRS) property is initialized with the guest physical address and MMIO size of the device. Signed-off-by: Eric Auger Reviewed-by: Stefan Berger Reviewed-by: Igor Mammedov Message-Id: <20200622140620.17229-3-eric.auger@redhat.com> Tested-by: Ard Biesheuvel Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/arm/virt-acpi-build.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index ca31f70f7f..1384a2cf2a 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -46,6 +46,7 @@ #include "hw/pci/pci.h" #include "hw/arm/virt.h" #include "hw/mem/nvdimm.h" +#include "hw/platform-bus.h" #include "sysemu/numa.h" #include "sysemu/reset.h" #include "sysemu/tpm.h" @@ -364,6 +365,38 @@ static void acpi_dsdt_add_power_button(Aml *scope) aml_append(scope, dev); } +static void acpi_dsdt_add_tpm(Aml *scope, VirtMachineState *vms) +{ + PlatformBusDevice *pbus = PLATFORM_BUS_DEVICE(vms->platform_bus_dev); + hwaddr pbus_base = vms->memmap[VIRT_PLATFORM_BUS].base; + SysBusDevice *sbdev = SYS_BUS_DEVICE(tpm_find()); + MemoryRegion *sbdev_mr; + hwaddr tpm_base; + + if (!sbdev) { + return; + } + + tpm_base = platform_bus_get_mmio_addr(pbus, sbdev, 0); + assert(tpm_base != -1); + + tpm_base += pbus_base; + + sbdev_mr = sysbus_mmio_get_region(sbdev, 0); + + Aml *dev = aml_device("TPM0"); + aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); + aml_append(dev, aml_name_decl("_UID", aml_int(0))); + + Aml *crs = aml_resource_template(); + aml_append(crs, + aml_memory32_fixed(tpm_base, + (uint32_t)memory_region_size(sbdev_mr), + AML_READ_WRITE)); + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(scope, dev); +} + static void build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) { @@ -762,6 +795,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) } acpi_dsdt_add_power_button(scope); + acpi_dsdt_add_tpm(scope, vms); aml_append(dsdt, scope); From patchwork Wed Jun 24 23:07:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316643 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fN7/5qv5; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf9v12ymz9sSn for ; Thu, 25 Jun 2020 09:14:43 +1000 (AEST) Received: from localhost ([::1]:42256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEbI-0005FC-RL for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:14:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUF-0000wz-A4 for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:23 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46810 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEUB-0001ga-RZ for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040037; 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=P2QwBFExPnrm+QSOonZAHZYTv+JWyU5E11O8o1MzXlk=; b=fN7/5qv5DRGaJhmlymLI3YEoTYr6CG2sKyjOr7rXuAy09+xFZ3l01K8GNkjDdepu4vjrwe H7PH/XakQQAYBxGAqFCiH+IWzhbpe1W20oHf0vmGsDXQG0eS1LC7QiLTZIJ6SoRkxAPkCK ZOx6opddj1bk5/fBaPwnxKGinkP3XKU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-25-jRsTOEvsMGSh30DSeKQmEA-1; Wed, 24 Jun 2020 19:07:12 -0400 X-MC-Unique: jRsTOEvsMGSh30DSeKQmEA-1 Received: by mail-wm1-f70.google.com with SMTP id o13so4786912wmh.9 for ; Wed, 24 Jun 2020 16:07:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=P2QwBFExPnrm+QSOonZAHZYTv+JWyU5E11O8o1MzXlk=; b=rXHAN28huY4/2I+6pStNGyQM3NWG8qB6jwiKs/XaeIzkEdp5haBl9P1klieh1KKiS0 YinAJ/rw6qYcm1nTUOn8jByVwtepQaVYuPs8A2FGn6BWbf/MJo8YJa4WeQh+CBpdnWDB gYskn7l2n9M7mGuOR1MANiS1vLADnpBHolbM3lmsE3TFubeW9ihyIgQj50cpc+NdwrUA TFs4d46UWFYuE7zgdYFEnLOndX1h61pj5Ba0X6wfYC6VX9Bn2aiW7M/67A6Mloyi1khH nbGTVn1jJ7D7W12YCpjY8EkWBBIbmoKXR8feMHtQcs1P2NPOx2/V4u3xLB+ErJHz2beZ 0EEA== X-Gm-Message-State: AOAM532vtsAA16QaLbQ2tfx7cEmZ1kjZ5b8tjwnzwVEiyUR3tqNfLzkM G3UfBabQ/QCDcZpQWCZ5a7h2Qa7qSrBwVoGnfAqh16yLvvQ6OIoOykuPTu1PSchvqpWzJYUYViX snOMZw+xkA37IDkk= X-Received: by 2002:a5d:40c9:: with SMTP id b9mr2379698wrq.425.1593040030362; Wed, 24 Jun 2020 16:07:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze2iV2qsngQG7j3SZlkR/9CJ+L5U0si23SP92JJig0dRqd2ib5WamexHA5Mnd7nndhDrokFQ== X-Received: by 2002:a5d:40c9:: with SMTP id b9mr2379685wrq.425.1593040030192; Wed, 24 Jun 2020 16:07:10 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id j41sm30234145wre.12.2020.06.24.16.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:09 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:07 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 15/19] docs/specs/tpm: ACPI boot now supported for TPM/ARM Message-ID: <20200624230609.703104-16-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 02:33:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eric Auger , =?utf-8?q?Marc-Andr=C3=A9?= Lureau , Igor Mammedov , David Gibson , Ard Biesheuvel , Stefan Berger Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eric Auger ACPI boot now is supported. Let's remove the comment saying it is not. Signed-off-by: Eric Auger Reviewed-by: Stefan Berger Reviewed-by: Igor Mammedov Message-Id: <20200622140620.17229-4-eric.auger@redhat.com> Tested-by: Ard Biesheuvel Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- docs/specs/tpm.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst index 5e61238bc5..eeeb93730a 100644 --- a/docs/specs/tpm.rst +++ b/docs/specs/tpm.rst @@ -346,8 +346,6 @@ In case an Arm virt machine is emulated, use the following command line: -drive if=pflash,format=raw,file=flash0.img,readonly \ -drive if=pflash,format=raw,file=flash1.img - On Arm, ACPI boot with TPM is not yet supported. - In case SeaBIOS is used as firmware, it should show the TPM menu item after entering the menu with 'ESC'. From patchwork Wed Jun 24 23:07:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IhHMdQRy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sfCt0w3wz9sSn for ; Thu, 25 Jun 2020 09:16:26 +1000 (AEST) Received: from localhost ([::1]:49792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEcx-00014L-Rd for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:16:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUD-0000sv-TO for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:21 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:20260 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEUB-0001gX-Qb for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040036; 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=MdpySV97K79Gyh8zeUujKQRFRgwzwS9j5RkITL/a4rs=; b=IhHMdQRyfg0yKudBZbrIjxA/OKFgD156iHX2KLOBwWxKxrYWYstGoMQzzbZWD7edQiXq75 9nzzVyscmiyRv6yRODJcIGugUxbhJlw/YbXqVUzR8qBj/zPz11pyEOryo1jVut5cAQwlcN ACf9iivoRZzrBZxXcVkZSCx4wIuu9Nc= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-FWuq9w9sN5yCtCdNgf7K5g-1; Wed, 24 Jun 2020 19:07:14 -0400 X-MC-Unique: FWuq9w9sN5yCtCdNgf7K5g-1 Received: by mail-wr1-f69.google.com with SMTP id a18so4704504wrm.14 for ; Wed, 24 Jun 2020 16:07:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MdpySV97K79Gyh8zeUujKQRFRgwzwS9j5RkITL/a4rs=; b=RWxLs1Hbsd/5kdikz++wfKntjd5aRddU+l5FYzD8Gx0kKaZKTr969ae2S+NfyW31lc VoInTemXXkZNukQgizvJj+XbLVfwQWwhYJ7MMoiqGTZ9yvcKuaWf5QjZEhGEQFa8ddNV uKbAut5R/GKoSRa1M+k7uh2zuFYEtH3e4Evrd0jTMm99SbLhZsGFgX5D00tjlDPKqZoK poy2/pk6yLulOUkGJDKoF06Z9kmzdyHTIIJCJTW1jjx7VGtVbRDNqvgP1RJU9BnOgISG Qz/7QW8V62Ja5MLmcyq3ujo2ckHWqBw/dE7tP0+inq+/AbMpZskIarlKN7jMpMeTwYFS +0bA== X-Gm-Message-State: AOAM530rWoS8QC655HxioaROCq4/LP98KBCYKtXuOKWvw5Mgi/uZtrcz yznMR405R2rCyk5g/BJEqz9sAnwGUqjqB5oSaqRqleBuoRNwWK0c4RqjuY9FcdNaHgzunfTiZpX Z2h/8ik8iC+stKQI= X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr115014wme.152.1593040032685; Wed, 24 Jun 2020 16:07:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTRFDDBThaWTuJAY59AlbPE0ZSyPfdvKebKQSOi4xN/awIUuLly0594cjWVF9MndH6JPfNZg== X-Received: by 2002:a1c:a3c5:: with SMTP id m188mr115002wme.152.1593040032495; Wed, 24 Jun 2020 16:07:12 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id y19sm9316412wmi.6.2020.06.24.16.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:11 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:10 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 16/19] Stop vhost-user sending uninitialized mmap_offsets Message-ID: <20200624230609.703104-17-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Raphael Norwitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Raphael Norwitz Prior to this change, the vhost_user_fill_msg_region function filled out all elements of the VhostUserMemoryRegion struct except the mmap_offset. This function is often called on uninitialized structs, which are then copied into VHOST_USER_SET_MEM_TABLE and VHOST_USER_ADD/REM_MEM_REG messages. In some cases, where the mmap_offset was not needed, it was left uninitialized, causing QEMU to send the backend uninitialized data, which Coverity flagged as a series of issues. This change augments the vhost_user_fill_msg_region API, adding a mmap_offset paramenter, forcing the caller to initialize mmap_offset. Fixes: ece99091c2d0aeb23734289a50ef2ff4e0a08929 Fixes: f1aeb14b0809e313c74244d838645ed25e85ea63 Reported-by: Coverity (CIDs 1429802, 1429803 and 1429804) Suggested-by: Peter Maydell Signed-off-by: Raphael Norwitz Message-Id: <1592650156-25845-1-git-send-email-raphael.norwitz@nutanix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Maydell Reviewed-by: Stefan Hajnoczi --- hw/virtio/vhost-user.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 4d6cd4e58a..31231218dc 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -460,12 +460,14 @@ static MemoryRegion *vhost_user_get_mr_data(uint64_t addr, ram_addr_t *offset, } static void vhost_user_fill_msg_region(VhostUserMemoryRegion *dst, - struct vhost_memory_region *src) + struct vhost_memory_region *src, + uint64_t mmap_offset) { assert(src != NULL && dst != NULL); dst->userspace_addr = src->userspace_addr; dst->memory_size = src->memory_size; dst->guest_phys_addr = src->guest_phys_addr; + dst->mmap_offset = mmap_offset; } static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u, @@ -500,9 +502,8 @@ static int vhost_user_fill_set_mem_table_msg(struct vhost_user *u, error_report("Failed preparing vhost-user memory table msg"); return -1; } - vhost_user_fill_msg_region(®ion_buffer, reg); + vhost_user_fill_msg_region(®ion_buffer, reg, offset); msg->payload.memory.regions[*fd_num] = region_buffer; - msg->payload.memory.regions[*fd_num].mmap_offset = offset; fds[(*fd_num)++] = fd; } else if (track_ramblocks) { u->region_rb_offset[i] = 0; @@ -649,7 +650,7 @@ static int send_remove_regions(struct vhost_dev *dev, if (fd > 0) { msg->hdr.request = VHOST_USER_REM_MEM_REG; - vhost_user_fill_msg_region(®ion_buffer, shadow_reg); + vhost_user_fill_msg_region(®ion_buffer, shadow_reg, 0); msg->payload.mem_reg.region = region_buffer; if (vhost_user_write(dev, msg, &fd, 1) < 0) { @@ -709,9 +710,8 @@ static int send_add_regions(struct vhost_dev *dev, u->region_rb[reg_idx] = mr->ram_block; } msg->hdr.request = VHOST_USER_ADD_MEM_REG; - vhost_user_fill_msg_region(®ion_buffer, reg); + vhost_user_fill_msg_region(®ion_buffer, reg, offset); msg->payload.mem_reg.region = region_buffer; - msg->payload.mem_reg.region.mmap_offset = offset; if (vhost_user_write(dev, msg, &fd, 1) < 0) { return -1; From patchwork Wed Jun 24 23:07:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BxTddLnK; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sfFc3TwGz9sRW for ; Thu, 25 Jun 2020 09:17:54 +1000 (AEST) Received: from localhost ([::1]:52978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEeN-0002RL-DW for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:17:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUF-0000yR-IT for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:23 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:23981 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEUD-0001iK-IG for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040040; 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=GrIw3oNFPuimxxA3bj46vEVZmWwWe/K09lvhh8ororc=; b=BxTddLnKN2nXyrvhpzWtmgHz05Js+pk34mnVH3Zp2B6DEkjxPizedNQjWHo6fXwhQN2Drq jyldFrDI+49PdFdtDtgJrh+Rjl+aHycTBckwWrs8FpETNaWURFF4CwHBMz3FGVqH1jiQLd Y8i/iXVBA5TSP51KR3gpIlxuMDSUEaI= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-158-wQbgNtHlN-izSKfsT1xwLQ-1; Wed, 24 Jun 2020 19:07:16 -0400 X-MC-Unique: wQbgNtHlN-izSKfsT1xwLQ-1 Received: by mail-wr1-f69.google.com with SMTP id a6so4735195wrq.3 for ; Wed, 24 Jun 2020 16:07:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GrIw3oNFPuimxxA3bj46vEVZmWwWe/K09lvhh8ororc=; b=sZ0OEuwE+DDfthXoGjljlGHCDwjymM1rSYgGnpAOrfapw8y1kcF496FjJrOCwZfIx6 5Q2/GsVWdngngA966WFeACyato/JQ18hAKi1RH77B8urT7Mt3sTIH+ImcQ6c1WTeLU1I GN9HVe2RBBieadkyuB9gwjE/Fc2uVl44rIxhjFwx3yjLpYfHk4ulautecfjKa/CU0hTt TDzdvaj+oi5EJz3G0pF0LUSjpAMVNckskDGEkmU2P79LaHsF/nK3572G/krkJycYOb0z oETW3Nap8Kms3FVmQN2sF1Rw3sAbfOK5fAvl/u4ZzAeRr78IAYADhMALobFLUIQ2IUe9 +SPQ== X-Gm-Message-State: AOAM532WiO4PcY0cqIhYafzfhtzi2S2Ad/5/Twx09vduy1VS/sM2Ivne /pAw4sK4BGM9nDLJvwB0oJkEOICYcZPAKbKATCozaTIjK5t9T4uJi9lv3O8KfUKCKn+LPrQ+mwP JUChV2AjI3Ox9BIg= X-Received: by 2002:a5d:4a0c:: with SMTP id m12mr33964045wrq.156.1593040035403; Wed, 24 Jun 2020 16:07:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfnNWE/9sqXv8jL47+sOvwuQDOYi+8r96QzAn/CWjvk58AmKZl9o3x0PxqfVESffrUI5+H4Q== X-Received: by 2002:a5d:4a0c:: with SMTP id m12mr33964028wrq.156.1593040035222; Wed, 24 Jun 2020 16:07:15 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id z1sm15419081wrh.14.2020.06.24.16.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:14 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 17/19] Rename use_acpi_pci_hotplug to more appropriate use_acpi_hotplug_bridge Message-ID: <20200624230609.703104-18-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Ani Sinha , Aleksandar Markovic , Igor Mammedov , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Ani Sinha Currently, the option use_acpi_pci_hotplug is being used to control device hotplug capability using ACPI for slots of cold plugged bridges. Hence, we are renaming this option to better reflect what it actually does. Signed-off-by: Ani Sinha Message-Id: <1592310699-58916-1-git-send-email-ani.sinha@nutanix.com> Reviewed-by: Igor Mammedov Signed-off-by: Ani Sinha Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/piix4.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 1262abc77a..630ca6ec87 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -77,7 +77,7 @@ typedef struct PIIX4PMState { Notifier powerdown_notifier; AcpiPciHpState acpi_pci_hotplug; - bool use_acpi_pci_hotplug; + bool use_acpi_hotplug_bridge; uint8_t disable_s3; uint8_t disable_s4; @@ -204,16 +204,17 @@ static const VMStateDescription vmstate_pci_status = { } }; -static bool vmstate_test_use_acpi_pci_hotplug(void *opaque, int version_id) +static bool vmstate_test_use_acpi_hotplug_bridge(void *opaque, int version_id) { PIIX4PMState *s = opaque; - return s->use_acpi_pci_hotplug; + return s->use_acpi_hotplug_bridge; } -static bool vmstate_test_no_use_acpi_pci_hotplug(void *opaque, int version_id) +static bool vmstate_test_no_use_acpi_hotplug_bridge(void *opaque, + int version_id) { PIIX4PMState *s = opaque; - return !s->use_acpi_pci_hotplug; + return !s->use_acpi_hotplug_bridge; } static bool vmstate_test_use_memhp(void *opaque) @@ -290,11 +291,11 @@ static const VMStateDescription vmstate_acpi = { VMSTATE_STRUCT_TEST( acpi_pci_hotplug.acpi_pcihp_pci_status[ACPI_PCIHP_BSEL_DEFAULT], PIIX4PMState, - vmstate_test_no_use_acpi_pci_hotplug, + vmstate_test_no_use_acpi_hotplug_bridge, 2, vmstate_pci_status, struct AcpiPciHpPciStatus), VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug, PIIX4PMState, - vmstate_test_use_acpi_pci_hotplug), + vmstate_test_use_acpi_hotplug_bridge), VMSTATE_END_OF_LIST() }, .subsections = (const VMStateDescription*[]) { @@ -530,7 +531,7 @@ I2CBus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base, s->smi_irq = smi_irq; s->smm_enabled = smm_enabled; if (xen_enabled()) { - s->use_acpi_pci_hotplug = false; + s->use_acpi_hotplug_bridge = false; } pci_realize_and_unref(pci_dev, bus, &error_fatal); @@ -595,7 +596,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe); acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, - s->use_acpi_pci_hotplug); + s->use_acpi_hotplug_bridge); s->cpu_hotplug_legacy = true; object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", @@ -633,7 +634,7 @@ static Property piix4_pm_properties[] = { DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0), DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2), DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState, - use_acpi_pci_hotplug, true), + use_acpi_hotplug_bridge, true), DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState, acpi_memory_hotplug.is_enabled, true), DEFINE_PROP_END_OF_LIST(), From patchwork Wed Jun 24 23:07:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316648 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=C3JT2nP8; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sfHb5px1z9sRW for ; Thu, 25 Jun 2020 09:19:39 +1000 (AEST) Received: from localhost ([::1]:55800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEg5-0003fB-IB for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:19:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUG-00010w-NT for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:24 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:50652 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEUD-0001iW-UD for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040041; 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=O1Pk0uuKND2QavcxSvQGg35kYy9TBUCkwDwrM5cX6Tw=; b=C3JT2nP8cXRzRRIdxPn6Qhi40ayUiXBlF+js6U+2AkcUUdv+6lvZiXUGTzOT2hhX7i01mD xeQkj+nLJBG6P2slnQAWdS4TT37+T72S6nmLKXYozdx5nFfOAZwAJrIaR+0RK1VHDNsiU0 sewW6mqvOqZxn9rI4wS4oy6iIHz5+jM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-140-l9ig1ZxqNXm2V0eMMTKsHQ-1; Wed, 24 Jun 2020 19:07:19 -0400 X-MC-Unique: l9ig1ZxqNXm2V0eMMTKsHQ-1 Received: by mail-wm1-f69.google.com with SMTP id o13so4787495wmh.9 for ; Wed, 24 Jun 2020 16:07:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=O1Pk0uuKND2QavcxSvQGg35kYy9TBUCkwDwrM5cX6Tw=; b=LSWTe2UfcvoUi5ttR4hRk9WkQ/b3UgBeM4nQnosuIrxfsqVP8k0yPKmZLfW4L5ud5O fnLtn7k4lH4F8y9UB+3Bln+53xiAaglid78lpXRt+XDLsvIZNPDP5oYYD2aNOzlG2Pul L9I0MQED+YASunT2uZ4odCkzsPN+FsOx2Wtva8ekdaFgmWzo3wO81+4sxxRY+RNyCgVk wIQfPHYnWP8dFBn6Eipod7PG8cJ9c4rcnGxbO6klrTAMko3R3OOZr/KmkQQwCzDWgKO1 8EskdIqLLtrhpL2O+CZc4+SnAD61X6Ka+4WV7PYzgv0OYZxrGw/3IhHoICIVt5zM8oRx oWRQ== X-Gm-Message-State: AOAM5325kudeVl4GJd8S8ISvdH6ygQ2zzr46C8UezqXgDRg5TJFPvT/m QM9rJyVRmS19CyKEnQWq4ylIJ8kq3a2zbzZnI05W3sfVXVnGh4meLfTrSGHN4gatznpLTacpMDj 8yP8z3592Ndue2Xk= X-Received: by 2002:a1c:9ad8:: with SMTP id c207mr100879wme.45.1593040038028; Wed, 24 Jun 2020 16:07:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5k3ZVx6jwJ4pTZntrtJ2ymfH21rA0QK7PB/58sNX0lJBZnypz7rwZtBxI6hxb/y30pTX+PA== X-Received: by 2002:a1c:9ad8:: with SMTP id c207mr100852wme.45.1593040037802; Wed, 24 Jun 2020 16:07:17 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id l17sm10210326wmh.14.2020.06.24.16.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:17 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:15 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 18/19] tests/qtest/bios-tables: Only run the TPM test with CONFIG_TPM enabled Message-ID: <20200624230609.703104-19-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=205.139.110.61; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 00:34:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , eric.auger@redhat.com, Paolo Bonzini , Igor Mammedov , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth "make check-qtest" currently fails if configure has been run with "--disable-tpm" - the TPM-related tests can only work if the TPM is enabled in the build. So let's use the CONFIG_TPM switch to disable the test if TPM is not available. Signed-off-by: Thomas Huth Message-Id: <20200615125402.12898-1-thuth@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Fixes: 5da7c35e25 ("bios-tables-test: Add Q35/TPM-TIS test") Cc: eric.auger@redhat.com Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/qtest/bios-tables-test.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index c315156858..3bd57b830d 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -877,6 +877,8 @@ static void test_acpi_piix4_tcg_numamem(void) free_test_data(&data); } +#ifdef CONFIG_TPM + uint64_t tpm_tis_base_addr; static void test_acpi_tcg_tpm(const char *machine, const char *tpm_if, @@ -935,6 +937,8 @@ static void test_acpi_q35_tcg_tpm_tis(void) test_acpi_tcg_tpm("q35", "tis", 0xFED40000); } +#endif /* CONFIG_TPM */ + static void test_acpi_tcg_dimm_pxm(const char *machine) { test_data data; @@ -1098,7 +1102,9 @@ int main(int argc, char *argv[]) return ret; } +#ifdef CONFIG_TPM qtest_add_func("acpi/q35/tpm-tis", test_acpi_q35_tcg_tpm_tis); +#endif qtest_add_func("acpi/piix4", test_acpi_piix4_tcg); qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge); qtest_add_func("acpi/q35", test_acpi_q35_tcg); From patchwork Wed Jun 24 23:07:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1316640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: 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=breEcmMo; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49sf8Q0YT0z9sRf for ; Thu, 25 Jun 2020 09:13:26 +1000 (AEST) Received: from localhost ([::1]:37310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1joEa3-0002zL-Mf for incoming@patchwork.ozlabs.org; Wed, 24 Jun 2020 19:13:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1joEUH-000154-Vy for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:26 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:37558 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1joEUG-0001jn-7q for qemu-devel@nongnu.org; Wed, 24 Jun 2020 19:07:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593040043; 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=hGOMsAz9jdPgrKOCTlRHBfJs9awMvv/tzRGS1Q+Bj0g=; b=breEcmMozFn9a8FATfx+0BLDBRjsEhJDzIBT4OEbIs/uC4OVKt8cl0XIoI0GGqfIXdr4aL CyoVJn/W2QEdS03YwNw1BkkRPLoea0Z6QouVvAXWfkFAzwLeXjcvhGSNzQTqdN+DWDZu6/ R53o7kDScKJ+PzvFJUkgoqpyd+lM/70= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-tQQugGMjPtqcGeW6nmlCOg-1; Wed, 24 Jun 2020 19:07:21 -0400 X-MC-Unique: tQQugGMjPtqcGeW6nmlCOg-1 Received: by mail-wm1-f71.google.com with SMTP id g124so4625921wmg.6 for ; Wed, 24 Jun 2020 16:07:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hGOMsAz9jdPgrKOCTlRHBfJs9awMvv/tzRGS1Q+Bj0g=; b=e0B7nyiUrzfFjG6xsTW3PXH0YhsHsrYBe74I1EKFCECcebKooGQ9432hZWEUsLznxm nT9AJO1QEcZtV+T6kMlwZm+OBShitpjeBkQiq9BMjM9WoeYqMk+I6WYzV73HGv7AjpnB DvssZcQN1233dT/a5oXeEgZMofquVdTSH0cl5TQs6zz1cHUncU9PapLsDOFFxHEzFJ3M U9vSBGrQCPgnc3efZxg4owHJqj5nrE1AZIDoWLZb2rBLxNrmCEv93bF94/sErCSJb6PS wVl5gg4tK2esVeOn5usDNWM5R2jOTMZlNo3Mr/++ik+e2RdKLqJrKwjIeCp9J/3EBEGQ yaCQ== X-Gm-Message-State: AOAM532TUs4SUo2XnZb8N+W5Prl//8wh4jXadMkxyxEqJf+PBfXBhlz2 kBlZNZEH9FK3MYqxygo5nWlw5ZNvcpZuUjD10XjD9YI86YQg2nGPfRBfiag4pl89DMccxPgUtHR neWCVBOw8xKtetso= X-Received: by 2002:a1c:3286:: with SMTP id y128mr104740wmy.29.1593040040306; Wed, 24 Jun 2020 16:07:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvTsWAdEV23Qi4p4iyVTBg+1P1PR552XP5IZOvvNde2i4Mf0xk9dTqVIxw67NbJOKXU5h9aw== X-Received: by 2002:a1c:3286:: with SMTP id y128mr104728wmy.29.1593040040120; Wed, 24 Jun 2020 16:07:20 -0700 (PDT) Received: from redhat.com (bzq-79-182-31-92.red.bezeqint.net. [79.182.31.92]) by smtp.gmail.com with ESMTPSA id b201sm10008014wmb.36.2020.06.24.16.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 16:07:19 -0700 (PDT) Date: Wed, 24 Jun 2020 19:07:18 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 19/19] tests: disassemble-asm.sh: generate AML in readable format Message-ID: <20200624230609.703104-20-mst@redhat.com> References: <20200624230609.703104-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200624230609.703104-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.81; envelope-from=mst@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/24 01:59:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, 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_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" On systems where the IASL tool exists, we can convert extected ACPI tables to ASL format, which is useful for debugging and documentation purposes. This script does this for all ACPI tables under tests/data/acpi/. Signed-off-by: Michael S. Tsirkin --- tests/data/acpi/disassemle-aml.sh | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 tests/data/acpi/disassemle-aml.sh diff --git a/tests/data/acpi/disassemle-aml.sh b/tests/data/acpi/disassemle-aml.sh new file mode 100755 index 0000000000..1d8a4d0301 --- /dev/null +++ b/tests/data/acpi/disassemle-aml.sh @@ -0,0 +1,52 @@ +#!/usr/bin/bash + +outdir= +while getopts "o:" arg; do + case ${arg} in + o ) + outdir=$OPTARG + ;; + \? ) + echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o ]" + exit 1 + ;; + + esac +done + +for machine in tests/data/acpi/* +do + if [[ ! -d "$machine" ]]; + then + continue + fi + + if [[ "${outdir}" ]]; + then + mkdir -p "${outdir}"/${machine} || exit $? + fi + for aml in $machine/* + do + if [[ "$aml" == $machine/*.dsl ]]; + then + continue + fi + if [[ "$aml" == $machine/SSDT*.* ]]; + then + dsdt=${aml/SSDT*./DSDT.} + extra="-e ${dsdt}" + elif [[ "$aml" == $machine/SSDT* ]]; + then + dsdt=${aml/SSDT*/DSDT}; + extra="-e ${dsdt}" + else + extra="" + fi + asl=${aml}.dsl + if [[ "${outdir}" ]]; + then + asl="${outdir}"/${machine}/${asl} + fi + iasl -d -p ${asl} ${extra} ${aml} + done +done