Bug 1842877

Summary: QEMU should print warning if only define high level without low level for hmat-cache
Product: Red Hat Enterprise Linux 9 Reporter: Yumei Huang <yuhuang>
Component: qemu-kvmAssignee: Igor Mammedov <imammedo>
qemu-kvm sub component: QMP Monitor and CLI QA Contact: Yumei Huang <yuhuang>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: medium    
Priority: medium CC: ailan, chayang, imammedo, juzhang, plai, virt-maint
Version: 9.0Keywords: Triaged
Target Milestone: rcFlags: yuhuang: needinfo-
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-02 07:27:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yumei Huang 2020-06-02 09:53:30 UTC
Description of problem:
When configure -numa hmat-cache, if a high level cache is defined, the low level cache must be defined too. Otherwise, this hmat-cache won't take effect, no such cache info inside guest. Details please refer to https://bugzilla.redhat.com/show_bug.cgi?id=1600217#c34.

We need give some warning to tell users about this to avoid incorrect configuration.

Version-Release number of selected component (if applicable):
qemu-kvm-4.2.0-22.module+el8.2.1+6758+cb8d64c2
kernel-4.18.0-193.6.1.el8_2.x86_64

How reproducible:
always

Steps to Reproduce:
1. Boot guest with below cmd,

-object memory-backend-ram,size=1G,id=mem0 \
    -object memory-backend-ram,size=2G,id=mem1 \
    -object memory-backend-ram,size=2G,id=mem2 \
    -numa node,nodeid=0,memdev=mem0  \
    -numa node,nodeid=1,memdev=mem1,initiator=0  \
    -numa node,nodeid=2,memdev=mem2,initiator=0  \
    -numa cpu,node-id=0,socket-id=0 \
    -numa cpu,node-id=0,socket-id=1 \
    -numa hmat-lb,initiator=0,target=0,hierarchy=first-level,data-type=read-latency,latency=5 \
    -numa hmat-lb,initiator=0,target=1,hierarchy=first-level,data-type=write-latency,latency=15 \
    -numa hmat-lb,initiator=0,target=2,hierarchy=first-level,data-type=access-latency,latency=20 \
    -numa hmat-lb,initiator=0,target=0,hierarchy=second-level,data-type=read-bandwidth,bandwidth=200M \
    -numa hmat-lb,initiator=0,target=1,hierarchy=third-level,data-type=write-bandwidth,bandwidth=300M \
    -numa hmat-lb,initiator=0,target=2,hierarchy=memory,data-type=access-bandwidth,bandwidth=400M \
    -numa hmat-cache,node-id=0,size=30K,level=1,associativity=none,policy=write-through,line=4 \
    -numa hmat-cache,node-id=1,size=40K,level=2,associativity=direct,policy=write-back,line=8 \
    -numa hmat-cache,node-id=2,size=50K,level=3,associativity=complex,policy=write-back,line=16

2.
3.

Actual results:
Guest boot up without error, but no hmat cache info for node 1 and 2.

Expected results:
QEMU quit with appropriate warning.

Additional info:

Comment 1 John Ferlan 2020-06-03 19:22:55 UTC
Amnon - this is numa/cache related from a bug Paul Lai worked on

Comment 3 Igor Mammedov 2020-09-22 12:34:17 UTC
ACPI spec doesn't restrict what cache levels that could be in HMAT,
neither does kernel (from a quick look at code)

After dumping ACPI tables in guest, there is only one cache entry.
So I'd guess that it's lost somewhere in QEMU.
I'll poke some more into QEMU to see if dropping cache info is legit or not.
(provisionally, I'd say it's QEMU bug)

Comment 5 John Ferlan 2021-09-08 21:52:36 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 7 RHEL Program Management 2021-12-02 07:27:05 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 9 Yumei Huang 2022-02-23 02:36:09 UTC
Tested with qemu-kvm-6.2.0-7.el9, the issue is gone, an error message is printed and qemu quit when boot guest with the cmdline in description. 

So changing to CURRENTRELEASE.