From patchwork Tue Apr 30 15:06:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Beschow X-Patchwork-Id: 1929655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=iJNnmVKW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTNq35mBGz1ydT for ; Wed, 1 May 2024 01:07:43 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1p4T-0000zG-D4; Tue, 30 Apr 2024 11:07:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1p4N-0000yH-0T for qemu-devel@nongnu.org; Tue, 30 Apr 2024 11:07:00 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1p4J-00009G-EG for qemu-devel@nongnu.org; Tue, 30 Apr 2024 11:06:58 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-57225322312so7743964a12.1 for ; Tue, 30 Apr 2024 08:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714489613; x=1715094413; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=l6rKvmRL4gsTcoq0SA7Yj4kOTSeo/cETlee74uFfkWo=; b=iJNnmVKW9ZYNeN48AkLuu4yGj9IBkVqRvaWZEx8tNf1YIME7Qk3igPN+Ql0ACnlS9r wGkrNpzWPlAKu74zqTyP8/OgkppKu4Jo+TTTOn5Kqk+wx9/2QJTxueoff3bAkJG1ns7r kV+aHXnfUmLA4Vdzb2KUgCT9L5W1uVE9lKpv7XH6n7I4Kz09r1nqVSaL442WXSTXT5Xv 0Pp9mcOP4rJRggIbJhhpfXyduDqyg+kL+vje8uKxS/1MYmysf1H8WKhnt6EIlE86k10D OHEmczo9r7cqh/TS0yFjHiDpohoDoVLrx+8Zw1Di0N+O6bHny/YBxNKiiGxtjzeC3VzE /6qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714489613; x=1715094413; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=l6rKvmRL4gsTcoq0SA7Yj4kOTSeo/cETlee74uFfkWo=; b=cv0YT4Q+HMKgd/17BeTLjhxlhdW2qRJTL/hl6GcMkdX327+f4h4s59I8qGB5M7ovlT vqY954PxcvJgdA6IppSuCbdkup07y1HZqh1hfPyT142dehqklEiUqoSUc85TcYtj8Wcz 60quf4vqthWeqPYGzgKVBwcWbpbHukKJRLqsv7fJcF6O7mgHRerVw84k107XQVLWC6/v 7u/UvL/zOvPxjmMFILbiMQUBlhDnO4rNuTeTb8usq+jOfpg9/9SZ9MduH3k6xfDMkZxx i0hH6LV0CCKgbVi2eHAxAI9swpgfSbaCPvxCk9CqYdxMY5VMLG+tc5c3dukljysYg4e+ Busw== X-Gm-Message-State: AOJu0YyPElBogGEOv2GasotIF3w6POujRYqMMWDobRZye6Wsp96Nv2PR PGDIyWjpdow6ODL+FLP3xBxQ4sfT2FbIq6TUOZNW8a2mDwdbyJJPibqdhQ== X-Google-Smtp-Source: AGHT+IHwUcflWzCSJnO4X8MplGmb/0Babt4PcKVx+zhCkxNI9UscwU4L01SJA+B2rEX26Q2KbqJb6A== X-Received: by 2002:a50:d556:0:b0:572:a6f5:bc91 with SMTP id f22-20020a50d556000000b00572a6f5bc91mr39321edj.24.1714489612456; Tue, 30 Apr 2024 08:06:52 -0700 (PDT) Received: from archlinux.. (pd9ed788d.dip0.t-ipconnect.de. [217.237.120.141]) by smtp.gmail.com with ESMTPSA id 11-20020a0564021f4b00b005727e826977sm2345741edz.19.2024.04.30.08.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 08:06:52 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost , Sergio Lopez , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Bernhard Beschow Subject: [PATCH v2 0/6] This series changes the "isa-bios" MemoryRegion to be an alias rather than a Date: Tue, 30 Apr 2024 17:06:37 +0200 Message-ID: <20240430150643.111976-1-shentey@gmail.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=shentey@gmail.com; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org region which matches real hardware and which some real-world legacy bioses I'm running rely on. Furthermore, aliasing in the isa-bios area is already the current behavior in the bios (a.k.a. ROM) case, so this series consolidates behavior. For migration compatibility the aliasing is only performed on new versions of the q34 and pc machine types. v2: * Don't leak bios memory regions (Phil) * Add compat machinery (Michael) Testing done: * `make check` with qemu-system-x86_64 (QEMU 8.2.2) installed. All tests including migration tests pass. * `make check-avocado` Best regards, Bernhard Bernhard Beschow (6): hw/i386/x86: Eliminate two if statements in x86_bios_rom_init() hw/i386: Have x86_bios_rom_init() take X86MachineState rather than MachineState hw/i386/x86: Don't leak "isa-bios" memory regions hw/i386/x86: Don't leak "pc.bios" memory region hw/i386/x86: Extract x86_isa_bios_init() from x86_bios_rom_init() hw/i386/pc_sysfw: Alias rather than copy isa-bios region include/hw/i386/pc.h | 1 + include/hw/i386/x86.h | 7 ++++++- hw/i386/microvm.c | 2 +- hw/i386/pc.c | 1 + hw/i386/pc_piix.c | 3 +++ hw/i386/pc_q35.c | 2 ++ hw/i386/pc_sysfw.c | 17 ++++++++++------ hw/i386/x86.c | 45 ++++++++++++++++++++++--------------------- 8 files changed, 48 insertions(+), 30 deletions(-)