[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/26] pci-host/q35: Move PAM initialization above SMRAM initiali
From: |
Paolo Bonzini |
Subject: |
[PATCH 01/26] pci-host/q35: Move PAM initialization above SMRAM initialization |
Date: |
Fri, 22 Mar 2024 19:10:51 +0100 |
From: Isaku Yamahata <isaku.yamahata@intel.com>
In mch_realize(), process PAM initialization before SMRAM initialization so
that later patch can skill all the SMRAM related with a single check.
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
Message-ID: <20240320083945.991426-18-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/pci-host/q35.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index 0d7d4e3f086..98d4a7c253a 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -568,6 +568,16 @@ static void mch_realize(PCIDevice *d, Error **errp)
/* setup pci memory mapping */
pc_pci_as_mapping_init(mch->system_memory, mch->pci_address_space);
+ /* PAM */
+ init_pam(&mch->pam_regions[0], OBJECT(mch), mch->ram_memory,
+ mch->system_memory, mch->pci_address_space,
+ PAM_BIOS_BASE, PAM_BIOS_SIZE);
+ for (i = 0; i < ARRAY_SIZE(mch->pam_regions) - 1; ++i) {
+ init_pam(&mch->pam_regions[i + 1], OBJECT(mch), mch->ram_memory,
+ mch->system_memory, mch->pci_address_space,
+ PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);
+ }
+
/* if *disabled* show SMRAM to all CPUs */
memory_region_init_alias(&mch->smram_region, OBJECT(mch), "smram-region",
mch->pci_address_space,
MCH_HOST_BRIDGE_SMRAM_C_BASE,
@@ -634,15 +644,6 @@ static void mch_realize(PCIDevice *d, Error **errp)
object_property_add_const_link(qdev_get_machine(), "smram",
OBJECT(&mch->smram));
-
- init_pam(&mch->pam_regions[0], OBJECT(mch), mch->ram_memory,
- mch->system_memory, mch->pci_address_space,
- PAM_BIOS_BASE, PAM_BIOS_SIZE);
- for (i = 0; i < ARRAY_SIZE(mch->pam_regions) - 1; ++i) {
- init_pam(&mch->pam_regions[i + 1], OBJECT(mch), mch->ram_memory,
- mch->system_memory, mch->pci_address_space,
- PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);
- }
}
uint64_t mch_mcfg_base(void)
--
2.44.0
- [PATCH for-9.1 00/26] x86, kvm: common confidential computing subset, Paolo Bonzini, 2024/03/22
- [PATCH 01/26] pci-host/q35: Move PAM initialization above SMRAM initialization,
Paolo Bonzini <=
- [PATCH 02/26] q35: Introduce smm_ranges property for q35-pci-host, Paolo Bonzini, 2024/03/22
- [PATCH 03/26] confidential guest support: Add kvm_init() and kvm_reset() in class, Paolo Bonzini, 2024/03/22
- [PATCH 04/26] i386/sev: Switch to use confidential_guest_kvm_init(), Paolo Bonzini, 2024/03/22
- [PATCH 05/26] ppc/pef: switch to use confidential_guest_kvm_init/reset(), Paolo Bonzini, 2024/03/22
- [PATCH 06/26] s390: Switch to use confidential_guest_kvm_init(), Paolo Bonzini, 2024/03/22
- [PATCH 08/26] scripts/update-linux-headers: Add bits.h to file imports, Paolo Bonzini, 2024/03/22
- [PATCH 07/26] scripts/update-linux-headers: Add setup_data.h to import list, Paolo Bonzini, 2024/03/22
- [PATCH 10/26] [TO SQUASH] hw/i386: Remove redeclaration of struct setup_data, Paolo Bonzini, 2024/03/22