Virtual memory is allocated to a system management mode (SMM) process to extend a secure memory reserved for SMM. The SMM process requests a page of the virtual memory for which no mapping exists to the secure memory: if a page is available in the secure memory, the virtual memory page is mapped to the available page and if a page is not available, a page in the secure memory is selected for replacement by the virtual memory page. The selected page is encrypted and moved to an external storage device. The virtual memory page is mapped to the address of the selected page in the first memory. If a mapping exists for the virtual memory page to encrypted data in the external storage device then this data is moved to the secure memory address mapped to the virtual memory page and decrypted before the virtual memory page is accessed.