From: kernel test robot <lkp@intel.com>
To: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCHv9 06/17] x86/mm: Make x86_platform.guest.enc_status_change_*() return errno
Date: Fri, 5 Apr 2024 12:44:59 +0800 [thread overview]
Message-ID: <202404051207.YGViuP7O-lkp@intel.com> (raw)
In-Reply-To: <20240325103911.2651793-7-kirill.shutemov@linux.intel.com>
Hi Kirill,
kernel test robot noticed the following build errors:
[auto build test ERROR on rafael-pm/linux-next]
[also build test ERROR on linus/master v6.9-rc2]
[cannot apply to tip/x86/core tip/x86/mm rafael-pm/acpi-bus rafael-pm/devprop next-20240405]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kirill-A-Shutemov/x86-acpi-Extract-ACPI-MADT-wakeup-code-into-a-separate-file/20240404-032544
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
patch link: https://lore.kernel.org/r/20240325103911.2651793-7-kirill.shutemov%40linux.intel.com
patch subject: [PATCHv9 06/17] x86/mm: Make x86_platform.guest.enc_status_change_*() return errno
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20240405/202404051207.YGViuP7O-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240405/202404051207.YGViuP7O-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404051207.YGViuP7O-lkp@intel.com/
All errors (new ones prefixed by >>):
>> arch/x86/hyperv/ivm.c:551:3: error: use of undeclared identifier 'result'
551 | result = false;
| ^
arch/x86/hyperv/ivm.c:587:3: error: use of undeclared identifier 'result'
587 | result = false;
| ^
>> arch/x86/hyperv/ivm.c:662:47: error: incompatible function pointer types assigning to 'int (*)(unsigned long, int, bool)' (aka 'int (*)(unsigned long, int, _Bool)') from 'bool (unsigned long, int, bool)' (aka '_Bool (unsigned long, int, _Bool)') [-Wincompatible-function-pointer-types]
662 | x86_platform.guest.enc_status_change_prepare = hv_vtom_clear_present;
| ^ ~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
vim +/result +551 arch/x86/hyperv/ivm.c
0f34d11234868d Michael Kelley 2024-01-15 530
810a521265023a Tianyu Lan 2021-10-25 531 /*
812b0597fb4043 Michael Kelley 2023-03-26 532 * hv_vtom_set_host_visibility - Set specified memory visible to host.
810a521265023a Tianyu Lan 2021-10-25 533 *
810a521265023a Tianyu Lan 2021-10-25 534 * In Isolation VM, all guest memory is encrypted from host and guest
810a521265023a Tianyu Lan 2021-10-25 535 * needs to set memory visible to host via hvcall before sharing memory
810a521265023a Tianyu Lan 2021-10-25 536 * with host. This function works as wrap of hv_mark_gpa_visibility()
810a521265023a Tianyu Lan 2021-10-25 537 * with memory base and size.
810a521265023a Tianyu Lan 2021-10-25 538 */
93c65513f71649 Kirill A. Shutemov 2024-03-25 539 static int hv_vtom_set_host_visibility(unsigned long kbuffer, int pagecount, bool enc)
810a521265023a Tianyu Lan 2021-10-25 540 {
812b0597fb4043 Michael Kelley 2023-03-26 541 enum hv_mem_host_visibility visibility = enc ?
812b0597fb4043 Michael Kelley 2023-03-26 542 VMBUS_PAGE_NOT_VISIBLE : VMBUS_PAGE_VISIBLE_READ_WRITE;
810a521265023a Tianyu Lan 2021-10-25 543 u64 *pfn_array;
9fef276f9f416a Michael Kelley 2024-01-15 544 phys_addr_t paddr;
9fef276f9f416a Michael Kelley 2024-01-15 545 void *vaddr;
810a521265023a Tianyu Lan 2021-10-25 546 int ret = 0;
810a521265023a Tianyu Lan 2021-10-25 547 int i, pfn;
810a521265023a Tianyu Lan 2021-10-25 548
810a521265023a Tianyu Lan 2021-10-25 549 pfn_array = kmalloc(HV_HYP_PAGE_SIZE, GFP_KERNEL);
0f34d11234868d Michael Kelley 2024-01-15 550 if (!pfn_array) {
0f34d11234868d Michael Kelley 2024-01-15 @551 result = false;
0f34d11234868d Michael Kelley 2024-01-15 552 goto err_set_memory_p;
0f34d11234868d Michael Kelley 2024-01-15 553 }
810a521265023a Tianyu Lan 2021-10-25 554
810a521265023a Tianyu Lan 2021-10-25 555 for (i = 0, pfn = 0; i < pagecount; i++) {
9fef276f9f416a Michael Kelley 2024-01-15 556 /*
9fef276f9f416a Michael Kelley 2024-01-15 557 * Use slow_virt_to_phys() because the PRESENT bit has been
9fef276f9f416a Michael Kelley 2024-01-15 558 * temporarily cleared in the PTEs. slow_virt_to_phys() works
9fef276f9f416a Michael Kelley 2024-01-15 559 * without the PRESENT bit while virt_to_hvpfn() or similar
9fef276f9f416a Michael Kelley 2024-01-15 560 * does not.
9fef276f9f416a Michael Kelley 2024-01-15 561 */
9fef276f9f416a Michael Kelley 2024-01-15 562 vaddr = (void *)kbuffer + (i * HV_HYP_PAGE_SIZE);
9fef276f9f416a Michael Kelley 2024-01-15 563 paddr = slow_virt_to_phys(vaddr);
9fef276f9f416a Michael Kelley 2024-01-15 564 pfn_array[pfn] = paddr >> HV_HYP_PAGE_SHIFT;
810a521265023a Tianyu Lan 2021-10-25 565 pfn++;
810a521265023a Tianyu Lan 2021-10-25 566
810a521265023a Tianyu Lan 2021-10-25 567 if (pfn == HV_MAX_MODIFY_GPA_REP_COUNT || i == pagecount - 1) {
810a521265023a Tianyu Lan 2021-10-25 568 ret = hv_mark_gpa_visibility(pfn, pfn_array,
810a521265023a Tianyu Lan 2021-10-25 569 visibility);
93c65513f71649 Kirill A. Shutemov 2024-03-25 570 if (ret)
810a521265023a Tianyu Lan 2021-10-25 571 goto err_free_pfn_array;
810a521265023a Tianyu Lan 2021-10-25 572 pfn = 0;
810a521265023a Tianyu Lan 2021-10-25 573 }
810a521265023a Tianyu Lan 2021-10-25 574 }
810a521265023a Tianyu Lan 2021-10-25 575
810a521265023a Tianyu Lan 2021-10-25 576 err_free_pfn_array:
810a521265023a Tianyu Lan 2021-10-25 577 kfree(pfn_array);
0f34d11234868d Michael Kelley 2024-01-15 578
0f34d11234868d Michael Kelley 2024-01-15 579 err_set_memory_p:
0f34d11234868d Michael Kelley 2024-01-15 580 /*
0f34d11234868d Michael Kelley 2024-01-15 581 * Set the PTE PRESENT bits again to revert what hv_vtom_clear_present()
0f34d11234868d Michael Kelley 2024-01-15 582 * did. Do this even if there is an error earlier in this function in
0f34d11234868d Michael Kelley 2024-01-15 583 * order to avoid leaving the memory range in a "broken" state. Setting
0f34d11234868d Michael Kelley 2024-01-15 584 * the PRESENT bits shouldn't fail, but return an error if it does.
0f34d11234868d Michael Kelley 2024-01-15 585 */
0f34d11234868d Michael Kelley 2024-01-15 586 if (set_memory_p(kbuffer, pagecount))
0f34d11234868d Michael Kelley 2024-01-15 587 result = false;
0f34d11234868d Michael Kelley 2024-01-15 588
93c65513f71649 Kirill A. Shutemov 2024-03-25 589 return ret;
812b0597fb4043 Michael Kelley 2023-03-26 590 }
812b0597fb4043 Michael Kelley 2023-03-26 591
812b0597fb4043 Michael Kelley 2023-03-26 592 static bool hv_vtom_tlb_flush_required(bool private)
812b0597fb4043 Michael Kelley 2023-03-26 593 {
0f34d11234868d Michael Kelley 2024-01-15 594 /*
0f34d11234868d Michael Kelley 2024-01-15 595 * Since hv_vtom_clear_present() marks the PTEs as "not present"
0f34d11234868d Michael Kelley 2024-01-15 596 * and flushes the TLB, they can't be in the TLB. That makes the
0f34d11234868d Michael Kelley 2024-01-15 597 * flush controlled by this function redundant, so return "false".
0f34d11234868d Michael Kelley 2024-01-15 598 */
0f34d11234868d Michael Kelley 2024-01-15 599 return false;
812b0597fb4043 Michael Kelley 2023-03-26 600 }
812b0597fb4043 Michael Kelley 2023-03-26 601
812b0597fb4043 Michael Kelley 2023-03-26 602 static bool hv_vtom_cache_flush_required(void)
812b0597fb4043 Michael Kelley 2023-03-26 603 {
812b0597fb4043 Michael Kelley 2023-03-26 604 return false;
812b0597fb4043 Michael Kelley 2023-03-26 605 }
812b0597fb4043 Michael Kelley 2023-03-26 606
812b0597fb4043 Michael Kelley 2023-03-26 607 static bool hv_is_private_mmio(u64 addr)
812b0597fb4043 Michael Kelley 2023-03-26 608 {
812b0597fb4043 Michael Kelley 2023-03-26 609 /*
812b0597fb4043 Michael Kelley 2023-03-26 610 * Hyper-V always provides a single IO-APIC in a guest VM.
812b0597fb4043 Michael Kelley 2023-03-26 611 * When a paravisor is used, it is emulated by the paravisor
812b0597fb4043 Michael Kelley 2023-03-26 612 * in the guest context and must be mapped private.
812b0597fb4043 Michael Kelley 2023-03-26 613 */
812b0597fb4043 Michael Kelley 2023-03-26 614 if (addr >= HV_IOAPIC_BASE_ADDRESS &&
812b0597fb4043 Michael Kelley 2023-03-26 615 addr < (HV_IOAPIC_BASE_ADDRESS + PAGE_SIZE))
812b0597fb4043 Michael Kelley 2023-03-26 616 return true;
812b0597fb4043 Michael Kelley 2023-03-26 617
812b0597fb4043 Michael Kelley 2023-03-26 618 /* Same with a vTPM */
812b0597fb4043 Michael Kelley 2023-03-26 619 if (addr >= VTPM_BASE_ADDRESS &&
812b0597fb4043 Michael Kelley 2023-03-26 620 addr < (VTPM_BASE_ADDRESS + PAGE_SIZE))
812b0597fb4043 Michael Kelley 2023-03-26 621 return true;
812b0597fb4043 Michael Kelley 2023-03-26 622
812b0597fb4043 Michael Kelley 2023-03-26 623 return false;
810a521265023a Tianyu Lan 2021-10-25 624 }
846da38de0e822 Tianyu Lan 2021-12-13 625
812b0597fb4043 Michael Kelley 2023-03-26 626 void __init hv_vtom_init(void)
812b0597fb4043 Michael Kelley 2023-03-26 627 {
d3a9d7e49d1531 Dexuan Cui 2023-08-24 628 enum hv_isolation_type type = hv_get_isolation_type();
d3a9d7e49d1531 Dexuan Cui 2023-08-24 629
d3a9d7e49d1531 Dexuan Cui 2023-08-24 630 switch (type) {
d3a9d7e49d1531 Dexuan Cui 2023-08-24 631 case HV_ISOLATION_TYPE_VBS:
d3a9d7e49d1531 Dexuan Cui 2023-08-24 632 fallthrough;
812b0597fb4043 Michael Kelley 2023-03-26 633 /*
812b0597fb4043 Michael Kelley 2023-03-26 634 * By design, a VM using vTOM doesn't see the SEV setting,
812b0597fb4043 Michael Kelley 2023-03-26 635 * so SEV initialization is bypassed and sev_status isn't set.
812b0597fb4043 Michael Kelley 2023-03-26 636 * Set it here to indicate a vTOM VM.
d3a9d7e49d1531 Dexuan Cui 2023-08-24 637 *
d3a9d7e49d1531 Dexuan Cui 2023-08-24 638 * Note: if CONFIG_AMD_MEM_ENCRYPT is not set, sev_status is
d3a9d7e49d1531 Dexuan Cui 2023-08-24 639 * defined as 0ULL, to which we can't assigned a value.
812b0597fb4043 Michael Kelley 2023-03-26 640 */
d3a9d7e49d1531 Dexuan Cui 2023-08-24 641 #ifdef CONFIG_AMD_MEM_ENCRYPT
d3a9d7e49d1531 Dexuan Cui 2023-08-24 642 case HV_ISOLATION_TYPE_SNP:
812b0597fb4043 Michael Kelley 2023-03-26 643 sev_status = MSR_AMD64_SNP_VTOM;
da86eb96118407 Borislav Petkov (AMD 2023-05-08 644) cc_vendor = CC_VENDOR_AMD;
d3a9d7e49d1531 Dexuan Cui 2023-08-24 645 break;
d3a9d7e49d1531 Dexuan Cui 2023-08-24 646 #endif
d3a9d7e49d1531 Dexuan Cui 2023-08-24 647
d3a9d7e49d1531 Dexuan Cui 2023-08-24 648 case HV_ISOLATION_TYPE_TDX:
d3a9d7e49d1531 Dexuan Cui 2023-08-24 649 cc_vendor = CC_VENDOR_INTEL;
d3a9d7e49d1531 Dexuan Cui 2023-08-24 650 break;
d3a9d7e49d1531 Dexuan Cui 2023-08-24 651
d3a9d7e49d1531 Dexuan Cui 2023-08-24 652 default:
d3a9d7e49d1531 Dexuan Cui 2023-08-24 653 panic("hv_vtom_init: unsupported isolation type %d\n", type);
d3a9d7e49d1531 Dexuan Cui 2023-08-24 654 }
d3a9d7e49d1531 Dexuan Cui 2023-08-24 655
812b0597fb4043 Michael Kelley 2023-03-26 656 cc_set_mask(ms_hyperv.shared_gpa_boundary);
812b0597fb4043 Michael Kelley 2023-03-26 657 physical_mask &= ms_hyperv.shared_gpa_boundary - 1;
812b0597fb4043 Michael Kelley 2023-03-26 658
812b0597fb4043 Michael Kelley 2023-03-26 659 x86_platform.hyper.is_private_mmio = hv_is_private_mmio;
812b0597fb4043 Michael Kelley 2023-03-26 660 x86_platform.guest.enc_cache_flush_required = hv_vtom_cache_flush_required;
812b0597fb4043 Michael Kelley 2023-03-26 661 x86_platform.guest.enc_tlb_flush_required = hv_vtom_tlb_flush_required;
0f34d11234868d Michael Kelley 2024-01-15 @662 x86_platform.guest.enc_status_change_prepare = hv_vtom_clear_present;
812b0597fb4043 Michael Kelley 2023-03-26 663 x86_platform.guest.enc_status_change_finish = hv_vtom_set_host_visibility;
c957f1f3c498bc Juergen Gross 2023-05-02 664
c957f1f3c498bc Juergen Gross 2023-05-02 665 /* Set WB as the default cache mode. */
c957f1f3c498bc Juergen Gross 2023-05-02 666 mtrr_overwrite_state(NULL, 0, MTRR_TYPE_WRBACK);
812b0597fb4043 Michael Kelley 2023-03-26 667 }
812b0597fb4043 Michael Kelley 2023-03-26 668
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-04-05 4:45 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 10:38 [PATCHv9 00/17] x86/tdx: Add kexec support Kirill A. Shutemov
2024-03-25 10:38 ` [PATCHv9 01/17] x86/acpi: Extract ACPI MADT wakeup code into a separate file Kirill A. Shutemov
2024-03-25 10:38 ` [PATCHv9 02/17] x86/apic: Mark acpi_mp_wake_* variables as __ro_after_init Kirill A. Shutemov
2024-03-25 10:38 ` [PATCHv9 03/17] cpu/hotplug: Add support for declaring CPU offlining not supported Kirill A. Shutemov
2024-03-25 10:38 ` [PATCHv9 04/17] cpu/hotplug, x86/acpi: Disable CPU offlining for ACPI MADT wakeup Kirill A. Shutemov
2024-03-25 10:38 ` [PATCHv9 05/17] x86/kexec: Keep CR4.MCE set during kexec for TDX guest Kirill A. Shutemov
2024-03-29 15:21 ` Xiaoyao Li
2024-03-29 15:21 ` Xiaoyao Li
2024-03-29 16:48 ` Kirill A. Shutemov
2024-03-29 16:48 ` Kirill A. Shutemov
2024-04-02 15:42 ` Kirill A. Shutemov
2024-04-02 15:42 ` Kirill A. Shutemov
2024-04-03 21:40 ` Huang, Kai
2024-04-03 21:40 ` Huang, Kai
2024-04-04 9:32 ` Kirill A. Shutemov
2024-04-04 9:32 ` Kirill A. Shutemov
2025-03-17 9:27 ` David Woodhouse
2025-03-17 11:03 ` Kirill A. Shutemov
2025-03-17 11:32 ` David Woodhouse
2025-03-17 11:59 ` Kirill A. Shutemov
2024-04-03 15:23 ` [PATCHv9.1 " Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 06/17] x86/mm: Make x86_platform.guest.enc_status_change_*() return errno Kirill A. Shutemov
2024-03-26 10:30 ` Huang, Kai
2024-03-26 10:30 ` Huang, Kai
2024-03-27 12:34 ` [PATCHv9.1 " Kirill A. Shutemov
2024-03-29 4:49 ` [PATCHv9 " kernel test robot
2024-04-05 4:44 ` kernel test robot [this message]
2024-03-25 10:39 ` [PATCHv9 07/17] x86/mm: Return correct level from lookup_address() if pte is none Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 08/17] x86/tdx: Account shared memory Kirill A. Shutemov
2024-03-25 15:43 ` Kuppuswamy Sathyanarayanan
2024-03-25 15:43 ` Kuppuswamy Sathyanarayanan
2024-03-26 10:30 ` Huang, Kai
2024-03-26 10:30 ` Huang, Kai
2024-03-25 10:39 ` [PATCHv9 09/17] x86/mm: Adding callbacks to prepare encrypted memory for kexec Kirill A. Shutemov
2024-04-03 22:33 ` Huang, Kai
2024-04-03 22:33 ` Huang, Kai
2024-03-25 10:39 ` [PATCHv9 10/17] x86/tdx: Convert shared memory back to private on kexec Kirill A. Shutemov
2024-03-26 10:31 ` Huang, Kai
2024-03-26 10:31 ` Huang, Kai
2024-03-25 10:39 ` [PATCHv9 11/17] x86/mm: Make e820_end_ram_pfn() cover E820_TYPE_ACPI ranges Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 12/17] x86/acpi: Rename fields in acpi_madt_multiproc_wakeup structure Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 13/17] x86/acpi: Do not attempt to bring up secondary CPUs in kexec case Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 14/17] x86/smp: Add smp_ops.stop_this_cpu() callback Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 15/17] x86/mm: Introduce kernel_ident_mapping_free() Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 16/17] x86/acpi: Add support for CPU offlining for ACPI MADT wakeup method Kirill A. Shutemov
2024-03-25 10:39 ` [PATCHv9 17/17] ACPI: tables: Print MULTIPROC_WAKEUP when MADT is parsed Kirill A. Shutemov
2024-03-26 10:32 ` Huang, Kai
2024-03-26 10:32 ` Huang, Kai
2024-03-26 17:53 ` Kuppuswamy Sathyanarayanan
2024-03-26 17:53 ` Kuppuswamy Sathyanarayanan
2024-04-04 18:27 ` [PATCHv9 00/17] x86/tdx: Add kexec support Kalra, Ashish
2024-04-04 18:27 ` Kalra, Ashish
2024-04-07 15:55 ` Kirill A. Shutemov
2024-04-07 15:55 ` Kirill A. Shutemov
2024-04-04 23:10 ` [PATCH v3 0/4] x86/snp: " Ashish Kalra
2024-04-04 23:10 ` Ashish Kalra
2024-04-04 23:11 ` [PATCH v3 1/4] efi/x86: skip efi_arch_mem_reserve() in case of kexec Ashish Kalra
2024-04-04 23:11 ` Ashish Kalra
2024-04-05 17:02 ` Kuppuswamy Sathyanarayanan
2024-04-05 17:02 ` Kuppuswamy Sathyanarayanan
2024-04-04 23:11 ` [PATCH v3 2/4] x86/sev: add sev_es_enabled() function Ashish Kalra
2024-04-04 23:11 ` Ashish Kalra
2024-04-05 17:03 ` Kuppuswamy Sathyanarayanan
2024-04-05 17:03 ` Kuppuswamy Sathyanarayanan
2024-04-04 23:11 ` [PATCH v3 3/4] x86/boot/compressed: Skip Video Memory access in Decompressor for SEV-ES/SNP Ashish Kalra
2024-04-04 23:11 ` Ashish Kalra
2024-04-05 17:05 ` Kuppuswamy Sathyanarayanan
2024-04-05 17:05 ` Kuppuswamy Sathyanarayanan
2024-04-04 23:11 ` [PATCH v3 4/4] x86/snp: Convert shared memory back to private on kexec Ashish Kalra
2024-04-04 23:11 ` Ashish Kalra
2024-04-05 11:30 ` kernel test robot
2024-04-05 11:30 ` kernel test robot
2024-04-05 11:34 ` kernel test robot
2024-04-05 11:34 ` kernel test robot
2024-04-05 11:36 ` kernel test robot
2024-04-05 11:36 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404051207.YGViuP7O-lkp@intel.com \
--to=lkp@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.