{"action":"created","issue":{"url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/25","repository_url":"https://api.github.com/repos/CTSRD-CHERI/qemu","labels_url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/25/comments","events_url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/25/events","html_url":"https://github.com/CTSRD-CHERI/qemu/issues/25","id":194949744,"number":25,"title":"SC/SCD don't adjust for C0","user":{"login":"bacam","id":1666370,"avatar_url":"https://avatars.githubusercontent.com/u/1666370?v=3","gravatar_id":"","url":"https://api.github.com/users/bacam","html_url":"https://github.com/bacam","followers_url":"https://api.github.com/users/bacam/followers","following_url":"https://api.github.com/users/bacam/following{/other_user}","gists_url":"https://api.github.com/users/bacam/gists{/gist_id}","starred_url":"https://api.github.com/users/bacam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacam/subscriptions","organizations_url":"https://api.github.com/users/bacam/orgs","repos_url":"https://api.github.com/users/bacam/repos","events_url":"https://api.github.com/users/bacam/events{/privacy}","received_events_url":"https://api.github.com/users/bacam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-12T11:21:40Z","updated_at":"2016-12-15T10:44:54Z","closed_at":null,"body":"The standard MIPS store conditional instructions aren't adjusted by the default data capability, C0 (or checked against, it appears).  For example, with an unaligned base for C0 and matching address in $2:\r\n\r\n    CapReg 0 <- t:1 s:0 perms:0x7fffffff type:0x000000 offset:0x0000000000000000 base:0x0000000000000001 length:0xfffffffffffffffe\r\n    Reg 2 <- 0x000000004000100f\r\n\r\nThe L3 model manages a linked load / store conditional\r\n\r\n    instr 0 805 00000000400007fc : c0410000   ll          $1, 0($2)\r\n    Load of 4 byte(s) from vAddr 0x0000000040001010\r\n    Reg 1 <- 0x0000000000000000\r\n    instr 0 806 0000000040000800 : e0410000   sc          $1, 0($2)\r\n    Store 0x0000000000000000, mask 0xffffffff00000000 (4 byte(s)) at vAddr 0x0000000040001010\r\n\r\nwhereas qemu raises an exception for an unaligned load on the `sc`\r\n\r\n    0x00000000400007fc:  ll at,0(v0)\r\n        Write at = 0000000000000000\r\n        Write LLAddr = 0000000004000101\r\n    0x0000000040000800:  sc at,0(v0)\r\n    mips_cpu_do_interrupt enter: PC 0000000040000800 EPC b66f68a40e1e6de8 address error store exception\r\n        Write BadVAddr = 000000004000100f\r\n"},"comment":{"url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/comments/267297215","html_url":"https://github.com/CTSRD-CHERI/qemu/issues/25#issuecomment-267297215","issue_url":"https://api.github.com/repos/CTSRD-CHERI/qemu/issues/25","id":267297215,"user":{"login":"bacam","id":1666370,"avatar_url":"https://avatars.githubusercontent.com/u/1666370?v=3","gravatar_id":"","url":"https://api.github.com/users/bacam","html_url":"https://github.com/bacam","followers_url":"https://api.github.com/users/bacam/followers","following_url":"https://api.github.com/users/bacam/following{/other_user}","gists_url":"https://api.github.com/users/bacam/gists{/gist_id}","starred_url":"https://api.github.com/users/bacam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacam/subscriptions","organizations_url":"https://api.github.com/users/bacam/orgs","repos_url":"https://api.github.com/users/bacam/repos","events_url":"https://api.github.com/users/bacam/events{/privacy}","received_events_url":"https://api.github.com/users/bacam/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T10:44:54Z","updated_at":"2016-12-15T10:44:54Z","body":"It affects the calculated address, too.  If I increase the base of C0 to 4, then L3 still does the store\r\n\r\n    instr 0 806 0000000040000804 : e0410000   sc          $1, 0($2)\r\n    Store 0x1000000000000000, mask 0xffffffff00000000 (4 byte(s)) at vAddr 0xffffffffbfc00420\r\n    Reg 1 <- 0x0000000000000001\r\n\r\nbut qemu rejects it:\r\n\r\n    0x0000000040000804:  sc at,0(v0)\r\n        Write at = 0000000000000000\r\n"}}
{"actor":{"display_login":"bacam"}}