KVM/riscv fixes for 5.19, take #2
- Fix missing PAGE_PFN_MASK - Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests() -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEZdn75s5e6LHDQ+f/rUjsVaLHLAcFAmLOVw0ACgkQrUjsVaLH LAfGJxAAm0vNVW/bTkLCIbokEV3vsh1zumRau2OVkUVjuELvKg1rrDJWFmX/zP43 wEZXpOQLeQBQTP40BbdNBiJmHDD4WjPgJFayFCjwGigb8ijQj4RZNEqZdkoR1Vvx mbNJ7lpg+nsFpyDf0pknpiBnEimXDmT1fSSBkH06SVH3ow6wVT7wpk6YIy6J0f1J e51rNAoYnueddhBY/X+v/WAtohxPRylqH2/XDwaGLsT/gqL+C/BxMNI2UC2at8g2 tinGECVVWJd/0ziX+msz/ps8ZqxWs8Uvx14jZbmqXuHJWopUirZappq5xtdHbvrp W+HnszACNQE/hsNzxL3UhdX+uidqUE/1wKTrWnqM0MfrT3+Kx950s+lzRAE1zGma RLyDBW5zxOrKrxKTIlqCidoNID4Q5gYzS3DXwDW9arjDVPOlvpkhFhVO+cldBSMs YslgXD0qPttvRRo+c2AD/PH7C2v64mIxl1nO1IHAQBiOoDXKSmQFpmBFGEjogkSB SzRm6smyjd3ibK8e9s+yVE68+IBKlhIGxJNGPyoQWc7ZdnQ/nrwIQOMP27toCPkW WQgPWoSPtb324ILX2FITDCNRvAbLAui/64Z/41ifryE3T+vTn6hbKVm7+5IHCS2h 2stHQUyhX1K3VBMxrCBMM++DrXOWUDAagSzkN++yVBLK0FsLiCg= =68rb -----END PGP SIGNATURE----- Merge tag 'kvm-riscv-fixes-5.19-2' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.19, take #2 - Fix missing PAGE_PFN_MASK - Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()
This commit is contained in:
commit
d13122ca3c
@ -175,7 +175,7 @@ static inline pud_t pfn_pud(unsigned long pfn, pgprot_t prot)
|
||||
|
||||
static inline unsigned long _pud_pfn(pud_t pud)
|
||||
{
|
||||
return pud_val(pud) >> _PAGE_PFN_SHIFT;
|
||||
return __page_val_to_pfn(pud_val(pud));
|
||||
}
|
||||
|
||||
static inline pmd_t *pud_pgtable(pud_t pud)
|
||||
@ -278,13 +278,13 @@ static inline p4d_t pfn_p4d(unsigned long pfn, pgprot_t prot)
|
||||
|
||||
static inline unsigned long _p4d_pfn(p4d_t p4d)
|
||||
{
|
||||
return p4d_val(p4d) >> _PAGE_PFN_SHIFT;
|
||||
return __page_val_to_pfn(p4d_val(p4d));
|
||||
}
|
||||
|
||||
static inline pud_t *p4d_pgtable(p4d_t p4d)
|
||||
{
|
||||
if (pgtable_l4_enabled)
|
||||
return (pud_t *)pfn_to_virt(p4d_val(p4d) >> _PAGE_PFN_SHIFT);
|
||||
return (pud_t *)pfn_to_virt(__page_val_to_pfn(p4d_val(p4d)));
|
||||
|
||||
return (pud_t *)pud_pgtable((pud_t) { p4d_val(p4d) });
|
||||
}
|
||||
@ -292,7 +292,7 @@ static inline pud_t *p4d_pgtable(p4d_t p4d)
|
||||
|
||||
static inline struct page *p4d_page(p4d_t p4d)
|
||||
{
|
||||
return pfn_to_page(p4d_val(p4d) >> _PAGE_PFN_SHIFT);
|
||||
return pfn_to_page(__page_val_to_pfn(p4d_val(p4d)));
|
||||
}
|
||||
|
||||
#define pud_index(addr) (((addr) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
|
||||
@ -347,7 +347,7 @@ static inline void pgd_clear(pgd_t *pgd)
|
||||
static inline p4d_t *pgd_pgtable(pgd_t pgd)
|
||||
{
|
||||
if (pgtable_l5_enabled)
|
||||
return (p4d_t *)pfn_to_virt(pgd_val(pgd) >> _PAGE_PFN_SHIFT);
|
||||
return (p4d_t *)pfn_to_virt(__page_val_to_pfn(pgd_val(pgd)));
|
||||
|
||||
return (p4d_t *)p4d_pgtable((p4d_t) { pgd_val(pgd) });
|
||||
}
|
||||
@ -355,7 +355,7 @@ static inline p4d_t *pgd_pgtable(pgd_t pgd)
|
||||
|
||||
static inline struct page *pgd_page(pgd_t pgd)
|
||||
{
|
||||
return pfn_to_page(pgd_val(pgd) >> _PAGE_PFN_SHIFT);
|
||||
return pfn_to_page(__page_val_to_pfn(pgd_val(pgd)));
|
||||
}
|
||||
#define pgd_page(pgd) pgd_page(pgd)
|
||||
|
||||
|
@ -261,7 +261,7 @@ static inline pgd_t pfn_pgd(unsigned long pfn, pgprot_t prot)
|
||||
|
||||
static inline unsigned long _pgd_pfn(pgd_t pgd)
|
||||
{
|
||||
return pgd_val(pgd) >> _PAGE_PFN_SHIFT;
|
||||
return __page_val_to_pfn(pgd_val(pgd));
|
||||
}
|
||||
|
||||
static inline struct page *pmd_page(pmd_t pmd)
|
||||
@ -590,14 +590,14 @@ static inline pmd_t pmd_mkinvalid(pmd_t pmd)
|
||||
return __pmd(pmd_val(pmd) & ~(_PAGE_PRESENT|_PAGE_PROT_NONE));
|
||||
}
|
||||
|
||||
#define __pmd_to_phys(pmd) (pmd_val(pmd) >> _PAGE_PFN_SHIFT << PAGE_SHIFT)
|
||||
#define __pmd_to_phys(pmd) (__page_val_to_pfn(pmd_val(pmd)) << PAGE_SHIFT)
|
||||
|
||||
static inline unsigned long pmd_pfn(pmd_t pmd)
|
||||
{
|
||||
return ((__pmd_to_phys(pmd) & PMD_MASK) >> PAGE_SHIFT);
|
||||
}
|
||||
|
||||
#define __pud_to_phys(pud) (pud_val(pud) >> _PAGE_PFN_SHIFT << PAGE_SHIFT)
|
||||
#define __pud_to_phys(pud) (__page_val_to_pfn(pud_val(pud)) << PAGE_SHIFT)
|
||||
|
||||
static inline unsigned long pud_pfn(pud_t pud)
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ static inline unsigned long gstage_pte_index(gpa_t addr, u32 level)
|
||||
|
||||
static inline unsigned long gstage_pte_page_vaddr(pte_t pte)
|
||||
{
|
||||
return (unsigned long)pfn_to_virt(pte_val(pte) >> _PAGE_PFN_SHIFT);
|
||||
return (unsigned long)pfn_to_virt(__page_val_to_pfn(pte_val(pte)));
|
||||
}
|
||||
|
||||
static int gstage_page_size_to_level(unsigned long page_size, u32 *out_level)
|
||||
|
@ -781,9 +781,11 @@ static void kvm_riscv_check_vcpu_requests(struct kvm_vcpu *vcpu)
|
||||
|
||||
if (kvm_request_pending(vcpu)) {
|
||||
if (kvm_check_request(KVM_REQ_SLEEP, vcpu)) {
|
||||
kvm_vcpu_srcu_read_unlock(vcpu);
|
||||
rcuwait_wait_event(wait,
|
||||
(!vcpu->arch.power_off) && (!vcpu->arch.pause),
|
||||
TASK_INTERRUPTIBLE);
|
||||
kvm_vcpu_srcu_read_lock(vcpu);
|
||||
|
||||
if (vcpu->arch.power_off || vcpu->arch.pause) {
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user